parameters: (names, typemap)
return_statement: return outdict
docstring: We use ir_utils.legalize_names to replace internal IR variable names
          containing illegal characters (e.g. period) with a legal character
          (underscore) so as to create legal variable names.
          The original variable names are in the typemap so we also
          need to add the legalized name to the typemap as well.
docstring_summary: We use ir_utils.legalize_names to replace internal IR variable names
          containing illegal characters (e.g. period) with a legal character
          (underscore) so as to create legal variable names.
          The original variable names are in the typemap so we also
          need to add the legalized name to the typemap as well.
docstring_tokens: We use ir_utils . legalize_names to replace internal IR variable names containing illegal characters ( e . g . period ) with a legal character ( underscore ) so as to create legal variable names . The original variable names are in the typemap so we also need to add the legalized name to the typemap as well .
function: def legalize_names_with_typemap(names, typemap):
      """ We use ir_utils.legalize_names to replace internal IR variable names
          containing illegal characters (e.g. period) with a legal character
          (underscore) so as to create legal variable names.
          The original variable names are in the typemap so we also
          need to add the legalized name to the typemap as well.
      """
      outdict = legalize_names(names)
      # For each pair in the dict of legalized names...
      for x, y in outdict.items():
          # If the name had some legalization change to it...
          if x != y:
              # Set the type of the new name the same as the type of the old name.
              typemap[y] = typemap[x]
      return outdict
function_tokens: def legalize_names_with_typemap ( names , typemap ) : outdict = legalize_names ( names ) # For each pair in the dict of legalized names... for x , y in outdict . items ( ) : # If the name had some legalization change to it... if x != y : # Set the type of the new name the same as the type of the old name. typemap [ y ] = typemap [ x ] return outdict