code: def test_local_trial_user_code_detignore(
      tmp_path: pathlib.Path,
  ) -> None:
      src_path = tmp_path / "src"
      dst_path = tmp_path / "dst"
      src_path.mkdir()
      dst_path.mkdir()
  
      with filetree.FileTree(
          src_path,
          {
              "dir/file.py": "",
              "dir/subdir/A.py": "",
              "dir/subdir/B.py": "",
              "dir/subdir/subdir/subdir/C.py": "",
              "dir/anotherdir/D.py": "",
              ".detignore": "\ndir/sub*/\n",
          },
      ) as tree:
          with filetree.chdir(tree):
              det.util.write_user_code(dst_path, on_cluster=False)
              code_path = dst_path / "code"
              glob = [
                  str(p.relative_to(code_path))
                  for p in dst_path.glob("**/*.py")
              ]
              assert "dir/file.py" in glob
              assert "dir/anotherdir/D.py" in glob
              assert "dir/subdir/A.py" not in glob
              print(list((code_path / "dir").iterdir()))
              assert not code_path.joinpath("dir/subdir").exists()
  
file_path: determined/harness/tests/test_util.py
imports: import os
  import pathlib
  from typing import Optional
  import numpy
  import pytest
  import determined
  from determined import util
  from tests import filetree
label_desc: Use image node_id 8 for calling a global function with example usage: test_local_trial_user_code_detignore(tmp_path) without return types