parameters: (intlData, dict, name, description, fileDate, url)
docstring: Writes a variable definition with a mapping table to file intlData.
  
          Writes the contents of dictionary dict to file intlData with the given
          variable name and a comment with description, fileDate, and URL.
docstring_summary: Writes a variable definition with a mapping table to file intlData.
docstring_tokens: Writes a variable definition with a mapping table to file intlData .
function: def writeMappingsVar(intlData, dict, name, description, fileDate, url):
      """ Writes a variable definition with a mapping table to file intlData.
  
          Writes the contents of dictionary dict to file intlData with the given
          variable name and a comment with description, fileDate, and URL.
      """
      intlData.write("\n")
      if type(description) is not list:
          description = [description]
      for desc in description:
          intlData.write("// {0}\n".format(desc))
      intlData.write("// Derived from IANA Language Subtag Registry, file date {0}.\n".format(fileDate))
      intlData.write("// {0}\n".format(url))
      intlData.write("var {0} = {{\n".format(name))
      keys = sorted(dict)
      for key in keys:
          if isinstance(dict[key], basestring):
              value = '"{0}"'.format(dict[key])
          else:
              preferred = dict[key]["preferred"]
              prefix = dict[key]["prefix"]
              if key != preferred:
                  raise Exception("Expected '{0}' matches preferred locale '{1}'".format(key, preferred))
              value = '"{0}"'.format(prefix)
          intlData.write('    "{0}": {1},\n'.format(key, value))
      intlData.write("};\n")
function_tokens: def writeMappingsVar ( intlData , dict , name , description , fileDate , url ) : intlData . write ( "\n" ) if type ( description ) is not list : description = [ description ] for desc in description : intlData . write ( "// {0}\n" . format ( desc ) ) intlData . write ( "// Derived from IANA Language Subtag Registry, file date {0}.\n" . format ( fileDate ) ) intlData . write ( "// {0}\n" . format ( url ) ) intlData . write ( "var {0} = {{\n" . format ( name ) ) keys = sorted ( dict ) for key in keys : if isinstance ( dict [ key ] , basestring ) : value = '"{0}"' . format ( dict [ key ] ) else : preferred = dict [ key ] [ "preferred" ] prefix = dict [ key ] [ "prefix" ] if key != preferred : raise Exception ( "Expected '{0}' matches preferred locale '{1}'" . format ( key , preferred ) ) value = '"{0}"' . format ( prefix ) intlData . write ( '    "{0}": {1},\n' . format ( key , value ) ) intlData . write ( "};\n" )