code: def images_samples_metrics(
      *,
      n_rows: int = 8,
      n_cols: int = 8,
      group: bool = True,
      on_train: bool = True,
      on_eval: bool = False,
  ) -> List[ImagesSamplePlugin]:
      """
      Create the plugins to log some images samples in grids.
      No data augmentation is shown.
      Only images in strategy.adapted dataset are used. Images added in the
      dataloader (like the replay plugins do) are missed.
  
      :param n_rows: The numbers of raws to use in the grid of images.
      :param n_cols: The numbers of columns to use in the grid of images.
      :param group: If True, images will be grouped by (task, label)
      :param on_train: If True, will emit some images samples during training.
      :param on_eval: If True, will emit some images samples during evaluation.
      :return: The corresponding plugins.
      """
      plugins: List[ImagesSamplePlugin] = []
      if on_eval:
          plugins.append(
              ImagesSamplePlugin(
                  mode="eval", n_rows=n_rows, n_cols=n_cols, group=group
              )
          )
      if on_train:
          plugins.append(
              ImagesSamplePlugin(
                  mode="train",
                  n_rows=n_rows,
                  n_cols=n_cols,
                  group=group,
              )
          )
      return plugins
  
imports: from typing import List, TYPE_CHECKING, Tuple
  from torch import Tensor
  from torch.utils.data import DataLoader
  from torchvision.transforms import ToTensor
  from torchvision.utils import make_grid
  from avalanche.benchmarks.utils.data import AvalancheDataset
  from avalanche.evaluation.metric_definitions import PluginMetric
  from avalanche.evaluation.metric_results import MetricResult, TensorImage, MetricValue
  from avalanche.evaluation.metric_utils import get_metric_name
  from typing_extensions import Literal
label_desc: Use image node_id 1 for calling a global function with example usage: images_samples_metrics() and returns: plugins