def __new__(mcs, name, parents, attributes):
    """Args:
       mcs(metaclass): the class object to create an instance of. Since this is actually
           creating an instance of a type factory class, it's really a metaclass.
       name (str): the name of the type to create.
       parents (list(class)): the superclasses.
       attributes (map(string, value)):
    """
    if 'PROVIDES' not in attributes:
      return type.__new__(mcs, name, parents, attributes)
    else:
      provides = attributes['PROVIDES']
      new_type = type.__new__(mcs, name, parents, attributes)
      TypeFactoryType._TYPE_FACTORIES[provides] = new_type
      return new_type
def __new__ ( mcs , name , parents , attributes ) : if 'PROVIDES' not in attributes : return type . __new__ ( mcs , name , parents , attributes ) else : provides = attributes [ 'PROVIDES' ] new_type = type . __new__ ( mcs , name , parents , attributes ) TypeFactoryType . _TYPE_FACTORIES [ provides ] = new_type return new_type
Args:
       mcs(metaclass): the class object to create an instance of. Since this is actually
           creating an instance of a type factory class, it's really a metaclass.
       name (str): the name of the type to create.
       parents (list(class)): the superclasses.
       attributes (map(string, value)):