code: def _calculate_meta(meta, bases):
      """Calculate the most derived metaclass."""
      winner = meta
      for base in bases:
          base_meta = type(base)
          if issubclass(winner, base_meta):
              continue
          if issubclass(base_meta, winner):
              winner = base_meta
              continue
          # else:
          raise TypeError(
              "metaclass conflict: "
              "the metaclass of a derived class "
              "must be a (non-strict) subclass "
              "of the metaclasses of all its bases"
          )
      return winner
  
imports: import sys
label_desc: Use image node_id 7 for calling a global function with example usage: _calculate_meta(meta, bases) and returns: winner