code: def add_implemented_interfaces(cls, interfaces):
      
      implemented = set(
          six.moves.reduce(
              lambda x, y: x.union(y),
              map(operator.attrgetter('implied'), interfaces),
              set()
          )
      )
      implemented.update(*map(
          get_implemented_interfaces,
          inspect.getmro(cls)
      ))
      setattr(cls, '__interfaces__', frozenset(implemented))
docs: Adds :term:`interfaces <interface>` to those already declared as
      implemented by class `cls`.