def mixes_in(cls, target):
        """Class decorator to add the __mixins__ of cls into target.
        
        If any mixin attribute's name is already bound on the target,
        raise a MixinError.

        The target is returned, modified.

        """

        # check for all mixin attrs before adding
        for attr in cls.__mixins__:
            if hasattr(target, attr):
                raise MixinError("Attribute already exists: %s" % attr)
        for attr in cls.__mixins__:
            setattr(target, attr, getattr(cls, attr))
        return cls.register(target)
Class decorator to add the __mixins__ of cls into target.
        
        If any mixin attribute's name is already bound on the target,
        raise a MixinError.

        The target is returned, modified.

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