def Initialize(self):
    """The initialization method."""
    if "r" in self.mode:
      self.state = self.Get(self.Schema.FLOW_STATE)
      if self.state:
        self.Load()

        # A convenience attribute to allow flows to access their args directly.
        self.args = self.state.get("args")

    if self.state is None:
      self.state = self.Schema.FLOW_STATE()
    elif self.state.errors:
      logging.warning("Failed to read state for %s - forcing read only mode.",
                      self.urn)
      self.mode = "r"
dataset/ETHPy150Open google/grr/grr/lib/flow.py/GRRFlow.Initialize/original