code: def convert_http_request(request, referrer_host=None):
      '''Convert a HTTP request.
  
      Args:
          request: An instance of :class:`.http.request.Request`.
          referrer_host (str): The referrering hostname or IP address.
  
      Returns:
          Request: An instance of :class:`urllib.request.Request`
      '''
      new_request = urllib.request.Request(
          request.url_info.url,
          origin_req_host=referrer_host,
      )
  
      for name, value in request.fields.get_all():
          new_request.add_header(name, value)
  
      return new_requesf convert_http_request(request, referrer_host=None):
      '''Convert a HTTP request.
  
      Args:
          request: An instance of :class:`.http.request.Request`.
          referrer_host (str): The referrering hostname or IP address.
  
      Returns:
          Request: An instance of :class:`urllib.request.Request`
      '''
      new_request = urllib.request.Request(
          request.url_info.url,
          origin_req_host=referrer_host,
      )
  
      for name, value in request.fields.get_all():
          new_request.add_header(name, value)
  
      return new_request
docs: Convert a HTTP request.
  
      Args:
          request: An instance of :class:`.http.request.Request`.
          referrer_host (str): The referrering hostname or IP address.
  
      Returns:
          Request: An instance of :class:`urllib.request.Request`