def __init__(self, layer_ptr, ds):
        self._ptr = None # Initially NULL
        if not layer_ptr:
            raise OGRException('Cannot create Layer, invalid pointer given')
        self._ptr = layer_ptr
        self._ds = ds
        self._ldefn = get_layer_defn(self._ptr)
        # Does the Layer support random reading?
        self._random_read = self.test_capability('RandomRead')
Initializes on an OGR C pointer to the Layer and the `DataSource` object
dataset/ETHPy150Open dcramer/django-compositepks/django/contrib/gis/gdal/layer.py/Layer.__init__