<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def finalize_env(env):
 """ Produce a platform specific env for passing into subprocess.Popen family of external process calling methods, and the supplied env will be updated on top of it. Returns a new env. """


    keys = _PLATFORM_ENV_KEYS.get(sys.platform, [])
    if 'PATH' not in keys:
        # this MUST be available due to Node.js (and others really)
        # needing something to look for binary locations when it shells
        # out to other binaries.
        keys.append('PATH')
    results = {
        key: os.environ.get(key, '') for key in keys
    }
    results.update(env)
    return results