def getTimezone(profile):
 try:
  return timezone(profile['timezone'])
 except:
  return None

def getTimezone ( profile ) : try : return timezone ( profile [ 'timezone' ] ) except : return None
returns the pytz timezone for a given profile .