code: def clone(instance, substitutions, ignore=()):
      
      substitutions[instance.id] = new_object_id()
  
      def substitute(value):
          try:
              hash(value)
          except Exception:
              return value
          else:
              return substitutions.get(value, value)
  
      return instance.__class__(**{
          key:  substitute(value)
          for key, value in iter_items(instance, ignore)
      }).create()
docs: Clone an instance of `Model` that uses `IdentityMixin`.
  
      :param instance: the instance to clonse
      :param substitutions: a dictionary of substitutions
      :param ignore: a tuple of column names to ignore