def __new__(mcs, name, bases, attrs):
<EOL>is_model = attrs.pop('<STR_LIT>', True)<EOL>if not is_model:<EOL><INDENT>return super(MetaModel, mcs).__new__(mcs, name, bases, attrs)<EOL><DEDENT>else:<EOL><INDENT>mixins = [base for base in bases if issubclass(base, orb.ModelMixin)]<EOL>inherits = [base for base in bases if issubclass(base, orb.Model)]<EOL>if not inherits:<EOL><INDENT>return super(MetaModel, mcs).__new__(mcs, name, bases, attrs)<EOL><DEDENT>columns = {}<EOL>indexes = {}<EOL>collectors = {}<EOL>def store_property(key, value):<EOL><INDENT>if isinstance(value, orb.Column):<EOL><INDENT>col = value<EOL>col.setName(key)<EOL>columns[key] = col<EOL>return True<EOL><DEDENT>elif isinstance(value, orb.Index):<EOL><INDENT>index = value<EOL>index.setName(key)<EOL>indexes[key] = index<EOL>return True<EOL><DEDENT>elif isinstance(value, orb.Collector):<EOL><INDENT>collector = value<EOL>collector.setName(key)<EOL>collectors[key] = collector<EOL>return True<EOL><DEDENT>return False<EOL><DEDENT>def store_virtual_property(key, value):<EOL><INDENT>if isinstance(value, classmethod):<EOL><INDENT>value = value.__func__<EOL>is_static = True<EOL><DEDENT>else:<EOL><INDENT>is_static = False<EOL><DEDENT>if hasattr(value, '<STR_LIT>'):<EOL><INDENT>if is_static:<EOL><INDENT>value.__orb__.setFlags(value.__orb__.flags() | value.__orb__.Flags.Static)<EOL><DEDENT>if isinstance(value.__orb__, orb.Column):<EOL><INDENT>columns[value.__orb__.name()] = value.__orb__<EOL><DEDENT>elif isinstance(value.__orb__, orb.Collector):<EOL><INDENT>collectors[value.__orb__.name()] = value.__orb__<EOL><DEDENT><DEDENT><DEDENT>for mixin in mixins:<EOL><INDENT>try:<EOL><INDENT>orb_props = mixin.__orb_properties__<EOL><DEDENT>except AttributeError:<EOL><INDENT>orb_props = {}<EOL>for key, value in vars(mixin).items():<EOL><INDENT>if store_property(key, value):<EOL><INDENT>orb_props[key] = value.copy()<EOL>delattr(mixin, key)<EOL><DEDENT>else:<EOL><INDENT>store_virtual_property(key, value)<EOL><DEDENT><DEDENT>mixin.__orb_properties__ = orb_props<EOL><DEDENT>else:<EOL><INDENT>for key, value in orb_props.items():<EOL><INDENT>store_property(key, value.copy())<EOL><DEDENT><DEDENT><DEDENT>for key, value in attrs.items():<EOL><INDENT>if store_property(key, value):<EOL><INDENT>attrs.pop(key)<EOL><DEDENT>else:<EOL><INDENT>store_virtual_property(key, value)<EOL><DEDENT><DEDENT>schema = attrs.pop('<STR_LIT>', None)<EOL>if schema is None:<EOL><INDENT>schema = orb.Schema(<EOL>name,<EOL>dbname=attrs.pop('<STR_LIT>', '<STR_LIT>'),<EOL>display=attrs.pop('<STR_LIT>', '<STR_LIT>'),<EOL>database=attrs.pop('<STR_LIT>', '<STR_LIT>'),<EOL>namespace=attrs.pop('<STR_LIT>', '<STR_LIT>'),<EOL>flags=attrs.pop('<STR_LIT>', <NUM_LIT:0>),<EOL>idColumn = attrs.pop('<STR_LIT>', '<STR_LIT:id>')<EOL>)<EOL>if inherits:<EOL><INDENT>inherited_schema = inherits[<NUM_LIT:0>].schema()<EOL>if inherited_schema:<EOL><INDENT>schema.setInherits(inherited_schema.name())<EOL><DEDENT><DEDENT><DEDENT>new_model = super(MetaModel, mcs).__new__(mcs, name, bases, attrs)<EOL>setattr(new_model, '<STR_LIT>'.format(schema.name()), schema)<EOL>schema.setModel(new_model)<EOL>orb.system.register(schema)<EOL>for index in indexes.values():<EOL><INDENT>schema.register(index)<EOL><DEDENT>for collector in collectors.values():<EOL><INDENT>schema.register(collector)<EOL><DEDENT>for column in columns.values():<EOL><INDENT>schema.register(column)<EOL><DEDENT>return new_model<EOL><DEDENT>
Manages the creation of database model classes, reading
through the creation attributes and generating table
schemas based on the inputted information.  This class
never needs to be expressly defined, as any class that
inherits from the Table class will be passed through this
as a constructor.

:param      mcs         <MetaTable>
:param      name        <str>
:param      bases       <tuple> (<object> base,)
:param      attrs       <dict> properties

:return     <type>