parameters: (mtd)
docstring: Creates a named variable in the globals dictionary
          of the current frame (inspect.currentframe).
  
          For example, if the ADS contains a workspace with the name "deltax" then
  
              mtd.importAll()
  
          will create a python variable for that workspace as if the user had typed
          mtd['deltax'].
  
          @param mtd The Analysis Data Service Object
docstring_summary: Creates a named variable in the globals dictionary
          of the current frame (inspect.currentframe).
docstring_tokens: Creates a named variable in the globals dictionary of the current frame ( inspect . currentframe ) .
function: def _importAll(mtd):
      """
          Creates a named variable in the globals dictionary
          of the current frame (inspect.currentframe).
  
          For example, if the ADS contains a workspace with the name "deltax" then
  
              mtd.importAll()
  
          will create a python variable for that workspace as if the user had typed
          mtd['deltax'].
  
          @param mtd The Analysis Data Service Object
      """
      def clean(name):
          """
              Returns a name cleaned up so that it is a valid
              identifier
          """
          # If it is exactly a keyword just prefix with an underscore
          if _keyword.iskeyword(name):
              varname = "_" + name
          else:
              # Replace invalid characters with underscore
              varname = INVALID_CHARS_REGEX.sub('_', name)
              # If it starts with a number prefix with underscore
              if LEADING_NUMS_REGEX.match(varname) is not None:
                  varname = "_" + varname
          return varname
  
      stack = _inspect.stack()
      try:
          # stack[1][0] is the frame object of the caller to this function
          locals_ = stack[1][0].f_locals
      finally:
          del stack
      ads_names = mtd.getObjectNames()
      vars = {}
      # The name may not be a valid variable name, i.e keyword or operator separated
      for name in ads_names:
          varname = name
          if not is_valid_identifier(varname):
              varname = clean(name)
              print ('Warning: "%s" is an invalid identifier, "%s" has been imported instead.' % (name, varname))
          vars[varname] = mtd[name]
      # Update the caller's dictionary
      locals_.update(vars)
function_tokens: def _importAll ( mtd ) : def clean ( name ) : """
              Returns a name cleaned up so that it is a valid
              identifier
          """ # If it is exactly a keyword just prefix with an underscore if _keyword . iskeyword ( name ) : varname = "_" + name else : # Replace invalid characters with underscore varname = INVALID_CHARS_REGEX . sub ( '_' , name ) # If it starts with a number prefix with underscore if LEADING_NUMS_REGEX . match ( varname ) is not None : varname = "_" + varname return varname stack = _inspect . stack ( ) try : # stack[1][0] is the frame object of the caller to this function locals_ = stack [ 1 ] [ 0 ] . f_locals finally : del stack ads_names = mtd . getObjectNames ( ) vars = { } # The name may not be a valid variable name, i.e keyword or operator separated for name in ads_names : varname = name if not is_valid_identifier ( varname ) : varname = clean ( name ) print ( 'Warning: "%s" is an invalid identifier, "%s" has been imported instead.' % ( name , varname ) ) vars [ varname ] = mtd [ name ] # Update the caller's dictionary locals_ . update ( vars )