code: def cleanup_dirs():
      """Cleanup temporary spans_dir folder at beginning and end of test."""
      if os.path.exists(spans_dir):
          shutil.rmtree(spans_dir)
      os.makedirs(spans_dir)
      yield
      # Enable tracing only sets up tracing once per driver process.
      # We set ray.__traced__ to False here so that each
      # test will re-set up tracing.
      ray.__traced__ = False
      if os.path.exists(spans_dir):
          shutil.rmtree(spans_dir)
  
imports: import asyncio
  import glob
  import json
  import os
  import pytest
  import shutil
  from unittest.mock import patch
  import ray
  from ray._private.test_utils import check_call_ray
  from ray.util.tracing.setup_local_tmp_tracing import spans_dir
label_desc: Use image node_id 1 for calling a global function with example usage: cleanup_dirs() without return types