code: def collect_stages(
      repo: "Repo",
      targets: Iterable[str],
      recursive: bool = False,
      glob: bool = False,
  ) -> List["Stage"]:
      stages: List["Stage"] = []
      for target in targets:
          stages.extend(
              repo.stage.collect(target, recursive=recursive, glob=glob)
          )
      return ldistinct(stages)
  
file_path: dvc/dvc/repo/reproduce.py
imports: from typing import TYPE_CHECKING, Callable, Dict, Iterable, List, NoReturn, Optional, Set, Tuple, TypeVar, Union, cast
  from funcy import ldistinct
  from dvc.exceptions import ReproductionError
  from dvc.log import logger
  from dvc.repo.scm_context import scm_context
  from dvc.stage.cache import RunCacheNotSupported
  from dvc.utils import humanize
  from dvc.utils.collections import ensure_list
  from .None import locked
label_desc: Use image node_id 1 for calling a global function with example usage: collect_stages(repo, targets, recursive, glob) and returns: ldistinct