Parse the History file.
327331
def Parse(self, stat, file_object, knowledge_base):
    """"""
    _, _ = stat, knowledge_base
    # TODO(user): Convert this to use the far more intelligent plaso parser.
    ff = Firefox3History(file_object)
    for timestamp, unused_entry_type, url, title in ff.Parse():
      yield rdf_webhistory.BrowserHistoryItem(
          url=url,
          domain=urlparse.urlparse(url).netloc,
          access_time=timestamp,
          program_name="Firefox",
          source_path=file_object.Path(),
          title=title)
726990
def _update_history(self):
        """"""
        ipa_utils.update_history_log(
            self.history_log,
            description=self.description,
            test_log=self.log_file
        )
1039755
def Parse(self, statentry, file_object, knowledge_base):
    """"""

    plist = biplist.readPlist(file_object)

    if not isinstance(plist, list):
      raise parser.ParseError(
          "InstallHistory plist is a '%s', expecting a list" % type(plist))

    packages = []
    for sw in plist:
      packages.append(
          rdf_client.SoftwarePackage(
              name=sw.get("displayName"),
              version=sw.get("displayVersion"),
              description=",".join(sw.get("packageIdentifiers")),
              # TODO(hanuszczak): make installed_on an RDFDatetime
              installed_on=_DateToEpoch(sw.get("date")),
              install_state=rdf_client.SoftwarePackage.InstallState.INSTALLED))

    if packages:
      yield rdf_client.SoftwarePackages(packages=packages)
708462
def _get_history_next(self):
        
        if self._has_history:
            ret = self._input_history.return_history(1)
            self.string = ret
            self._curs_pos = len(ret)
1267684
def write_history_file(self, filename = None): 
        '''
        if filename is None:
            filename = self.history_filename
        fp = open(filename, u'wb')
        for line in self.history[-self.history_length:]:
            fp.write(ensure_str(line.get_line_text()))
            fp.write(u'\n')
        fp.close()
134488
def load_history(self) -> List["IterationRecord"]:
        
        if path.isfile(self.history_filename):
            with open(self.history_filename, "r") as f:
                try:
                    dicts = json.load(f)

                except json.decoder.JSONDecodeError as e:
                    self.log.error(f"Got error \n{e}\n decoding JSON history, overwriting it.\n"
                                   f"Former history available in {self.history_filename}.bak")
                    copyfile(self.history_filename, f"{self.history_filename}.bak")
                    return []

                history: List[IterationRecord] = []
                for hdict_pre in dicts:

                    if "_type" in hdict_pre and hdict_pre["_type"] == IterationRecord.__name__:
                        # repair any corrupted entries
                        hdict = _repair(hdict_pre)
                        record = IterationRecord.from_dict(hdict)
                        history.append(record)

                    # Be sure to handle legacy tweetrecord-only histories.
                    # Assume anything without our new _type (which should have been there from the
                    # start, whoops) is a legacy history.
                    else:
                        item = IterationRecord()

                        # Lift extra keys up to upper record (if they exist).
                        extra_keys = hdict_pre.pop("extra_keys", {})
                        item.extra_keys = extra_keys

                        hdict_obj = TweetRecord.from_dict(hdict_pre)

                        # Lift timestamp up to upper record.
                        item.timestamp = hdict_obj.timestamp

                        item.output_records["birdsite"] = hdict_obj

                        history.append(item)

                self.log.debug(f"Loaded history:\n {history}")

                return history

        else:
            return []
284232
def history(self, user=None):
        
        for event in self.changelog:
            when, who, what, old, new, ignore = event
            if (when >= self.options.since.date and
                    when <= self.options.until.date):
                if user is None or who.startswith(user.login):
                    yield who, what, old, new
1336188
def save_history(self):
        """"""
        open(self.LOG_PATH, 'w').write("\n".join( \
                [to_text_string(self.pydocbrowser.url_combo.itemText(index))
                 for index in range(self.pydocbrowser.url_combo.count())]))
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
1233742
def _Parse(self):
    """"""
    root_file_entry = self._file_system.GetRootFileEntry()

    for sub_file_entry in root_file_entry.sub_file_entries:
      volume = APFSVolume(sub_file_entry)
      self._AddVolume(volume)
92509
function addToHistory (state, type, value) {
  let dest

  if (type === 'file') {
    dest = utils.getRefFilePath(value)
  } else {
    if (value === '#') {
      return false
    }
    dest = state.current.concat(`:${value}`)
  }

  if (dest) {
    dest = dest.toLowerCase()
    if (state.history.indexOf(dest) >= 0) {
      return false
    }

    state.history.push(dest)
  }
  return true
}
235960
def create_history_filename(self):
        """"""
        if self.history_filename and not osp.isfile(self.history_filename):
            try:
                encoding.writelines(self.INITHISTORY, self.history_filename)
            except EnvironmentError:
                pass
87916
def Parse(self, stat, file_object, knowledge_base):
    """"""
    _, _ = stat, knowledge_base
    # TODO(user): Convert this to use the far more intelligent plaso parser.
    ie = IEParser(file_object)
    for dat in ie.Parse():
      yield rdf_webhistory.BrowserHistoryItem(
          url=dat["url"],
          domain=urlparse.urlparse(dat["url"]).netloc,
          access_time=dat.get("mtime"),
          program_name="Internet Explorer",
          source_urn=file_object.urn)
1068705
def from_node(index, value):
        
        try:
            lines = json.loads(value)
        except (TypeError, ValueError):
            lines = None
        if not isinstance(lines, list):
            lines = []
        return TimelineHistory(index, value, lines)
1121376
def history(annotation_module):
    """"""
    for path in get_annotation_history(annotation_module):
        h = get_bel_resource_hash(path.as_posix())
        click.echo('{}\t{}'.format(path, h))
805933
def parse(self, filePath, skipLines=0, separator = ',', stringSeparator = '"', lineSeparator = '\n') :
		""""""
		
		self.filename = filePath
		f = open(filePath)
		if lineSeparator == '\n' :
			lines = f.readlines()
		else :
			lines = f.read().split(lineSeparator)
		f.flush()
		f.close()
		
		lines = lines[skipLines:]
		self.lines = []
		self.comments = []
		for l in lines :
			# print l
			if len(l) != 0 and l[0] != "#" :
				self.lines.append(l)
			elif l[0] == "#" :
				self.comments.append(l)

		self.separator = separator
		self.lineSeparator = lineSeparator
		self.stringSeparator = stringSeparator
		self.legend = collections.OrderedDict()
		
		i = 0
		for c in self.lines[0].lower().replace(stringSeparator, '').split(separator) :
			legendElement = c.strip()
			if legendElement not in self.legend :
				self.legend[legendElement] = i
			i+=1
	
		self.strLegend = self.lines[0].replace('\r', '\n').replace('\n', '')
		self.lines = self.lines[1:]
76353
def parse(s):
    """"""
    stopwatch = StopWatch()
    for line in s.splitlines():
      if line.strip():
        parts = line.split(None)
        name = parts[0]
        if name != "%":  # ie not the header line
          rest = (float(v) for v in parts[2:])
          stopwatch.times[parts[0]].merge(Stat.build(*rest))
    return stopwatch