code: def test_get_samples_losses(
      fridge_faster_rcnn_model, fridge_ds, monkeypatch
  ):
      monkeypatch.setattr(plt, "show", lambda: None)
      model = fridge_faster_rcnn_model
      ds, _ = fridge_ds
  
      samples_plus_losses, _, _ = faster_rcnn.interp.plot_top_losses(
          model=model, dataset=ds, n_samples=2
      )
      loss_per_image = models.get_samples_losses(samples_plus_losses)
      assert "filepath" in loss_per_image[0].keys()
  
file_path: icevision/tests/models/torchvision_models/faster_rcnn/test_show_results.py
imports: import pytest
  from icevision.all import *
  from icevision.models.torchvision import faster_rcnn
label_desc: Use image node_id 6 for calling a global function with example usage: test_get_samples_losses(fridge_faster_rcnn_model, fridge_ds, monkeypatch) without return types