docs: def isimplementation(obj, interfaces):
      """
      Returns `True` if `obj` is a class implementing all of `interfaces` or an
      instance of such class.
  
      `interfaces` can be a single :term:`interface` class or an iterable of
      interface classes.
      """
      if not inspect.isclass(obj):
          isimplementation(obj.__class__, interfaces)
      if not isinstance(interfaces, collections.Iterable):
          interfaces = [interfaces]
      return frozenset(interfaces).issubset(
          get_implemented_interfaces(obj)
      )