in collection_manager/collection_manager/services/history_manager/IngestionHistory.py [0:0]
def _in_time_range(timestamp: int, start_date: datetime = None, end_date: datetime = None):
"""
:param file: file path as a string
:param date_from: timestamp, can be None
:param date_to: timestamp, can be None
:return: True is the update time of the file is between ts_from and ts_to. False otherwise
"""
is_after_from = int(start_date.timestamp()) < timestamp if start_date else True
is_before_to = int(end_date.timestamp()) > timestamp if end_date else True
return is_after_from and is_before_to