code: def avalanche_forward(model, x, task_labels):
      if is_multi_task_module(model):
          return model(x, task_labels)
      else:  # no task labels
          return model(x)
  
imports: from avalanche.benchmarks.utils import _make_taskaware_classification_dataset
  from avalanche.models.dynamic_modules import MultiTaskModule, DynamicModule
  import torch.nn
  from torch.nn.parallel import DistributedDataParallel
  from collections import OrderedDict
  from avalanche.benchmarks.scenarios import CLExperience
label_desc: Use image node_id 2 for calling a global function with example usage: avalanche_forward(model, x, task_labels) and returns: model, model