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.
  
  Examples
  --------
  
  A GeoTIFF can be loaded in memory and accessed using the GeoTIFF
  format driver
  
  >>> with open('tests/data/RGB.byte.tif', 'rb') as f, MemoryFile(f) as memfile:
  ...     with memfile.open() as src:
  ...         pprint.pprint(src.profile)
  ...
  {'count': 3,
   'crs': CRS({'init': 'epsg:32618'}),
   'driver': 'GTiff',
   'dtype': 'uint8',
   'height': 718,
   'interleave': 'pixel',
   'nodata': 0.0,
   'tiled': False,
   'transform': Affine(300.0379266750948, 0.0, 101985.0,
         0.0, -300.041782729805, 2826915.0),
   'width': 791}
code: def __exit__(self, *args):
      self._env.close()
      self.close()
  
imports: import logging
  import warnings
  from rasterio._base import get_dataset_driver, driver_can_create, driver_can_create_copy
  from rasterio._io import DatasetReaderBase, DatasetWriterBase, BufferedDatasetWriterBase, MemoryFileBase
  from rasterio.windows import WindowMethodsMixin
  from rasterio.env import ensure_env
  from rasterio.errors import RasterioDeprecationWarning
  from rasterio.transform import TransformMethodsMixin
  from rasterio._path import _UnparsedPath
label_desc: Use image node_id 4 for calling the MemoryFile obj's underlying member method code with example usage: obj.__exit__() without return types