Find the best pager settings for this command.  If the user has
        specified overrides in the INI config file we prefer those.
963302
def get_pager_spec(self):
        
        self_config = self.get_config()
        pagercmd = self_config.get('pager')
        istty = self_config.getboolean('pager_istty')
        core_config = self.get_config('core')
        if pagercmd is None:
            pagercmd = core_config.get('pager')
        if istty is None:
            istty = core_config.get('pager_istty')
        return {
            "pagercmd": pagercmd,
            "istty": istty
        }
739241
def configure_ospf(self, cmd):
        
        config = self.get()
        cmds = ['router ospf {}'.format(config['ospf_process_id'])]
        cmds.extend(make_iterable(cmd))
        return super(Ospf, self).configure(cmds)
1140967
def get_default_config(self):
        
        default_config = super(SNMPInterfaceCollector,
                               self).get_default_config()
        default_config['path'] = 'interface'
        default_config['byte_unit'] = ['bit', 'byte']
        return default_config
769341
protected function setPagerListFile()
    {
        $conditions = $this->query_filter;
        $conditions['count'] = true;

        $pager = array(
            'query' => $this->query_filter,
            'total' => (int) $this->file->getList($conditions)
        );

        return $this->data_limit = $this->setPager($pager);
    }
334313
def override_defaults_based_on_config(config)
      override_default(flags,config)
      override_default(switches,config)

      override_command_defaults(commands,config)
    end
1173260
def config_options(self):
        
        # ---- Jupyter config ----
        try:
            full_cfg = load_pyconfig_files(['jupyter_qtconsole_config.py'],
                                           jupyter_config_dir())

            # From the full config we only select the JupyterWidget section
            # because the others have no effect here.
            cfg = Config({'JupyterWidget': full_cfg.JupyterWidget})
        except:
            cfg = Config()

        # ---- Spyder config ----
        spy_cfg = Config()

        # Make the pager widget a rich one (i.e a QTextEdit)
        spy_cfg.JupyterWidget.kind = 'rich'

        # Gui completion widget
        completion_type_o = self.get_option('completion_type')
        completions = {0: "droplist", 1: "ncurses", 2: "plain"}
        spy_cfg.JupyterWidget.gui_completion = completions[completion_type_o]

        # Pager
        pager_o = self.get_option('use_pager')
        if pager_o:
            spy_cfg.JupyterWidget.paging = 'inside'
        else:
            spy_cfg.JupyterWidget.paging = 'none'

        # Calltips
        calltips_o = self.get_option('show_calltips')
        spy_cfg.JupyterWidget.enable_calltips = calltips_o

        # Buffer size
        buffer_size_o = self.get_option('buffer_size')
        spy_cfg.JupyterWidget.buffer_size = buffer_size_o

        # Prompts
        in_prompt_o = self.get_option('in_prompt')
        out_prompt_o = self.get_option('out_prompt')
        if in_prompt_o:
            spy_cfg.JupyterWidget.in_prompt = in_prompt_o
        if out_prompt_o:
            spy_cfg.JupyterWidget.out_prompt = out_prompt_o

        # Style
        color_scheme = CONF.get('appearance', 'selected')
        style_sheet = create_qss_style(color_scheme)[0]
        spy_cfg.JupyterWidget.style_sheet = style_sheet
        spy_cfg.JupyterWidget.syntax_style = color_scheme

        # Merge QtConsole and Spyder configs. Spyder prefs will have
        # prevalence over QtConsole ones
        cfg._merge(spy_cfg)
        return cfg
195423
public function findPageSettings($pageId)
    {
        $this->makeSelect();
        $this->sql .= ' and page_id = ?';
        $this->bindValues[] = $pageId;

        return $this->find();
    }
482102
def print_help(self, *args, **kwargs):
        
        if self._command is not None and self._command.session.allow_pager:
            desc = 'Help\: %s' % '-'.join(self.prog.split())
            pager_kwargs = self._command.get_pager_spec()
            with paging.pager_redirect(desc, **pager_kwargs):
                return super().print_help(*args, **kwargs)
        else:
                return super().print_help(*args, **kwargs)
1060692
def find_page_location(command, specified_platform):
    """"""
    repo_directory = get_config()['repo_directory']
    default_platform = get_config()['platform']
    command_platform = (
        specified_platform if specified_platform else default_platform)

    with io.open(path.join(repo_directory, 'pages/index.json'),
                 encoding='utf-8') as f:
        index = json.load(f)
    command_list = [item['name'] for item in index['commands']]
    if command not in command_list:
        sys.exit(
            ("Sorry, we don't support command: {0} right now.\n"
             "You can file an issue or send a PR on github:\n"
             "    https://github.com/tldr-pages/tldr").format(command))

    supported_platforms = index['commands'][
        command_list.index(command)]['platform']
    if command_platform in supported_platforms:
        platform = command_platform
    elif 'common' in supported_platforms:
        platform = 'common'
    else:
        platform = ''
    if not platform:
        sys.exit(
            ("Sorry, command {0} is not supported on your platform.\n"
             "You can file an issue or send a PR on github:\n"
             "    https://github.com/tldr-pages/tldr").format(command))

    page_path = path.join(path.join(repo_directory, 'pages'),
                          path.join(platform, command + '.md'))
    return page_path
1311306
public static void configCacheSettings(String imFileDir, String docDir, String fileDir, String queryResultDir,
         String commandDir, String analyticsDir, SystemSetting setting) {
    importantFileDir = imFileDir;
    if (!importantFileDir.endsWith("/")) {
      importantFileDir += "/";
    }

    documentDir = docDir;
    if (!documentDir.endsWith("/")) {
      documentDir += "/";
    }

    fileCacheDir = fileDir;
    if (!fileCacheDir.endsWith("/")) {
      fileCacheDir += "/";
    }

    queryResultCacheDir = queryResultDir;
    if (!queryResultCacheDir.endsWith("/")) {
      queryResultCacheDir += "/";
    }

    commandCacheDir = commandDir;
    if (!commandCacheDir.endsWith("/")) {
      commandCacheDir += "/";
    }

    analyticsCacheDir = analyticsDir;
    if (!analyticsCacheDir.endsWith("/")) {
      analyticsCacheDir += "/";
    }

    makeSureCacheDirWorkable();
    defaultSetting = setting;
  }
49537
public function getPager()
    {
        if (!isset($this->pager) && $this->usePcntl()) {
            if ($pager = \ini_get('cli.pager')) {
                // use the default pager
                $this->pager = $pager;
            } elseif ($less = \exec('which less 2>/dev/null')) {
                // check for the presence of less...
                $this->pager = $less . ' -R -S -F -X';
            }
        }

        return $this->pager;
    }
1320932
def configure_pagination(page, options)
      page = super(page, options)
      raise ::Folio::InvalidPage unless page.current_page.is_a?(Integer)
      raise ::Folio::InvalidPage if page.out_of_bounds?
      page
    rescue ::WillPaginate::InvalidPage
      raise ::Folio::InvalidPage
    end
29345
public function Details() {
      if ($this->_PropertiesDefined === FALSE)
         trigger_error(ErrorMessage('You must configure the pager with $Pager->Configure() before retrieving the pager details.', 'MorePager', 'Details'), E_USER_ERROR);
         
      $Details = FALSE;
      if ($this->TotalRecords > 0) {
         if ($this->_Totalled === TRUE) {
            $Details = self::FormatUrl(T('%s$1 to %s$2 of %s$3'), $this->Offset + 1, $this->_LastOffset, $this->TotalRecords);
         } else {
            $Details = self::FormatUrl(T('%s$1 to %s$2'), $this->Offset, $this->_LastOffset);
         }
      }
      return $Details;
   }
278045
protected function loadOverrides()
    {
        if ($this->overrides === null) {
            $this->overrides = [];

            if ($this->overrideFile !== null) {
                $this->overrides = Craft::$app->getConfig()->getConfigFromFile($this->overrideFile);
            }
        }
    }
422577
protected function setPagerListSearch()
    {
        $options = array(
            'status' => 1,
            'count' => true,
            'store_id' => $this->store_id,
            'language' => $this->langcode
        );

        $pager = array(
            'query' => $this->query_filter,
            'limit' => $this->configTheme('catalog_limit', 20),
            'total' => (int) $this->search->search('product', $this->data_term, $options)
        );

        return $this->data_limit = $this->setPager($pager);
    }
45150
def __get_default_settings(self):
        

        LOGGER.debug("> Accessing '{0}' default settings file!".format(UiConstants.settings_file))
        self.__default_settings = QSettings(
            umbra.ui.common.get_resource_path(UiConstants.settings_file), QSettings.IniFormat)
932854
protected function predefinePerPageOptions()
    {
        array_unshift($this->perPageOptions, $this->maxPerPage);
        $this->perPageOptions = array_unique($this->perPageOptions);
        sort($this->perPageOptions);
    }