def overlays(cls, target):
        """Class decorator to wrap the target's methods.

        If any overlay attribute's name is not bound on the target,
        raise an OverlayError.

        The target is used as the base class for a new class, which is
        returned.

        """

        # check for all overlay attrs before adding
        for attr in cls.__overlays__:
            if not hasattr(target, attr):
                raise OverlayError("Expected attribute: %s" % attr)
        class Temp(target):
            __doc__ = target.__doc__
            for attr in cls.__overlays__:
                locals()[attr] = getattr(cls, attr)
            del attr
        Temp.__name__ = target.__name__
        return Temp
Class decorator to wrap the target's methods.

        If any overlay attribute's name is not bound on the target,
        raise an OverlayError.

        The target is used as the base class for a new class, which is
        returned.

        
recipes/Python/577730_Mixin_and_Overlay/recipe-577730.py