def __nonzero__(self):
    if self.mode not in "r":
      raise AttributeError(
          "Cannot determine collection length in write only mode.")

    # This checks if there is data in the stream.
    if super(PackedVersionedCollection, self).__nonzero__():
      return True

    # if there is not, we might have some uncompacted data.
    return self.IsAttributeSet(self.Schema.DATA)
dataset/ETHPy150Open google/grr/grr/lib/aff4_objects/collects.py/PackedVersionedCollection.__nonzero__/swapped operands of `not in`