<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove_mixins(target):
 """Tries to get back target in a no mixin consistent state. """


        mixedins_by_name = Mixin.get_mixedins_by_name(target).copy()

        for _name in mixedins_by_name:  # for all named mixins
            while True:  # remove all mixins named _name
                try:
                    Mixin.remove_mixin(target, _name)
                except Mixin.MixInError:
                    break