def WriteState(self):
    if self.mode in "w":
      if self.state.Empty():
        raise IOError("Trying to write an empty state for flow %s." %
                      self.urn)
      self.Set(self.Schema.FLOW_STATE(self.state))
dataset/ETHPy150Open google/grr/grr/lib/flow.py/GRRFlow.WriteState/swapped operands of `in`