def _get_time(time, tzinfo=None):
 if (time is None):
  time = datetime.utcnow()
 elif isinstance(time, number_types):
  time = datetime.utcfromtimestamp(time)
 if (time.tzinfo is None):
  time = time.replace(tzinfo=UTC)
 if isinstance(time, datetime):
  if (tzinfo is not None):
   time = time.astimezone(tzinfo)
   if hasattr(tzinfo, 'normalize'):
    time = tzinfo.normalize(time)
  time = time.timetz()
 elif (tzinfo is not None):
  time = time.replace(tzinfo=tzinfo)
 return time

def _get_time ( time , tzinfo = None ) : if ( time is None ) : time = datetime . utcnow ( ) elif isinstance ( time , number_types ) : time = datetime . utcfromtimestamp ( time ) if ( time . tzinfo is None ) : time = time . replace ( tzinfo = UTC ) if isinstance ( time , datetime ) : if ( tzinfo is not None ) : time = time . astimezone ( tzinfo ) if hasattr ( tzinfo , 'normalize' ) : time = tzinfo . normalize ( time ) time = time . timetz ( ) elif ( tzinfo is not None ) : time = time . replace ( tzinfo = tzinfo ) return time
get a timezoned time from a given instant .