code: def ignore_background(
      y_pred: NdarrayTensor, y: NdarrayTensor
  ) -> tuple[NdarrayTensor, NdarrayTensor]:
      """
      This function is used to remove background (the first channel) for `y_pred` and `y`.
  
      Args:
          y_pred: predictions. As for classification tasks,
              `y_pred` should has the shape [BN] where N is larger than 1. As for segmentation tasks,
              the shape should be [BNHW] or [BNHWD].
          y: ground truth, the first dim is batch.
  
      """
  
      y = y[:, 1:] if y.shape[1] > 1 else y  # type: ignore[assignment]
      y_pred = y_pred[:, 1:] if y_pred.shape[1] > 1 else y_pred  # type: ignore[assignment]
      return y_pred, y
  
imports: from __future__ import annotations
  import warnings
  from functools import lru_cache, partial
  from types import ModuleType
  from typing import Any, Iterable, Sequence
  import numpy
  import torch
  from monai.config import NdarrayOrTensor, NdarrayTensor
  from monai.transforms.croppad.dictionary import CropForegroundD
  from monai.transforms.utils import distance_transform_edt
  from monai.utils import MetricReduction, convert_to_cupy, convert_to_dst_type, convert_to_numpy, convert_to_tensor, deprecated_arg, deprecated_arg_default, ensure_tuple_rep, look_up_option, optional_import
label_desc: Use image node_id 1 for calling a global function with example usage: ignore_background(y_pred, y) and returns: y_pred,  y