def create_transport(beaver_config, logger):
transport_str = beaver_config.get('<STR_LIT>')<EOL>if '<STR_LIT:.>' not in transport_str:<EOL><INDENT>module_path = '<STR_LIT>' % transport_str.lower()<EOL>class_name = '<STR_LIT>' % transport_str.title()<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>module_path, class_name = transport_str.rsplit('<STR_LIT:.>', <NUM_LIT:1>)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise Exception('<STR_LIT>'.format(beaver_config.get('<STR_LIT>')))<EOL><DEDENT><DEDENT>_module = __import__(module_path, globals(), locals(), class_name, -<NUM_LIT:1>)<EOL>transport_class = getattr(_module, class_name)<EOL>transport = transport_class(beaver_config=beaver_config, logger=logger)<EOL>return transport<EOL>
Creates and returns a transport object