code: def __init__(self, server_side, host, ssl_opts):
      self._server_side = server_side
      if TSSLBase.SSL_VERSION != self._default_protocol:
          warnings.warn(
              "SSL_VERSION is deprecated."
              "please use ssl_version keyword argument instead.",
              DeprecationWarning,
              stacklevel=2,
          )
      self._context = ssl_opts.pop("ssl_context", None)
      self._server_hostname = None
      if not self._server_side:
          self._server_hostname = ssl_opts.pop("server_hostname", host)
      if self._context:
          self._custom_context = True
          if ssl_opts:
              raise ValueError(
                  "Incompatible arguments: ssl_context and %s"
                  % " ".join(ssl_opts.keys())
              )
          if not self._has_ssl_context:
              raise ValueError(
                  "ssl_context is not available for this version of Python"
              )
      else:
          self._custom_context = False
          ssl_version = ssl_opts.pop(
              "ssl_version", TSSLBase.SSL_VERSION
          )
          self._init_context(ssl_version)
          self.cert_reqs = ssl_opts.pop("cert_reqs", ssl.CERT_REQUIRED)
          self.ca_certs = ssl_opts.pop("ca_certs", None)
          self.keyfile = ssl_opts.pop("keyfile", None)
          self.certfile = ssl_opts.pop("certfile", None)
          self.ciphers = ssl_opts.pop("ciphers", None)
  
          if ssl_opts:
              raise ValueError(
                  "Unknown keyword arguments: ",
                  " ".join(ssl_opts.keys()),
              )
  
          if self._should_verify:
              if not self.ca_certs:
                  raise ValueError(
                      "ca_certs is needed when cert_reqs is not ssl.CERT_NONE"
                  )
              if not os.access(self.ca_certs, os.R_OK):
                  raise IOError(
                      'Certificate Authority ca_certs file "%s" '
                      "is not readable, cannot validate SSL "
                      "certificates." % (self.ca_certs)
                  )
  
imports: import logging
  import os
  import socket
  import ssl
  import sys
  import warnings
  from .sslcompat import _match_hostname, _match_has_ipaddress
  from thrift.transport import TSocket
  from thrift.transport.TTransport import TTransportException
label_desc: Use image node_id 8 to create a new TSSLBase object from inherited base classes: object with example: obj = TSSLBase(server_side, host, ssl_opts)