parameters: (self, val)
return_statement: return result
docstring: Add `val` to the current context and its outer context recursively.
docstring_summary: Add `val` to the current context and its outer context recursively.
docstring_tokens: Add val to the current context and its outer context recursively .
function: def AddValue(self, val):
      """Add `val` to the current context and its outer context recursively."""
      if val.name in self._values:
        # Use the real value if it comes from outer context.
        result = self._external_values.get(val.name)
        return val if result is None else result
  
      result = val
      self._values.add(val.name)
      if self._outer_context:
        result = self._outer_context.AddValue(val)
        self._values.add(result.name)
  
      self._external_values[val.name] = result
  
      return result
function_tokens: def AddValue ( self , val ) : if val . name in self . _values : # Use the real value if it comes from outer context. result = self . _external_values . get ( val . name ) return val if result is None else result result = val self . _values . add ( val . name ) if self . _outer_context : result = self . _outer_context . AddValue ( val ) self . _values . add ( result . name ) self . _external_values [ val . name ] = result return result