code: def _request_env(method, url, body=None, content_type=None):
      from urllib.parse import urlparse
  
      req = urlparse(url)
      env = {
          "wsgi.url_scheme": "http",
          "REQUEST_METHOD": method,
          "PATH_INFO": req.path,
          "QUERY_STRING": req.query,
      }
      if body is not None:
          env["wsgi.input"] = io.BytesIO(body.encode())
          env["CONTENT_LENGTH"] = str(len(body))
      if content_type:
          env["CONTENT_TYPE"] = content_type
      return env
  
imports: import io
  import json
  import logging
  import socket
  from werkzeug import routing
  from werkzeug import serving
  from werkzeug import exceptions
  from werkzeug.middleware.shared_data import SharedDataMiddleware
  from werkzeug.wrappers import Request, Response
label_desc: Use image node_id 9 for calling a global function with example usage: _request_env(method, url, body, content_type) and returns: env