code: def test_plot_losses(
      fridge_faster_rcnn_model, fridge_ds, monkeypatch
  ):
      monkeypatch.setattr(plt, "show", lambda: None)
      model = fridge_faster_rcnn_model
      ds, _ = fridge_ds
      by = {
          "method": "weighted",
          "weights": {
              "loss_box_reg": 1,
              "loss_classifier": 0,
              "loss_objectness": 0,
              "loss_rpn_box_reg": 0,
          },
      }
  
      (
          samples_plus_losses,
          preds,
          _,
      ) = faster_rcnn.interp.plot_top_losses(
          model=model, dataset=ds, sort_by=by, n_samples=2
      )
      assert len(samples_plus_losses) == len(ds) == len(preds)
  
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 3 for calling a global function with example usage: test_plot_losses(fridge_faster_rcnn_model, fridge_ds, monkeypatch) without return types