code: def set_proxy(proxy, user=None, password=""):
      """
      Set the HTTP proxy for Python to download through.
  
      If ``proxy`` is None then tries to set proxy from environment or system
      settings.
  
      :param proxy: The HTTP proxy server to use. For example:
          'http://proxy.example.com:3128/'
      :param user: The username to authenticate with. Use None to disable
          authentication.
      :param password: The password to authenticate with.
      """
      if proxy is None:
          # Try and find the system proxy settings
          try:
              proxy = getproxies()["http"]
          except KeyError as e:
              raise ValueError(
                  "Could not detect default proxy settings"
              ) from e
  
      # Set up the proxy handler
      proxy_handler = ProxyHandler({"https": proxy, "http": proxy})
      opener = build_opener(proxy_handler)
  
      if user is not None:
          # Set up basic proxy authentication if provided
          password_manager = HTTPPasswordMgrWithDefaultRealm()
          password_manager.add_password(
              realm=None, uri=proxy, user=user, passwd=password
          )
          opener.add_handler(ProxyBasicAuthHandler(password_manager))
          opener.add_handler(ProxyDigestAuthHandler(password_manager))
  
      # Override the existing url opener
      install_opener(opener)
  
imports: import inspect
  import locale
  import os
  import pydoc
  import re
  import textwrap
  import unicodedata
  import warnings
  from collections import defaultdict, deque
  from itertools import chain, combinations, islice, tee
  from pprint import pprint
  from urllib.request import HTTPPasswordMgrWithDefaultRealm, ProxyBasicAuthHandler, ProxyDigestAuthHandler, ProxyHandler, build_opener, getproxies, install_opener
  from nltk.collections import *
  from nltk.internals import deprecated, raise_unorderable_types, slice_bounds
label_desc: Use image node_id 34 for calling a global function with example usage: set_proxy(proxy, user, password) without return types