code: def find_pager():
      from . import Console
  
      if not Console.isatty():
          return None
  
      pager = os.getenv(DVC_PAGER)
      if not pager:
          pager = os.getenv(PAGER_ENV)
      if not pager:
          ret = os.system(
              f"({DEFAULT_PAGER}) 2>{os.devnull}"
          )  # noqa: S605
          if ret != 0:
              logger.warning(
                  "Unable to find `less` in the PATH. Check out %s for more info.",
                  format_link("https://man.dvc.org/pipeline/show"),
              )
          else:
              pager = DEFAULT_PAGER
  
      if pager == DEFAULT_PAGER:
          # if pager is less (i.e. default), regardless of `$LESS`, apply `-RS`.
          # `-R` is required to render ansi escape sequences for exp show
          # and, `-S` is required for horizontal scrolling.
          less_env = bool(os.getenv(LESS))
          return prepare_default_pager(
              ansi_escapes=True,
              chop_long_lines=True,
              quit_if_one_screen=not less_env,
              no_init=not less_env,
          )
  
      return pager
  
file_path: dvc/dvc/ui/pager.py
imports: import os
  import pydoc
  from rich.pager import Pager
  from dvc.env import DVC_PAGER
  from dvc.log import logger
  from dvc.utils import format_link
label_desc: Use image node_id 3 for calling a global function with example usage: find_pager() and returns: pager, None, prepare_default_pager