'Convert naive time to local time'

def localize(self, dt, is_dst=False):

    if (dt.tzinfo is not None):
        raise ValueError('Not    naive    datetime    (tzinfo    is    already    set)')
    return dt.replace(tzinfo=self)
