<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_writer(writer, ppp_config_dir=None, **writer_kwargs):
 """Find and load writer `writer` in the available configuration files."""

    if ppp_config_dir is None:
        ppp_config_dir = get_environ_config_dir()

    config_fn = writer + ".yaml" if "." not in writer else writer
    config_files = config_search_paths(
        os.path.join("writers", config_fn), ppp_config_dir)
    writer_kwargs.setdefault("config_files", config_files)
    if not writer_kwargs['config_files']:
        raise ValueError("Unknown writer '{}'".format(writer))

    try:
        return load_writer_configs(writer_kwargs['config_files'],
                                   ppp_config_dir=ppp_config_dir,
                                   **writer_kwargs)
    except ValueError:
        raise ValueError("Writer '{}' does not exist or could not be "
                         "loaded".format(writer))