def mutate_env_to_overwrite_remote_addr(wsgi_env):

    # Grab the remote user IP from the X-AppEngine header and overwrite
    # REMOTE_ADDR used by WSGI.
    user_ip = wsgi_env.get(X_APPENGINE_REMOTE_ADDR_ENV_KEY)
    if not user_ip:
        # No HTTP_X_APPENGINE_REMOTE_ADDR, so check USER_IP instead.
        user_ip = wsgi_env.get(X_APPENGINE_USER_IP_ENV_KEY)

    if user_ip:
        # Update env.
        wsgi_env[WSGI_REMOTE_ADDR_ENV_KEY] = user_ip
Append the resource info from a chunk_db
dataset/ETHPy150Open GoogleCloudPlatform/python-compat-runtime/appengine-vmruntime/vmruntime/middleware.py/mutate_env_to_overwrite_remote_addr--crossover with--dataset/ETHPy150Open arq5x/gemini/gemini/gemini_merge_chunks.py/append_resource_info