parameters: (self, parent, child_name, new_child)
docstring: Replace child_name's old definition with new_child.
  
          Replace definiion in the context of the given parent. The parent could
          be a module when the child is a function at module scope. Or the parent
          could be a class when a class' method is being replaced. The named
          child is set to new_child, while the prior definition is saved away
          for later, when UnsetAll() is called.
  
          This method supports the case where child_name is a staticmethod or a
          classmethod of parent.
docstring_summary: Replace child_name's old definition with new_child.
docstring_tokens: Replace child_name s old definition with new_child .
function: def Set(self, parent, child_name, new_child):
          """Replace child_name's old definition with new_child.
  
          Replace definiion in the context of the given parent. The parent could
          be a module when the child is a function at module scope. Or the parent
          could be a class when a class' method is being replaced. The named
          child is set to new_child, while the prior definition is saved away
          for later, when UnsetAll() is called.
  
          This method supports the case where child_name is a staticmethod or a
          classmethod of parent.
          """
          old_child = getattr(parent, child_name)
  
          old_attribute = parent.__dict__.get(child_name)
          if old_attribute is not None:
              if isinstance(old_attribute, staticmethod):
                  old_child = staticmethod(old_child)
              elif isinstance(old_attribute, classmethod):
                  old_child = classmethod(old_child.__func__)
  
          self.cache.append((parent, old_child, child_name))
          setattr(parent, child_name, new_child)
function_tokens: def Set ( self , parent , child_name , new_child ) : old_child = getattr ( parent , child_name ) old_attribute = parent . __dict__ . get ( child_name ) if old_attribute is not None : if isinstance ( old_attribute , staticmethod ) : old_child = staticmethod ( old_child ) elif isinstance ( old_attribute , classmethod ) : old_child = classmethod ( old_child . __func__ ) self . cache . append ( ( parent , old_child , child_name ) ) setattr ( parent , child_name , new_child )