code: def test_ignore_in_added_dir(tmp_dir, dvc):
      tmp_dir.gen(
          {
              "dir": {
                  "sub": {
                      "ignored": {"content": "ignored content"},
                      "not_ignored": "not ignored content",
                  }
              },
              ".dvcignore": "**/ignored",
          }
      )
      dvc._reset()
  
      ignored_path = tmp_dir / "dir" / "sub" / "ignored"
      result = dvc.dvcignore.find(dvc.fs, ignored_path)
      assert set(result) == set()
      assert ignored_path.exists()
  
      dvc.add("dir")
      shutil.rmtree(ignored_path)
      dvc.checkout()
  
      assert not ignored_path.exists()
  
imports: import os
  import shutil
  from pathlib import Path
  from typing import List
  import pytest
  from dvc.ignore import DvcIgnore, DvcIgnorePatterns
  from dvc.output import OutputIsIgnoredError
  from dvc.pathspec_math import PatternInfo, merge_patterns
  from dvc.repo import Repo
  from dvc.testing.tmp_dir import TmpDir
  from dvc_data.hashfile.build import IgnoreInCollectedDirError
  from dvc_data.hashfile.utils import get_mtime_and_size
label_desc: Use image node_id 20 for calling a global function with example usage: test_ignore_in_added_dir(tmp_dir, dvc) without return types