code: def default_label_extractor(x: Any) -> torch.Tensor:
      """Default callable for getting label from batch data."""
      out: torch.Tensor = x["label"] if isinstance(x, dict) else x[1]
      return out
  
imports: from __future__ import annotations
  import pickle
  import types
  import warnings
  from functools import partial
  from typing import TYPE_CHECKING, Any, Callable
  import numpy
  import torch
  import torch.nn
  from torch.optim import Optimizer
  from torch.serialization import DEFAULT_PROTOCOL
  from torch.utils.data import DataLoader
  from monai.networks.utils import eval_mode
  from monai.optimizers.lr_scheduler import ExponentialLR, LinearLR
  from monai.utils import StateCacher, copy_to_device, optional_import
label_desc: Use image node_id 2 for calling a global function with example usage: default_label_extractor(x) and returns: out