code: def _filter_ignored(
      src: Path,
      patterns: Set[str],
      current_dir: Path,
      entries: List[Path],
  ) -> List[Path]:
      relative_dir = current_dir.relative_to(src)
      names = [str(relative_dir / entry.name) for entry in entries]
      ignored_names = set()
      for pattern in patterns:
          ignored_names.update(fnmatch.filter(names, pattern))
      return [
          entry
          for entry in entries
          if str(relative_dir / entry.name) not in ignored_names
      ]
  
file_path: pytorch-lightning/src/lightning/app/source_code/copytree.py
imports: import fnmatch
  import os
  from functools import partial
  from pathlib import Path
  from shutil import Error, copy2, copystat
  from typing import Callable, List, Optional, Set, Tuple, Union
  from lightning.app.core.constants import DOT_IGNORE_FILENAME
  from lightning.app.utilities.app_helpers import Logger
label_desc: Use image node_id 2 for calling a global function with example usage: _filter_ignored(src, patterns, current_dir, entries) and returns: unknown