code: def _get_upstream_downstream_nodes(
      graph: Optional["DiGraph"], node: T
  ) -> Tuple[List[T], List[T]]:
      succ = list(graph.successors(node)) if graph else []
      pre = list(graph.predecessors(node)) if graph else []
      return succ, pre
  
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 6 for calling a global function with example usage: _get_upstream_downstream_nodes(graph, node) and returns: succ,  pre