def Initialize(self):
    """Initialize the internal storage stream."""
    self.stream_dirty = False

    try:
      self.fd = aff4.FACTORY.Open(self.urn.Add("UnversionedStream"),
                                  aff4_type="AFF4UnversionedImage",
                                  mode=self.mode,
                                  token=self.token)
      self.size = int(self.Get(self.Schema.SIZE))
      return
    except __HOLE__:
      pass

    # We still have many collections which were created with a versioned stream,
    # which wastes space. Check if this is such a collection and revert to the
    # old behavior if necessary.
    try:
      self.fd = aff4.FACTORY.Open(self.urn.Add("Stream"),
                                  aff4_type="AFF4Image", mode=self.mode,
                                  token=self.token)
      self.size = int(self.Get(self.Schema.SIZE))
      return
    except IOError:
      pass

    # If we get here, the stream does not already exist - we create a new
    # stream.
    self.fd = aff4.FACTORY.Create(self.urn.Add("UnversionedStream"),
                                  "AFF4UnversionedImage",
                                  mode=self.mode, token=self.token)
    self.fd.seek(0, 2)
    self.size = 0
dataset/ETHPy150Open google/grr/grr/lib/aff4_objects/collects.py/RDFValueCollection.Initialize