code: def _wrap_socket(self, sock):
      if self._has_ssl_context:
          if not self._custom_context:
              self.ssl_context.verify_mode = self.cert_reqs
              if self.certfile:
                  self.ssl_context.load_cert_chain(
                      self.certfile, self.keyfile
                  )
              if self.ciphers:
                  self.ssl_context.set_ciphers(self.ciphers)
              if self.ca_certs:
                  self.ssl_context.load_verify_locations(self.ca_certs)
          return self.ssl_context.wrap_socket(
              sock,
              server_side=self._server_side,
              server_hostname=self._server_hostname,
          )
      else:
          ssl_opts = {
              "ssl_version": self._ssl_version,
              "server_side": self._server_side,
              "ca_certs": self.ca_certs,
              "keyfile": self.keyfile,
              "certfile": self.certfile,
              "cert_reqs": self.cert_reqs,
          }
          if self.ciphers:
              if self._has_ciphers:
                  ssl_opts["ciphers"] = self.ciphers
              else:
                  logger.warning(
                      "ciphers is specified but ignored due to old Python version"
                  )
          return ssl.wrap_socket(sock, **ssl_opts)
  
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 11 for calling the TSSLBase obj's underlying member method code with example usage: obj._wrap_socket(sock) and returns: self, ssl