code: def predict(
      model: nn.Module,
      dataset: Dataset,
      keep_images: bool = False,
      device: Optional[torch.device] = None,
  ) -> List[Prediction]:
      batch, records = build_infer_batch(dataset)
  
      return _predict_batch(
          model=model,
          batch=batch,
          records=records,
          keep_images=keep_images,
          device=device,
      )
  
file_path: icevision/icevision/models/mmseg/common/prediction.py
imports: from icevision.imports import *
  from icevision.utils import *
  from icevision.core import *
  from icevision.data import *
  from icevision.models.utils import _predict_from_dl
  from icevision.models.mmseg.common.utils import *
  from icevision.models.mmseg.common.dataloaders import *
  from icevision.models.interpretation import _move_to_device
  import itertools
label_desc: Use image node_id 3 for calling a global function with example usage: predict(model, dataset, keep_images, device) and returns: _predict_batch