code: def clone(self, **kw):
          
          newpolicy = self.__class__.__new__(self.__class__)
          for attr, value in self.__dict__.items():
              object.__setattr__(newpolicy, attr, value)
          for attr, value in kw.items():
              if not hasattr(self, attr):
                  raise TypeError(
                      "{!r} is an invalid keyword argument for {}".format(
                          attr, self.__class__.__name__))
              object.__setattr__(newpolicy, attr, value)
          return newpolicy
docs: Return a new instance with specified attributes changed.
  
          The new instance has the same attribute values as the current object,
          except for the changes passed in as keyword arguments.