<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def clone(instance, substitutions, ignore=()):
 """ 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 """

    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()