<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_virtual_module(module_name, schema_name, create_schema=False, create_tables=False, connection=None):
 """ Creates a python module with the given name from the name of a schema on the server and automatically adds classes to it corresponding to the tables in the schema. :param module_name: displayed module name :param schema_name: name of the database in mysql :param create_schema: if True, create the schema on the database server :param create_tables: if True, module.schema can be used as the decorator for declaring new :return: the python module containing classes from the schema object and the table classes """

    module = types.ModuleType(module_name)
    _schema = Schema(schema_name, create_schema=create_schema, create_tables=create_tables, connection=connection)
    _schema.spawn_missing_classes(context=module.__dict__)
    module.__dict__['schema'] = _schema
    return module