The code below should work. However the regex will be recompiled every time the function is called, which could lead to considerable overhead since this is a function that will be called lots and lots of times.  For that reason, it might actually be better to define this function in a non-global scope (i.e., define it closer to where it is used; see my comment on line 906).

```python
from re import search

def seq_exceeds_homopolymers(curr_seq, max_len=6):
    if search('A{max_len+1} | T{max_len+1} | G{max_len+1} | C{max_len+1}', curr_seq):
        return True

    return False
```