def _read_with_mask(raster, masked):
        """ returns if we should read from rasterio using the masked
        """
        if masked is None:
            mask_flags = raster.mask_flag_enums
            per_dataset_mask = all([rasterio.enums.MaskFlags.per_dataset in flags for flags in mask_flags])
            masked = per_dataset_mask
        return masked
returns if we should read from rasterio using the masked