class_docstr: Simple verifying connection: no auth, subclasses, timeouts, etc.
class_docstr_tok: ["Simple","verifying","connection",":","no","auth",",","subclasses",",","timeouts",",","etc","."]
code: def connect(self):
      sock = socket.create_connection(
          (self.host, self.port), getattr(self, "source_address", None)
      )
  
      # Handle the socket if a (proxy) tunnel is present
      if hasattr(self, "_tunnel") and getattr(
          self, "_tunnel_host", None
      ):
          self.sock = sock
          self._tunnel()
          # http://bugs.python.org/issue7776: Python>=3.4.1 and >=2.7.7
          # change self.host to mean the proxy server host when tunneling is
          # being used. Adapt, since we are interested in the destination
          # host for the match_hostname() comparison.
          actual_host = self._tunnel_host
      else:
          actual_host = self.host
  
      if hasattr(ssl, "create_default_context"):
          ctx = ssl.create_default_context(cafile=self.ca_bundle)
          self.sock = ctx.wrap_socket(sock, server_hostname=actual_host)
      else:
          # This is for python < 2.7.9 and < 3.4?
          self.sock = ssl.wrap_socket(
              sock, cert_reqs=ssl.CERT_REQUIRED, ca_certs=self.ca_bundle
          )
      try:
          match_hostname(self.sock.getpeercert(), actual_host)
      except CertificateError:
          self.sock.shutdown(socket.SHUT_RDWR)
          self.sock.close()
          raise
  
file_path: catboost/contrib/python/setuptools/py2/setuptools/ssl_support.py
imports: import os
  import socket
  import atexit
  import re
  import functools
  from setuptools.extern.six.moves import urllib, http_client, map, filter
  from pkg_resources import ResolutionError, ExtractionError
label_desc: Use image node_id 2 for calling the VerifyingHTTPSConn obj's underlying member method code with example usage: obj.connect() without return types