def load_service(config):
if isinstance(config, collections.abc.Mapping):<EOL><INDENT>service_config = config<EOL><DEDENT>elif isinstance(config, str):<EOL><INDENT>service_config = load_config(pathlib.Path(config))<EOL><DEDENT>elif isinstance(config, pathlib.Path):<EOL><INDENT>service_config = load_config(config)<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>'.format(type(config)))<EOL><DEDENT>apis = []<EOL>for api, defn in service_config['<STR_LIT>'].items():<EOL><INDENT>api_def= create_api_definition(api, defn, service_config['<STR_LIT>'])<EOL>apis.append(api_def)<EOL><DEDENT>service_module = create_service_module(service_config['<STR_LIT:name>'], apis)<EOL>return service_module<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.