code: def page_string(str_to_page, pager_cmd):
      
      # By default, we expect the command to be `less -R`. If that is the
      # pager_cmd, but they don't have less on their machine, odds are they're
      # just using the default value. In this case the pager will fail, so we'll
      # just go via pydoc.pager, which tries to do smarter checking that we don't
      # want to bother trying to replicate.
      use_fallback_page_function = False
      if pager_cmd is None:
          use_fallback_page_function = True
      elif pager_cmd == FLAG_FALLBACK:
          use_fallback_page_function = True
  
      try:
          if use_fallback_page_function:
              pydoc.pager(str_to_page)
          else:
              # Otherwise, obey the user.
              pydoc.pipepager(str_to_page, cmd=pager_cmd)
      except KeyboardInterrupt:
          pass
docs: Page str_to_page via the pager.