Example #1
0
 def __contains__(self, item):
     """
     item can either be unix time or any object with 'a' and 'b' unix time attributes (e.g. a Interval)
     """
     if is_unix_time(item):
         return self.a <= item <= self.b
     return self.a <= item.a and self.b <= item.b
Example #2
0
 def __contains__(self, item):
     """
     item can either be unix time or any object with 'a' and 'b' unix time attributes (e.g. an Interval)
     """
     if is_unix_time(item):
         return self.a <= item and self.b >= item
     return self.a <= item.a and self.b <= item.b
Example #3
0
def is_time_interval(item):
    return hasattr(item, 'a') and hasattr(
        item, 'b') and is_unix_time(item.a) and is_unix_time(item.b) and item.a < item.b
Example #4
0
def is_time_interval(item):
    return hasattr(item, 'a') and hasattr(
        item, 'b') and is_unix_time(item.a) and is_unix_time(item.b) and item.a < item.b
Example #5
0
def is_time_interval(item):
    return (
        hasattr(item, "a") and hasattr(item, "b") and is_unix_time(item.a) and is_unix_time(item.b) and item.a < item.b
    )