You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: rest_client_extension.rb
    path of file: ./repos/foreman/lib/foreman/http_proxy
    
    the code of the file until where you have to start completion: module Foreman
  module HttpProxy
    module RestClientExtension
      def proxy_uri
        return if @args[:force_direct]
        if proxy_http_request?(@pr
    
      def net_http_object(hostname, port)
        p_uri = proxy_uri

        # no proxy set or proxy explicitly set to none
        return super unless p_uri

        proxy_pass = CGI.unescape(p_uri.password) if p_uri.password
        proxy_user = CGI.unescape(p_uri.user) if p_uri.user
        Net::HTTP.new(hostname, port,
          p_uri.hostname, p_uri.port, proxy_user, proxy_pass)
      end