Suppose I have list of time interval like
a = [datetime.time(0,0),datetime.time(8,0)]
Now I Have lacs of intervals in list like given below.
Your code has errors (usage of datetime/datetime.time).
datetime/datetime.time
This code will filter out from b everything, that does not overlap with a:
b
a
b = [x for x in b if a[0] < x[1] and x[0] < a[1]]