<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def expandConfigPaths (config, prefix=None, datetime=None, pathvars=None, parameter_key='', *keys):
 """Updates all relative configuration paths in dictionary config, which contain a key in keys, by prepending prefix. If keys is omitted, it defaults to 'directory', 'file', 'filename', 'path', 'pathname'. See util.expandPath(). """

    if len(keys) == 0:
        keys = PATH_KEYS

    for name, value in config.items():
        if name in keys and type(name) is str:
            expanded = util.expandPath(value, prefix)
            cleaned = replaceVariables(expanded, datetime=datetime, pathvars=pathvars)

            for p in cleaned:
                if not os.path.exists(p):
                    msg = "Config parameter {}.{} specifies nonexistent path {}".format(parameter_key, name, p)
                    log.warn(msg)

            config[name] = cleaned[0] if len(cleaned) == 1 else cleaned

        elif type(value) is dict:
            param_key = name if parameter_key == '' else parameter_key + '.' + name
            expandConfigPaths(value, prefix, datetime, pathvars, param_key, *keys)