code: def phase_and_task(strategy: "SupervisedTemplate") -> Tuple[str, int]:
      """
      Returns the current phase name and the associated task label.
  
      The current task label depends on the phase. During the training
      phase, the task label is the one defined in the "train_task_label"
      field. On the contrary, during the eval phase the task label is the one
      defined in the "eval_task_label" field.
  
      :param strategy: The strategy instance to get the task label from.
      :return: The current phase name as either "Train" or "Task" and the
          associated task label.
      """
      task_labels = getattr(strategy.experience, "task_labels", None)
      if task_labels is not None:
          task = task_labels
          if len(task) > 1:
              task = None  # task labels per patterns
          else:
              task = task[0]
      else:
          task = None
  
      if strategy.is_eval:
          return EVAL, task
      else:
          return TRAIN, task
  
file_path: avalanche/avalanche/evaluation/metric_utils.py
imports: from typing import Dict, Optional, Union, Iterable, Sequence, Tuple, TYPE_CHECKING, List, Callable, Any
  import matplotlib.pyplot
  import numpy
  from matplotlib.axes import Axes
  from numpy import ndarray, arange
  from torch import Tensor
label_desc: Use image node_id 6 for calling a global function with example usage: phase_and_task(strategy) and returns: EVAL,  task, TRAIN,  task