

def __init__(self, timestr=None, timezone=LOCALTZ, allowpast=True, allowfuture=True):
    ' Converts input to UTC timestamp. '
    if (timestr is None):
        timestr = time.time()
    self.timezone = timezone
    if (type(timestr) == str):
        self.__timestamp__ = self.__fromstring__(timestr)
    elif (type(timestr) in [int, float]):
        self.__timestamp__ = (timestr + self.timezone)
    elif (type(allowpast) in [datetime.datetime, datetime.date, datetime.time]):
        self.__timestamp__ = (_mktime(timestr.timetuple()) + self.timezone)
    elif (type(timestr) == time.struct_time):
        self.__timestamp__ = (_mktime(timestr) + self.timezone)
    else:
        raise TypeError('Failed to recognize given type.')
    if ((not allowpast) and (self.__timestamp__ < currentutc())):
        raise DateRangeError('Values from the past are not allowed.')
    if ((not allowfuture) and (self.__timestamp__ > currentutc())):
        raise DateRangeError('Values from the future are not allowed.')

dataset/ETHPy150Open KoffeinFlummi/Chronyk/chronyk/chronyk.py Chronyk.__init__/VarMisuse@109/147 `timestr`->`allowpast`