def to_naive_utc_dt(dt):
 if (not isinstance(dt, datetime)):
  raise TypeError('Arg must be type datetime')
 if (dt.tzinfo is None):
  return dt
 return dt.astimezone(pytz.utc).replace(tzinfo=None)

def to_naive_utc_dt ( dt ) : if ( not isinstance ( dt , datetime ) ) : raise TypeError ( 'Arg must be type datetime' ) if ( dt . tzinfo is None ) : return dt return dt . astimezone ( pytz . utc ) . replace ( tzinfo = None )
converts a datetime to a naive datetime as follows: if inbound dt is already naive .