@brief Helper function to log a match into the history

@internal
966814
private function logMatch($index, $matchPos, $matchData)
    {
        if (isset($this->matchHistory[0])) {
            $this->matchHistory[1] = $this->matchHistory[0];
        }
        $m = &$this->matchHistory[0];
        $m[0] = $index;
        $m[1] = $matchPos;
        $m[2] = $matchData;
    }
1174786
def get_log_file_from_item(history):
    
    try:
        log_file, description = shlex.split(history)
    except ValueError:
        log_file = history.strip()

    return log_file
363190
protected function cleanHistory()
    {
        $createdAt = new \DateTime();
        $logs = $this->instance->getLogs();
        foreach($logs as $log) {
            if(($createdAt->getTimestamp() - $log->getCreatedAt()->getTimestamp()) > $this->expiredTimestamp) {
                $this->instance->removeLog($log);
            }
        }
    }
1341021
def _find_prev regex=@last_regex, start = @search_found_ix, first_time = false
      #TODO the firsttime part, see find_next
      #raise "No previous search" if regex.nil?
      warn "No previous search" and return if regex.nil?
      #$log.debug " _find_prev #{@search_found_ix} : #{@current_index}"
      if start != 0
        start -= 1 unless start == 0
        @last_regex = regex
        @search_start_ix = start
        regex = Regexp.new(regex, Regexp::IGNORECASE) if @search_case
        start.downto(0) do |ix| 
          row = @list[ix].to_s
          m=row.match(regex)
          if !m.nil?
            @find_offset = m.offset(0)[0]
            @find_offset1 = m.offset(0)[1]
            ix += (@_header_adjustment || 0)
            @search_found_ix = ix
            return ix 
          end
        end
      end
      fend = start-1
      start = @list.size-1
      if @search_wrap
        start.downto(fend) do |ix| 
          row = @list[ix].to_s
          m=row.match(regex)
          if !m.nil?
            @find_offset = m.offset(0)[0]
            @find_offset1 = m.offset(0)[1]
            ix += (@_header_adjustment || 0)
            @search_found_ix = ix
            return ix 
          end
        end
      end
      return nil
    end
904243
def results_history(history_log, no_color):
    """"""
    try:
        with open(history_log, 'r') as f:
            lines = f.readlines()
    except Exception as error:
        echo_style(
            'Unable to process results history log: %s' % error,
            no_color,
            fg='red'
        )
        sys.exit(1)

    index = len(lines)
    for item in lines:
        click.echo('{} {}'.format(index, item), nl=False)
        index -= 1
1266895
def previous_history(self, current): # (C-p)
         '''
        if self.history_cursor == len(self.history):
            self.history.append(current.copy()) #do not use add_history since we do not want to increment cursor
            
        if self.history_cursor > 0:
            self.history_cursor -= 1
            current.set_line(self.history[self.history_cursor].get_line_text())
            current.point = lineobj.EndOfLine
279737
function getHistory(context) {
  if (!historyMap.has(context)) {
    clear(context);
  }
  return historyMap.get(context);
}
601606
def logs(self):
        
        for record in self.history:
            if (record["when"] >= self.options.since.date
                    and record["when"] < self.options.until.date):
                for change in record["changes"]:
                    yield record["who"], change
1189236
def history_ids(amount, before_id = nil, after_id = nil, around_id = nil)
      logs = API::Channel.messages(@bot.token, @id, amount, before_id, after_id, around_id)
      JSON.parse(logs).map { |message| message['id'].to_i }
    end
1047403
def RecordHistory(self):
        """"""
        if not self.restoringHistory:
            record = self.activated_node
            if self.historyIndex < -1:
                try:
                    del self.history[self.historyIndex+1:]
                except AttributeError, err:
                    pass
            if (not self.history) or record != self.history[-1]:
                self.history.append(record)
            del self.history[:-200]
            self.historyIndex = -1
219463
def get_match_history_by_sequence_num(start_at_match_seq_num,
                                      matches_requested=None, **kwargs):
    
    params = {
        "start_at_match_seq_num": start_at_match_seq_num,
        "matches_requested": matches_requested
    }

    return make_request("GetMatchHistoryBySequenceNum", params,
        **kwargs)
168175
function(method, args) {
    var isNeedFix = global.history !== windowHistory;
    if (isNeedFix) {
      global.history = windowHistory;
    }
    method.apply(windowHistory, args);
    if (isNeedFix) {
      global.history = historyObject;
    }
  }
1186134
def start_history_lines_completion(self):
        
        found_completions = set()
        completions = []

        # For every line of the whole history, find matches with the current line.
        current_line = self.document.current_line_before_cursor.lstrip()

        for i, string in enumerate(self._working_lines):
            for j, l in enumerate(string.split('\n')):
                l = l.strip()
                if l and l.startswith(current_line):
                    # When a new line has been found.
                    if l not in found_completions:
                        found_completions.add(l)

                        # Create completion.
                        if i == self.working_index:
                            display_meta = "Current, line %s" % (j+1)
                        else:
                            display_meta = "History %s, line %s" % (i+1, j+1)

                        completions.append(Completion(
                            l,
                            start_position=-len(current_line),
                            display_meta=display_meta))

        self.set_completions(completions=completions[::-1])
603346
def add_history(self, fname, fargs, init=0):
        
        if init == 1:
            self.history = []
        self.history.append([fname, fargs])
306247
function history(params, cb) {
  params.resourcePath = config.addURIParams(constants.STATS_BASE_PATH + "/history", params);
  params.method = 'POST';
  params.data = params.data || {};
  mbaasRequest.admin(params, cb);
}
1327213
def history_search_forward(self, e): # ()
        '''
        self.l_buffer=self._history.history_search_forward(self.l_buffer)
622947
def loop_once
    return super if SqueezeHistory.disabled?
    begin
      input, last_input = history[-1], history[-2]
    rescue IndexError # EditLine is really broken, to_a is needed for it
      array = history.to_a
      input, last_input = array[-1], array[-2]
    end
    history.pop if input.to_s.strip == '' ||
                  (history.size > 1 && input == last_input)
    super
  end