@flow.StateHandler()
  def CreateTimeline(self):
    """Populate the timeline with the MAC data."""
    child_urns = self._ListVFSChildren([self.state.urn])
    attribute = aff4.Attribute.GetAttributeByName("stat")

    for subject, values in data_store.DB.MultiResolvePrefix(
        child_urns, attribute.predicate, token=self.token, limit=10000000):
      for _, serialized, _ in values:
        stat = rdf_client.StatEntry(serialized)
        event = timeline.Event(source=utils.SmartUnicode(subject),
                               stat=stat)

        # Add a new event for each MAC time if it exists.
        for c in "mac":
          timestamp = getattr(stat, "st_%stime" % c)
          if timestamp is not None:
            event.timestamp = timestamp * 1000000
            event.type = "file.%stime" % c

            # We are taking about the file which is a direct child of the
            # source.
            event.subject = utils.SmartUnicode(subject)
            if self.runner.output is not None:
              self.runner.output.AddEvent(event)
dataset/ETHPy150Open google/grr/grr/lib/flows/general/timelines.py/MACTimes.CreateTimeline/original