def get_aware_datetime(dt_string, tz=None):
 if (not dt_string):
  return None
 try:
  return make_aware(parse_datetime(dt_string), tz=tz)
 except ValueError:
  raise ArgumentTypeError(('The provided datetime/date string is not valid: "%s"' % dt_string))

def get_aware_datetime ( dt_string , tz = None ) : if ( not dt_string ) : return None try : return make_aware ( parse_datetime ( dt_string ) , tz = tz ) except ValueError : raise ArgumentTypeError ( ( 'The provided datetime/date string is not valid: "%s"' % dt_string ) )
return an aware datetime parsed from a datetime or date string .