code: def __init__(self, fs, root_dir):
      from dvc.repo import Repo
  
      default_ignore_patterns = [
          ".hg/",
          ".git/",
          ".git",
          f"{Repo.DVC_DIR}/",
      ]
  
      self.fs = fs
      self.root_dir = root_dir
      self.ignores_trie_fs = Trie()
      self._ignores_trie_subrepos = Trie()
  
      key = self._get_key(root_dir)
      self.ignores_trie_fs[key] = DvcIgnorePatterns(
          default_ignore_patterns,
          root_dir,
          fs.sep,
      )
      self._ignores_trie_subrepos[key] = self.ignores_trie_fs[key]
      self._update(
          self.root_dir,
          self._ignores_trie_subrepos,
          dnames=None,
          ignore_subrepos=False,
      )
      self._update(
          self.root_dir,
          self.ignores_trie_fs,
          dnames=None,
          ignore_subrepos=True,
      )
  
imports: import os
  import re
  from collections import namedtuple
  from itertools import chain, groupby, takewhile
  from typing import TYPE_CHECKING, List, Optional
  from pathspec.patterns import GitWildMatchPattern
  from pathspec.util import normalize_file
  from pygtrie import Trie
  from dvc.fs import Schemes, localfs
  from dvc.log import logger
  from dvc.pathspec_math import PatternInfo, merge_patterns
label_desc: Use image node_id 1 to create a new DvcIgnoreFilter object  with example: obj = DvcIgnoreFilter(fs, root_dir)