def create_service_module(service_name, apis):
service_module = imp.new_module(service_name.lower())<EOL>for api in apis:<EOL><INDENT>setattr(service_module, api.__class__.__name__, api)<EOL><DEDENT>ClientClass = create_rest_client_class(service_name, apis)<EOL>setattr(service_module, '<STR_LIT>', tuple(apis))<EOL>setattr(service_module, '<STR_LIT>', ClientClass)<EOL>sys.modules[service_name.lower()] = service_module<EOL>return service_module<EOL>
Dynamically creates a module named defined by the PEP-8 version of
the string contained in service_name (from the YAML config). This
module will contain a Client class, a Call Factory, and list of API
definition objects.