code: def test_asyncio_run_cancels_hanging_tasks(self):
      lo_task = None
  
      async def leftover():
          await asyncio.sleep(0.1)
  
      async def main():
          nonlocal lo_task
          lo_task = asyncio.create_task(leftover())
          return 123
  
      self.assertEqual(asyncio.run(main()), 123)
      self.assertTrue(lo_task.done())
  
imports: import _thread
  import asyncio
  import contextvars
  import re
  import signal
  import sys
  import threading
  import unittest
  from test.test_asyncio import utils
  from unittest import mock
  from unittest.mock import patch
label_desc: Use image node_id 6 for calling the RunTests obj's underlying member method code with example usage: obj.test_asyncio_run_cancels_hanging_tasks() and returns: int