code: def featurize(*features):
      
      from functools import cmp_to_key
  
      def compare_subclass(left, right):
          if issubclass(left, right):
              return -1
          elif issubclass(right, left):
              return 1
          return 0
  
      sorted_features = sorted(features, key=cmp_to_key(compare_subclass))
      name = 'FeaturizedClient[{features}]'.format(
          features=', '.join(feature.__name__ for feature in sorted_features))
      return type(name, tuple(sorted_features), {})
docs: Put features into proper MRO order.