code: def _update(
      self,
      dirname: str,
      ignore_trie: Trie,
      dnames: Optional["List"],
      ignore_subrepos: bool,
  ) -> None:
      self._update_trie(dirname, ignore_trie)
  
      if ignore_subrepos:
          if dnames is None:
              try:
                  _, dnames, _ = next(self.fs.walk(dirname))
              except StopIteration:
                  dnames = []
  
          for dname in dnames:
              self._update_sub_repo(
                  self.fs.join(dirname, dname), ignore_trie
              )
  
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 4 for calling the DvcIgnoreFilter obj's underlying member method code with example usage: obj._update(dirname, ignore_trie, dnames, ignore_subrepos) without return types