code: def get_event_logger_from_cfg_value(
      cfg_value: Any,
  ) -> AbstractEventLogger:
      """
      This function implements the deprecation of assignment
      of class objects to EVENT_LOGGER configuration, and validates
      type of configured loggers.
  
      The motivation for this method is to gracefully deprecate the ability to configure
      EVENT_LOGGER with a class type, in favor of preconfigured instances which may have
      required construction-time injection of proprietary or locally-defined dependencies.
  
      :param cfg_value: The configured EVENT_LOGGER value to be validated
      :return: if cfg_value is a class type, will return a new instance created using a
      default con
      """
      result: Any = cfg_value
      if inspect.isclass(cfg_value):
          logging.warning(
              textwrap.dedent(
                  """
                  In superset private config, EVENT_LOGGER has been assigned a class
                  object. In order to accomodate pre-configured instances without a
                  default constructor, assignment of a class is deprecated and may no
                  longer work at some point in the future. Please assign an object
                  instance of a type that implements
                  superset.utils.log.AbstractEventLogger.
                  """
              )
          )
  
          event_logger_type = cast(type[Any], cfg_value)
          result = event_logger_type()
  
      # Verify that we have a valid logger impl
      if not isinstance(result, AbstractEventLogger):
          raise TypeError(
              "EVENT_LOGGER must be configured with a concrete instance"
              "of superset.utils.log.AbstractEventLogger."
          )
  
      logging.info("Configured event logger of type %s", type(result))
      return cast(AbstractEventLogger, result)
  
imports: from __future__ import annotations
  import functools
  import inspect
  import json
  import logging
  import textwrap
  from abc import ABC, abstractmethod
  from collections.abc import Iterator
  from contextlib import contextmanager
  from datetime import datetime, timedelta
  from typing import Any, Callable, cast, Literal, TYPE_CHECKING
  from flask import current_app, g, request
  from flask_appbuilder.const import API_URI_RIS_KEY
  from sqlalchemy.exc import SQLAlchemyError
  from superset.extensions import stats_logger_manager
  from superset.utils.core import get_user_id, LoggerLevel
label_desc: Use image node_id 3 for calling a global function with example usage: get_event_logger_from_cfg_value(cfg_value) and returns: cast