def overlap(query, i): return query.start < i.end && query.end > i.start def count_overlaps(query, intervals_set): n_overlaps = 0 for i in interval_set: if overlap(query, i): n_overlaps = n_overlaps +1 return n_overlaps
def overlap(query, i): return query.start < i.end && query.end > i.start def count_overlaps(query, intervals_set): n_overlaps = 0 for i in interval_set: if overlap(query, i): n_overlaps = n_overlaps + 1 return n_overlaps