code: def get_asyncio_loop():
      """asyncio has deprecated get_event_loop
  
      Replicate it here, with our desired semantics:
  
      - always returns a valid, not-closed loop
      - not thread-local like asyncio's,
        because we only want one loop for IPython
      - if called from inside a coroutine (e.g. in ipykernel),
        return the running loop
  
      .. versionadded:: 8.0
      """
      try:
          return asyncio.get_running_loop()
      except RuntimeError:
          # not inside a coroutine,
          # track our own global
          pass
  
      # not thread-local like asyncio's,
      # because we only track one event loop to run for IPython itself,
      # always in the main thread.
      global _asyncio_event_loop
      if _asyncio_event_loop is None or _asyncio_event_loop.is_closed():
          _asyncio_event_loop = asyncio.new_event_loop()
      return _asyncio_event_loop
  
file_path: catboost/contrib/python/ipython/py3/IPython/core/async_helpers.py
imports: import ast
  import asyncio
  import inspect
  from functools import wraps
label_desc: Use image node_id 1 for calling a global function with example usage: get_asyncio_loop() and returns: _asyncio_event_loop, asyncio