def _inside_any_interval(self, intervals: List[Tuple[(float, float)]]) -> bool:
    'Determine if the car is currently in any of the given intervals.'
    beginnings = list((interval[0] for interval in intervals))
    endings = list((interval[1] for interval in intervals))
    b_idx = (bisect.bisect_left(beginnings, self.arc_length) - 1)
    e_idx = (bisect.bisect_left(endings, self.arc_length) - 1)
    return ((b_idx - e_idx) == 1)
Determine if the car is currently in any of the given intervals.
def _inside_any_interval(self, intervals: List[Tuple[(float, float)]]) -> bool:
    
    beginnings = list((interval[0] for interval in intervals))
    endings = list((interval[1] for interval in intervals))
    b_idx = (bisect.bisect_left(beginnings, self.arc_length) - 1)
    e_idx = (bisect.bisect_left(endings, self.arc_length) - 1)
    return ((b_idx - e_idx) == 1)