def encode_region(name):
 for (tag, (language, region, iso639, iso3166)) in LANGUAGE_REGION.items():
  if (region == name.capitalize()):
   return iso3166

def encode_region ( name ) : for ( tag , ( language , region , iso639 , iso3166 ) ) in LANGUAGE_REGION . items ( ) : if ( region == name . capitalize ( ) ) : return iso3166
returns the region code for the given region name .