code: def ssl_wrap_socket(
      socket: socket.socket,
      ssl_options: Union[Dict[str, Any], ssl.SSLContext],
      server_hostname: Optional[str] = None,
      server_side: Optional[bool] = None,
      **kwargs: Any,
  ) -> ssl.SSLSocket:
      """Returns an ``ssl.SSLSocket`` wrapping the given socket.
  
      ``ssl_options`` may be either an `ssl.SSLContext` object or a
      dictionary (as accepted by `ssl_options_to_context`).  Additional
      keyword arguments are passed to `ssl.SSLContext.wrap_socket`.
  
      .. versionchanged:: 6.2
  
         Added server_side argument. Omitting this argument will
         result in a DeprecationWarning on Python 3.10.
      """
      context = ssl_options_to_context(
          ssl_options, server_side=server_side
      )
      if server_side is None:
          server_side = False
      assert ssl.HAS_SNI
      # TODO: add a unittest for hostname validation (python added server-side SNI support in 3.4)
      # In the meantime it can be manually tested with
      # python3 -m tornado.httpclient https://sni.velox.ch
      return context.wrap_socket(
          socket,
          server_hostname=server_hostname,
          server_side=server_side,
          **kwargs,
      )
  
imports: import asyncio
  import concurrent.futures
  import errno
  import os
  import sys
  import socket
  import ssl
  import stat
  from tornado.concurrent import dummy_executor, run_on_executor
  from tornado.ioloop import IOLoop
  from tornado.util import Configurable, errno_from_exception
  from typing import List, Callable, Any, Type, Dict, Union, Tuple, Awaitable, Optional
label_desc: Use image node_id 6 for calling a global function with example usage: ssl_wrap_socket(socket, ssl_options, server_hostname, server_side) and returns: context