class_docstr: A BytesIO-like object, backed by an in-memory file.
  
  This allows formatted files to be read and written without I/O.
  
  A MemoryFile created with initial bytes becomes immutable. A
  MemoryFile created without initial bytes may be written to using
  either file-like or dataset interfaces.
  
  Parameters
  ----------
  file_or_bytes : an open Python file, bytes, or None
      If not None, the MemoryFile becomes immutable and read-only.
      If None, it is write-only.
  filename : str
      An optional filename. The default is a UUID-based name.
  ext : str
      An optional file extension. Some format drivers require a
      specific value.
class_docstr_tok: ["A","BytesIO-like","object",",","backed","by","an","in-memory","file",".","This","allows","formatted","files","to","be","read","and","written","without","I\/O",".","A","MemoryFile","created","with","initial","bytes","becomes","immutable",".","A","MemoryFile","created","without","initial","bytes","may","be","written","to","using","either","file-like","or","dataset","interfaces",".","Parameters","--","--","--","--","--","file_or_bytes",":","an","open","Python","file",",","bytes",",","or","None","If","not","None",",","the","MemoryFile","becomes","immutable","and","read-only",".","If","None",",","it","is","write-only",".","filename",":","str","An","optional","filename",".","The","default","is","a","UUID-based","name",".","ext",":","str","An","optional","file","extension",".","Some","format","drivers","require","a","specific","value","."]
docstr: Open the file and return a Fiona collection object.
  
  If data has already been written, the file is opened in 'r'
  mode. Otherwise, the file is opened in 'w' mode.
  
  Parameters
  ----------
  Note well that there is no `path` parameter: a `MemoryFile`
  contains a single dataset and there is no need to specify a
  path.
  
  Other parameters are optional and have the same semantics as the
  parameters of `fiona.open()`.
docstr_tok: ["Open","the","file","and","return","a","Fiona","collection","object",".","If","data","has","already","been","written",",","the","file","is","opened","in","'","r'","mode",".","Otherwise",",","the","file","is","opened","in","'","w","'","mode",".","Parameters","--","--","--","--","--","Note","well","that","there","is","no","`","path","`","parameter",":","a","`","MemoryFile","`","contains","a","single","dataset","and","there","is","no","need","to","specify","a","path",".","Other","parameters","are","optional","and","have","the","same","semantics","as","the","parameters","of","`","fiona.open","(",")","`","."]
code: def open(
      self,
      mode=None,
      driver=None,
      schema=None,
      crs=None,
      encoding=None,
      layer=None,
      vfs=None,
      enabled_drivers=None,
      crs_wkt=None,
      allow_unsupported_drivers=False,
      **kwargs,
  ):
      """Open the file and return a Fiona collection object.
  
      If data has already been written, the file is opened in 'r'
      mode. Otherwise, the file is opened in 'w' mode.
  
      Parameters
      ----------
      Note well that there is no `path` parameter: a `MemoryFile`
      contains a single dataset and there is no need to specify a
      path.
  
      Other parameters are optional and have the same semantics as the
      parameters of `fiona.open()`.
      """
      if self.closed:
          raise OSError("I/O operation on closed file.")
  
      if (
          not allow_unsupported_drivers
          and driver is not None
          and not supports_vsi(driver)
      ):
          raise DriverError(
              f"Driver {driver} does not support virtual files."
          )
  
      if mode in ("r", "a") and not self.exists():
          raise OSError("MemoryFile does not exist.")
      if layer is None and mode == "w" and self.exists():
          raise OSError("MemoryFile already exists.")
  
      if not self.exists() or mode == "w":
          if driver is not None:
              self._ensure_extension(driver)
          mode = "w"
      elif mode is None:
          mode = "r"
  
      return Collection(
          self.name,
          mode,
          crs=crs,
          driver=driver,
          schema=schema,
          encoding=encoding,
          layer=layer,
          enabled_drivers=enabled_drivers,
          allow_unsupported_drivers=allow_unsupported_drivers,
          crs_wkt=crs_wkt,
          **kwargs,
      )
  
file_path: Fiona/fiona/io.py
imports: import logging
  from fiona.ogrext import MemoryFileBase, _listdir, _listlayers
  from fiona.collection import Collection
  from fiona.meta import supports_vsi
  from fiona.errors import DriverError
label_desc: Use image node_id 2 for calling the MemoryFile obj's underlying member method code with example usage: obj.open(mode, driver, schema, crs, encoding, layer, vfs, enabled_drivers, crs_wkt, allow_unsupported_drivers) and returns: Collection