code: def add_method(self, m, **kwargs):
          
          if isinstance(m, types.FunctionType):
              self['function', id(m)] = m
          else:
              f, obj = get_method_vars(m)
              wrkey = (f, id(obj))
              self[wrkey] = obj
docs: Add an instance method or function
  
          Args:
              m: The instance method or function to store