code: def mixin(target, *mixins):
      """
      Function adding one or more mixin class to the list of parent classes of the current object.
      It's the safest and recommended way to apply mixins as it just adds base classes to the class hierarchy of the object.
  
      :param target: the object on which to apply the mixins.
      :param mixins: the list of mixin classes to add to the object.
      :return: the extended object.
      """
      mro = target.__class__.mro()
      mixins = filter(lambda m: m and m not in mro, mixins)
      if not mixins:
          return target
      bases = (target.__class__,) + tuple(mixins)
      cls = __mixin_classes_cache__.get(bases, None)
      if cls is None:
          cls = type(target.__class__.__name__, bases, dict())
          cls.__module__ = target.__class__.__module__
          __mixin_classes_cache__[bases] = cls
      target.__class__ = cls
      return target
  
file_path: h2o-3/h2o-py/h2o/utils/mixin.py
imports: import copy
  from importlib import import_module
  import sys
  import types
label_desc: Use image node_id 1 for calling a global function with example usage: mixin(target) and returns: target, target