code: def get_openapi_security_definitions(
      flat_dependant: Dependant,
  ) -> Tuple[Dict[str, Any], List[Dict[str, Any]]]:
      security_definitions = {}
      operation_security = []
      for security_requirement in flat_dependant.security_requirements:
          security_definition = jsonable_encoder(
              security_requirement.security_scheme.model,
              by_alias=True,
              exclude_none=True,
          )
          security_name = (
              security_requirement.security_scheme.scheme_name
          )
          security_definitions[security_name] = security_definition
          operation_security.append(
              {security_name: security_requirement.scopes}
          )
      return security_definitions, operation_security
  
imports: import http.client
  import inspect
  import warnings
  from typing import Any, Dict, List, Optional, Sequence, Set, Tuple, Type, Union, cast
  from fastapi import routing
  from fastapi._compat import GenerateJsonSchema, JsonSchemaValue, ModelField, Undefined, get_compat_model_name_map, get_definitions, get_schema_from_model_field, lenient_issubclass
  from fastapi.datastructures import DefaultPlaceholder
  from fastapi.dependencies.models import Dependant
  from fastapi.dependencies.utils import get_flat_dependant, get_flat_params
  from fastapi.encoders import jsonable_encoder
  from fastapi.openapi.constants import METHODS_WITH_BODY, REF_PREFIX, REF_TEMPLATE
  from fastapi.openapi.models import OpenAPI
  from fastapi.params import Body, Param
  from fastapi.responses import Response
  from fastapi.types import ModelNameMap
  from fastapi.utils import deep_dict_update, generate_operation_id_for_path, is_body_allowed_for_status_code
  from starlette.responses import JSONResponse
  from starlette.routing import BaseRoute
  from starlette.status import HTTP_422_UNPROCESSABLE_ENTITY
  from typing_extensions import Literal
label_desc: Use image node_id 1 for calling a global function with example usage: get_openapi_security_definitions(flat_dependant) and returns: security_definitions,  operation_security