<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def isinstance(instance, ifaces):
 """Check if a given instance is an implementation of the interface."""

    ifaces = _ensure_ifaces_tuple(ifaces)
    for iface in ifaces:

        attributes = (
            attr
            for attr in iface.__abstractmethods__
            if hasattr(getattr(iface, attr), '__iattribute__')
        )
        for attribute in attributes:

            if not hasattr(instance, attribute):

                return False

        if not issubclass(type(instance), ifaces):

            return False

    return True