def get_code2lang_map(lang_code=None, force=False):
 global CODE2LANG_MAP
 if (force or (not CODE2LANG_MAP)):
  lmap = softload_json(settings.LANG_LOOKUP_FILEPATH, logger=logging.debug)
  CODE2LANG_MAP = {}
  for (lc, entry) in lmap.iteritems():
   CODE2LANG_MAP[lcode_to_ietf(lc)] = entry
 return (CODE2LANG_MAP.get(lcode_to_ietf(lang_code)) if lang_code else CODE2LANG_MAP)

def get_code2lang_map ( lang_code = None , force = False ) : global CODE2LANG_MAP if ( force or ( not CODE2LANG_MAP ) ) : lmap = softload_json ( settings . LANG_LOOKUP_FILEPATH , logger = logging . debug ) CODE2LANG_MAP = { } for ( lc , entry ) in lmap . iteritems ( ) : CODE2LANG_MAP [ lcode_to_ietf ( lc ) ] = entry return ( CODE2LANG_MAP . get ( lcode_to_ietf ( lang_code ) ) if lang_code else CODE2LANG_MAP )
given a language code .