code: def _at_task_boundary(training_experience, before=True) -> bool:
      """
      Given a training experience,
      returns true if the experience is at the task boundary
  
      More specifically:
  
      - If task boundary is not available, returns True
  
      - If task boundary is available,
        returns True if the experience
        is the first subexp
  
      - If the experience is not an online experience, returns True
  
      :param before: If used in before_training_exp,
                     set to True, otherwise set
                     to False
  
      """
  
      if isinstance(training_experience, OnlineCLExperience):
          if training_experience.access_task_boundaries:
              if before and training_experience.is_first_subexp:
                  return True
              elif (not before) and training_experience.is_last_subexp:
                  return True
          else:
              return True
      else:
          return True
  
imports: from collections import defaultdict
  from typing import Callable, Dict, List, NamedTuple, Optional, Tuple, Union
  import torch
  from torch import Tensor
  from torch.nn import Linear, Module
  from torch.utils.data import DataLoader, Dataset
  from avalanche.benchmarks import OnlineCLExperience
  from avalanche.models.batch_renorm import BatchRenorm2D
label_desc: Use image node_id 1 for calling a global function with example usage: _at_task_boundary(training_experience, before) and returns: True, True, True, True