code: def _collect_specific_target(
      loader: "StageLoad",
      target: str,
      with_deps: bool,
      recursive: bool,
  ) -> Tuple[StageIter, Optional[str], Optional[str]]:
      from dvc.dvcfile import is_valid_filename
  
      # Optimization: do not collect the graph for a specific target
      file, name = parse_target(target)
  
      # if the target has a file, we can load directly from it.
      if not file:
          # but, if there's no file, parsing is ambiguous as it can be a
          # stage name in `dvc.yaml` file or an output. We prioritize
          # `dvc.yaml` stage name here. If it exists, then we move on.
          # else, we assume it's a output name in the `collect_granular()` below
          msg = "Checking if stage '%s' is in '%s'"
          logger.debug(msg, target, PROJECT_FILE)
          if not (recursive and loader.fs.isdir(target)):
              stages = _maybe_collect_from_dvc_yaml(
                  loader, target, with_deps
              )
              if stages:
                  return stages, file, name
      elif not with_deps and is_valid_filename(file):
          stages = loader.load_all(file, name)
          return stages, file, name
      return [], file, name
  
imports: import fnmatch
  import typing
  from contextlib import suppress
  from functools import wraps
  from typing import Iterable, List, NamedTuple, Optional, Set, Tuple, Union
  from dvc.exceptions import NoOutputOrStageError, OutputDuplicationError, OutputNotFoundError
  from dvc.log import logger
  from dvc.repo import lock_repo
  from dvc.ui import ui
  from dvc.utils import as_posix, parse_target
label_desc: Use image node_id 3 for calling a global function with example usage: _collect_specific_target(loader, target, with_deps, recursive) and returns: list,  file,  name, stages,  file,  name, stages,  file,  name