

def __init__(self, offset, name=None):
    if isinstance(offset, numbers.Integral):
        offset = datetime.timedelta(minutes=offset)
    elif (not isinstance(offset, datetime.timedelta)):
        raise TypeError('offset must be an integer or datetime.timedelta')
    if ((offset < self.MIN_PRECISION) and (total_seconds(offset) > 0)):
        raise ValueError('the minimum precision of offset is minute')
    elif (offset > self.MAX_PRECISION):
        raise ValueError('the maximum precision of offset is hour')
    if (name is None):
        seconds = int(total_seconds(offset))
        if (seconds != 0):
            name = '{0:+03d}:{1:02d}'.format((seconds // 3600), ((abs(seconds) % 3600) // 60))
        else:
            name = 'UTC'
    elif (not isinstance(name, basestring)):
        raise TypeError(('name must be a string, not ' + repr(name)))
    self.offset = offset
    self.name = name

dataset/ETHPy150Open dahlia/sider/sider/datetime.py FixedOffset.__init__/original