def fill_in_arguments(config, modules, args):
def work_in(config, module, name):<EOL><INDENT>rkeys = getattr(module, '<STR_LIT>', {})<EOL>for (attr, cname) in iteritems(rkeys):<EOL><INDENT>v = args.get(attr, None)<EOL>if v is not None:<EOL><INDENT>config[cname] = v<EOL><DEDENT><DEDENT><DEDENT>if not isinstance(args, collections.Mapping):<EOL><INDENT>args = vars(args)<EOL><DEDENT>return _walk_config(config, modules, work_in)<EOL>
Fill in configuration fields from command-line arguments.

    `config` is a dictionary holding the initial configuration,
    probably the result of :func:`assemble_default_config`.  It reads
    through `modules`, and for each, fills in any configuration values
    that are provided in `args`.

    `config` is modified in place.  `args` may be either a dictionary
    or an object (as the result of :mod:`argparse`).

    :param dict config: configuration tree to update
    :param modules: modules or Configurable instances to use
    :type modules: iterable of :class:`~yakonfig.configurable.Configurable`
    :param args: command-line objects
    :paramtype args: dict or object
    :return: config