code: def ignore(self, path: PathLike, sep="/") -> bool:
      if not path:
          return False
      path = Path(path)
      if path.is_absolute():
          path = path.relative_to(self.root_dir)
  
      tokens = ("." + sep + str(path)).split(sep)
      for i in range(1, len(tokens)):
          parent = sep.join(tokens[:-i])
          globs = self.ignore_globs.get(parent)
          if not globs:
              continue
          name = sep.join(tokens[-i:])
          for glob in globs:
              if self.fnmatch(name, glob, sep=sep):
                  return True
      return False
  
file_path: dstack/src/dstack/_internal/utils/ignore.py
imports: import fnmatch
  from itertools import zip_longest
  from pathlib import Path
  from typing import Dict, List, Optional
  from dstack._internal.utils.path import PathLike
label_desc: Use image node_id 6 for calling the GitIgnore obj's underlying member method code with example usage: obj.ignore(path, sep) and returns: False, False, True