code: def ssl_options_to_context(ssl_options):
      """Try to convert an ``ssl_options`` dictionary to an
      `~ssl.SSLContext` object.
  
      The ``ssl_options`` dictionary contains keywords to be passed to
      `ssl.wrap_socket`.  In Python 2.7.9+, `ssl.SSLContext` objects can
      be used instead.  This function converts the dict form to its
      `~ssl.SSLContext` equivalent, and may be used when a component which
      accepts both forms needs to upgrade to the `~ssl.SSLContext` version
      to use features like SNI or NPN.
      """
      if isinstance(ssl_options, dict):
          assert all(
              k in _SSL_CONTEXT_KEYWORDS for k in ssl_options
          ), ssl_options
      if not hasattr(ssl, "SSLContext") or isinstance(
          ssl_options, ssl.SSLContext
      ):
          return ssl_options
      context = ssl.SSLContext(
          ssl_options.get("ssl_version", ssl.PROTOCOL_SSLv23)
      )
      if "certfile" in ssl_options:
          context.load_cert_chain(
              ssl_options["certfile"], ssl_options.get("keyfile", None)
          )
      if "cert_reqs" in ssl_options:
          context.verify_mode = ssl_options["cert_reqs"]
      if "ca_certs" in ssl_options:
          context.load_verify_locations(ssl_options["ca_certs"])
      if "ciphers" in ssl_options:
          context.set_ciphers(ssl_options["ciphers"])
      if hasattr(ssl, "OP_NO_COMPRESSION"):
          # Disable TLS compression to avoid CRIME and related attacks.
          # This constant wasn't added until python 3.3.
          context.options |= ssl.OP_NO_COMPRESSION
      return context
  
imports: from __future__ import absolute_import, division, print_function
  import errno
  import os
  import sys
  import socket
  import stat
  from tornado.concurrent import dummy_executor, run_on_executor
  from tornado.ioloop import IOLoop
  from tornado.platform.auto import set_close_exec
  from tornado.util import PY3, Configurable, errno_from_exception
label_desc: Use image node_id 4 for calling a global function with example usage: ssl_options_to_context(ssl_options) and returns: context, ssl_options