code: def test_run_script_directive_async():
      """Tests :func`snakemake.common.async_run`. The test ensures the ability to
      execute Snakemake API even if an asyncio event loop is already running.
  
      """
      import tracemalloc
      from snakemake.common import async_run
  
      tracemalloc.start()
  
      async def dummy_task():
          await asyncio.sleep(0.00001)
  
      async def main():
          async_run(dummy_task())
          test_run_script_directive()
  
      asyncio.run(main())
  
file_path: snakemake/tests/testapi.py
imports: from snakemake.api import snakemake
  import asyncio
  import sys
  import tempfile
  import os.path
  from textwrap import dedent
label_desc: Use image node_id 4 for calling a global function with example usage: test_run_script_directive_async() without return types