code: def fnmatch(name: str, pattern: str, sep="/") -> bool:
      if pattern.startswith(sep):
          name = sep + name
      for n, p in zip_longest(
          reversed(name.split(sep)),
          reversed(pattern.split(sep)),
          fillvalue=None,
      ):
          if p == "**":
              raise NotImplementedError()
          if p is None:
              return True
          if n is None or not fnmatch.fnmatch(n, p):
              return False
      return True
  
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 5 for calling the GitIgnore obj's underlying member method code with example usage: obj.fnmatch(name, pattern, sep) and returns: True, True, False