class_docstr: Object to hold scope, with a few bells to deal with some custom syntax
  and contexts added by pandas.
  
  Parameters
  ----------
  level : int
  global_dict : dict or None, optional, default None
  local_dict : dict or Scope or None, optional, default None
  resolvers : list-like or None, optional, default None
  target : object
  
  Attributes
  ----------
  level : int
  scope : DeepChainMap
  target : object
  temps : dict
class_docstr_tok: ["Object","to","hold","scope",",","with","a","few","bells","to","deal","with","some","custom","syntax","and","contexts","added","by","pandas",".","Parameters","--","--","--","--","--","level",":","int","global_dict",":","dict","or","None",",","optional",",","default","None","local_dict",":","dict","or","Scope","or","None",",","optional",",","default","None","resolvers",":","list-like","or","None",",","optional",",","default","None","target",":","object","Attributes","--","--","--","--","--","level",":","int","scope",":","DeepChainMap","target",":","object","temps",":","dict"]
docstr: Replace a variable name, with a potentially new value.
  
  Parameters
  ----------
  old_key : str
      Current variable name to replace
  new_key : str
      New variable name to replace `old_key` with
  new_value : object
      Value to be replaced along with the possible renaming
docstr_tok: ["Replace","a","variable","name",",","with","a","potentially","new","value",".","Parameters","--","--","--","--","--","old_key",":","str","Current","variable","name","to","replace","new_key",":","str","New","variable","name","to","replace","`","old_key","`","with","new_value",":","object","Value","to","be","replaced","along","with","the","possible","renaming"]
code: def swapkey(self, old_key: str, new_key: str, new_value=None) -> None:
      """
      Replace a variable name, with a potentially new value.
  
      Parameters
      ----------
      old_key : str
          Current variable name to replace
      new_key : str
          New variable name to replace `old_key` with
      new_value : object
          Value to be replaced along with the possible renaming
      """
      if self.has_resolvers:
          maps = self.resolvers.maps + self.scope.maps
      else:
          maps = self.scope.maps
  
      maps.append(self.temps)
  
      for mapping in maps:
          if old_key in mapping:
              mapping[new_key] = new_value
              return
  
imports: from __future__ import annotations
  import datetime
  import inspect
  from io import StringIO
  import itertools
  import pprint
  import struct
  import sys
  from typing import ChainMap, TypeVar
  import numpy
  from pandas._libs.tslibs import Timestamp
  from pandas.errors import UndefinedVariableError
label_desc: Use image node_id 5 for calling the Scope obj's underlying member method code with example usage: obj.swapkey(old_key, new_key, new_value) without return types