code: def _validate_key(ctx, param, value):
      """The ``--key`` option must be specified when ``--cert`` is a file.
      Modifies the ``cert`` param to be a ``(cert, key)`` pair if needed.
      """
      cert = ctx.params.get("cert")
      is_adhoc = cert == "adhoc"
  
      try:
          import ssl
      except ImportError:
          is_context = False
      else:
          is_context = isinstance(cert, ssl.SSLContext)
  
      if value is not None:
          if is_adhoc:
              raise click.BadParameter(
                  'When "--cert" is "adhoc", "--key" is not used.',
                  ctx,
                  param,
              )
  
          if is_context:
              raise click.BadParameter(
                  'When "--cert" is an SSLContext object, "--key" is not used.',
                  ctx,
                  param,
              )
  
          if not cert:
              raise click.BadParameter(
                  '"--cert" must also be specified.', ctx, param
              )
  
          ctx.params["cert"] = cert, value
  
      else:
          if cert and not (is_adhoc or is_context):
              raise click.BadParameter(
                  'Required when using "--cert".', ctx, param
              )
  
      return value
  
imports: from __future__ import annotations
  import ast
  import importlib.metadata
  import inspect
  import os
  import platform
  import re
  import sys
  import traceback
  import typing
  from functools import update_wrapper
  from operator import itemgetter
  import click
  from click.core import ParameterSource
  from werkzeug import run_simple
  from werkzeug.serving import is_running_from_reloader
  from werkzeug.utils import import_string
  from .globals import current_app
  from .helpers import get_debug_flag
  from .helpers import get_load_dotenv
label_desc: Use image node_id 14 for calling a global function with example usage: _validate_key(ctx, param, value) and returns: value