Copies and extends the current environment with the values present in
    `extra_env`.

def extend_env(extra_env):
    """
    Copies and extends the current environment with the values present in
    `extra_env`.
    """
    env = os.environ.copy()
    env.update(extra_env)
    return env