def create_model(schema, collection, class_name=None):
if not class_name:<EOL><INDENT>class_name = camelize(str(collection.name))<EOL><DEDENT>model_class = type(class_name,<EOL>(Model,),<EOL>dict(schema=schema, _collection_factory=staticmethod(lambda: collection)))<EOL>model_class.__module__ = _module_name_from_previous_frame(<NUM_LIT:1>)<EOL>return model_class<EOL>
Main entry point to creating a new mongothon model. Both
schema and Pymongo collection objects must be provided.

Returns a new class which can be used as a model class.

The class name of the model class by default is inferred
from the provided collection (converted to camel case).
Optionally, a class_name argument can be provided to
override this.