code: def test_should_ignore_dir(omit_dir, sub_dir):
      root = os.path.join(os.path.sep, "walk", "dir", "root")
      ignore = DvcIgnorePatterns(
          [".git/", ".hg/", ".dvc/"], root, os.sep
      )
  
      dirs = [omit_dir, "dir1", "dir2"]
      files = [omit_dir, "file1", "file2"]
  
      if sub_dir:
          current = os.path.join(root, sub_dir)
      else:
          current = root
  
      new_dirs, new_files = ignore(current, dirs, files)
  
      assert set(new_dirs) == {"dir1", "dir2"}
      assert set(new_files) == {"file1", "file2", omit_dir}
  
imports: import os
  import pytest
  from dvc.ignore import DvcIgnorePatterns
label_desc: Use image node_id 2 for calling a global function with example usage: test_should_ignore_dir(omit_dir, sub_dir) without return types