Does the interval contain a momentary time?

        Args:
            time: the ``datetime.datetime`` to check
            inclusive: use inclusive rather than exclusive range checks?
195365
def contains(self, time: datetime.datetime,
                 inclusive: bool = True) -> bool:
        
        if inclusive:
            return self.start <= time <= self.end
        else:
            return self.start < time < self.end
331620
def occurring_at?(time)
      time = TimeUtil.match_zone(time, start_time) or raise ArgumentError, "Time required, got #{time.inspect}"
      if duration > 0
        return false if exception_time?(time)
        occurs_between?(time - duration + 1, time)
      else
        occurs_at?(time)
      end
    end
1348386
def change_interval(self, value):
        
        assert not isinstance(value, string_types)
        self.timestamps = []

        for timestamp in value:
            event = EventTime(timestamp)
            self.timestamps.append(event)
369416
def get_time_position(self, time):
        
        if time < self._start or time > self._finish:
            raise ValueError("time argument out of bounds")
        return (time - self._start) / (self._resolution / self._zoom_factor)
575768
def duration_expired(start_time, duration_seconds):
    

    if duration_seconds is not None:
        delta_seconds = datetime_delta_to_seconds(dt.datetime.now() - start_time)

        if delta_seconds >= duration_seconds:
            return True

    return False
4363
def period_for(time)
      raise ArgumentError, 'time must be specified' unless time
      timestamp = Timestamp.for(time)
      raise ArgumentError, 'time must have a specified utc_offset' unless timestamp.utc_offset
      info.period_for(timestamp)
    end
612949
def every_minute(dt=datetime.datetime.utcnow(), fmt=None):
    
    date = datetime.datetime(dt.year, dt.month, dt.day, dt.hour, dt.minute, 1, 0, dt.tzinfo)
    if fmt is not None:
        return date.strftime(fmt)
    return date
519224
def exclude_time(self, start, end, days):
        
        self._excluded_times.append(TimeRange(start, end, days))
        return self
765783
def add_interval(self, precision=0):
        
        precision = precision or self.precision
        interval = round((self._stop - self._start), precision)
        self.intervals.append(interval)
        self._intervals_len += 1
        self._start = time.perf_counter()
        return self.format_time(interval)
1124626
def set(self, time, value, compact=False):
        
        if (len(self) == 0) or (not compact) or \
                (compact and self.get(time) != value):
            self._d[time] = value
206981
def clean_time(self, time):
        
        if isinstance(time, int):
            time = datetime.utcfromtimestamp(time)
        elif isinstance(time, str):
            time = parser.parse(time)

        return time
56326
def interval_timed(interval):
    '''
    '''
    def decorator(f):
        @wraps(f)
        def wrapper(*args, **kwargs):
            stopped = Event()

            def loop():  # executed in another thread
                while not stopped.wait(interval):  # until stopped
                    f(*args, **kwargs)

            t = Thread(name='IntervalTimerThread', target=loop)
            t.daemon = True  # stop if the program exits
            t.start()
            return stopped.set
        return wrapper
    return decorator
117090
def trigger(self):
        ''''''
        tnow = time.time()

        if tnow < self.last_time:
            print("Warning, time moved backwards. Restarting timer.")
            self.last_time = tnow

        if self.last_time + (1.0/self.frequency) <= tnow:
            self.last_time = tnow
            return True
        return False
850153
def convert_time(self, time):
        
        time_string = str(datetime.timedelta(seconds=int(time)))
        if time_string.split(':')[0] == '0':
            time_string = time_string.partition(':')[2]
        return time_string
185417
def start_date(self) -> Optional[datetime.date]:
        
        if not self.intervals:
            return None
        return self.start_datetime().date()
1027266
def clock(seg, seconds):
    
    interval = 0.5
    for i in range(int(seconds / interval)):
        now = datetime.now()
        seg.text = now.strftime("%H-%M-%S")

        # calculate blinking dot
        if i % 2 == 0:
            seg.text = now.strftime("%H-%M-%S")
        else:
            seg.text = now.strftime("%H %M %S")

        time.sleep(interval)
1285944
def is_timeout(self):
        '''
        
        '''
        lapse = datetime.datetime.now() - self.init_time
        return lapse > datetime.timedelta(seconds=self.timeout)