def load_swagger_config(name, base_url, config):
if isinstance(config, collections.abc.Mapping):<EOL><INDENT>pass<EOL><DEDENT>elif isinstance(config, str):<EOL><INDENT>with pathlib.Path(config).open('<STR_LIT:r>') as infile:<EOL><INDENT>config = yaml.load(infile)<EOL><DEDENT><DEDENT>elif isinstance(config, pathlib.Path):<EOL><INDENT>with config.open('<STR_LIT:r>') as infile:<EOL><INDENT>config = yaml.load(infile)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>'.format(type(config)))<EOL><DEDENT>service_config = dict([<EOL>('<STR_LIT:name>', name), ('<STR_LIT>', base_url), ('<STR_LIT>', defaultdict(dict))])<EOL>apis = config['<STR_LIT>']<EOL>for api in apis:<EOL><INDENT>resource = snake_case_to_camel_case(api['<STR_LIT:path>'].rsplit('<STR_LIT:/>', <NUM_LIT:1>)[-<NUM_LIT:1>])<EOL>for op in api['<STR_LIT>']:<EOL><INDENT>verb = op['<STR_LIT>'].upper()<EOL>args = [(param['<STR_LIT:name>'], {'<STR_LIT:default>' : None}) for param in op['<STR_LIT>']<EOL>if param['<STR_LIT>'].lower() != '<STR_LIT>']<EOL>definition = dict([<EOL>('<STR_LIT:url>',  api['<STR_LIT:path>']),<EOL>(verb, dict(args))<EOL>])<EOL>service_config['<STR_LIT>'][resource].update(definition)<EOL><DEDENT><DEDENT>return service_config<EOL>
Load a restful service specified by some YAML file at config_path.

:param config_path: A pathlib Path object that points to the yaml
    config
:returns: A python module containing a Client class, call factory,
    and the definition of each of the APIs defined by the config.