code: def _get_stages(self) -> Iterable["Stage"]:
      if self.args.all:
          stages: List["Stage"] = self.repo.index.stages
          logger.trace("%d no. of stages found", len(stages))
          return stages
  
      # removing duplicates while maintaining order
      collected = chain.from_iterable(
          self.repo.stage.collect(
              target=target, recursive=self.args.recursive
          )
          for target in self.args.targets
      )
      return dict.fromkeys(collected).keys()
  
imports: import argparse
  import logging
  from contextlib import contextmanager
  from itertools import chain, filterfalse
  from typing import TYPE_CHECKING, Dict, Iterable, List
  from dvc.cli import completion, formatter
  from dvc.cli.command import CmdBase
  from dvc.cli.utils import append_doc_link
  from dvc.log import logger
  from dvc.utils.cli_parse import parse_params
  from dvc.utils.humanize import truncate_text
label_desc: Use image node_id 1 for calling the CmdStageList obj's underlying member method code with example usage: obj._get_stages() and returns: dict, stages