def timezone(zone):
 if (zone.upper() == 'UTC'):
  return utc
 try:
  zone = zone.encode('US-ASCII')
 except UnicodeEncodeError:
  raise UnknownTimeZoneError(zone)
 zone = _unmunge_zone(zone)
 if (zone not in _tzinfo_cache):
  if (zone in all_timezones_set):
   _tzinfo_cache[zone] = build_tzinfo(zone, open_resource(zone))
  else:
   raise UnknownTimeZoneError(zone)
 return _tzinfo_cache[zone]

def timezone ( zone ) : if ( zone . upper ( ) == 'UTC' ) : return utc try : zone = zone . encode ( 'US-ASCII' ) except UnicodeEncodeError : raise UnknownTimeZoneError ( zone ) zone = _unmunge_zone ( zone ) if ( zone not in _tzinfo_cache ) : if ( zone in all_timezones_set ) : _tzinfo_cache [ zone ] = build_tzinfo ( zone , open_resource ( zone ) ) else : raise UnknownTimeZoneError ( zone ) return _tzinfo_cache [ zone ]
return a datetime .