human
I wrote the below code

    def _replacer(matchobj):
        name = matchobj.group(1)
        if (name in local_vars):
            return local_vars[name]
        elif (name in os.environ):
            return os.environ[name]
        return matchobj.group(0)
    return _VAR_REPL.sub(_replacer, path)

What's a good function header?
assistant
#Here's a good function header.

def _subst_vars(path, local_vars):