def normalize_time(timestamp):
 offset = timestamp.utcoffset()
 if (offset is None):
  return timestamp
 return (timestamp.replace(tzinfo=None) - offset)

def normalize_time ( timestamp ) : offset = timestamp . utcoffset ( ) if ( offset is None ) : return timestamp return ( timestamp . replace ( tzinfo = None ) - offset )
normalize time in arbitrary timezone to utc naive object .