code: def _to_4d(x):
      if x.ndim == 2:
          return x[None, :, :, None]
      elif x.ndim == 3:
          return x[None, :, :]
  
file_path: segmentation_models/tests/test_metrics.py
imports: import pytest
  import numpy
  import segmentation_models
  from segmentation_models.metrics import IOUScore, FScore
  from segmentation_models.losses import JaccardLoss, DiceLoss
label_desc: Use image node_id 1 for calling a global function with example usage: _to_4d(x) and returns: x, x