code: def test_ensure_dir_exists():
      with tempfile.TemporaryDirectory() as td:
          ensure_dir_exists(td)
          ensure_dir_exists(os.path.join(str(td), "foo"), 0o777)
  
file_path: jupyter_core/tests/test_utils.py
imports: from __future__ import annotations
  import asyncio
  import os
  import tempfile
  import pytest
  from jupyter_core.utils import deprecation, ensure_async, ensure_dir_exists, ensure_event_loop, run_sync
label_desc: Use image node_id 1 for calling a global function with example usage: test_ensure_dir_exists() without return types