code: def test_migrate_dir(td):
      src = pjoin(td, "src")
      dst = pjoin(td, "dst")
      os.mkdir(src)
      assert not migrate_dir(src, dst)
      assert not os.path.exists(dst)
  
      touch(pjoin(src, "f"), "test file")
      assert migrate_dir(src, dst)
      assert_files_equal(pjoin(src, "f"), pjoin(dst, "f"))
  
      touch(pjoin(src, "g"), "other test file")
      assert not migrate_dir(src, dst)
      assert not os.path.exists(pjoin(dst, "g"))
  
      shutil.rmtree(dst)
      os.mkdir(dst)
      assert migrate_dir(src, dst)
      assert_files_equal(pjoin(src, "f"), pjoin(dst, "f"))
      assert_files_equal(pjoin(src, "g"), pjoin(dst, "g"))
  
imports: from __future__ import annotations
  import os
  import re
  import shutil
  from tempfile import mkdtemp
  from unittest.mock import patch
  import pytest
  from jupyter_core import migrate
  from jupyter_core.application import JupyterApp
  from jupyter_core.migrate import migrate, migrate_config, migrate_dir, migrate_file, migrate_one, migrate_static_custom
  from jupyter_core.utils import ensure_dir_exists
label_desc: Use image node_id 6 for calling a global function with example usage: test_migrate_dir(td) without return types