The answer to your specific question is that if dna_data[i] == formation_count_small[j] compares an int to a string.
However, there are several other problems, so I'm going to offer advice.
Don't hardcode the specific sequences being looked for. The first line of the csv file has the information, get it from there. Then there's no need to look at the exact ...
The databases/small.csv file from the distro code looks like this:
The file is 57 bytes and dated 21-Oct-2019. Perhaps redownload the distro code. (Or correct the file in your favorite editor).
The proximate cause of the infinite loop is this while in the repeatss function:
while dna_str[j : j + len_str] in str_csv[i]:
curr_str += 1
j += len_str
In python, if i is greater than len(s) in slice notation (s[i : j]), it returns the empty string (even though s[i] would return index out of range error).
Your problem is that the nucleotide loop steps through each letter of the sample, but when you find a match your index variable falls out of sync with the letter you are checking.
I generally prefer not to just write code as an answer, but have a look at this variation of your comp_repeats function to see the difference:
def comp_repeats(header, sample):