code: def f1_macro(preds, labels):
      return {
          "f1_macro": f1_score(
              y_true=labels, y_pred=preds, average="macro"
          )
      }
  
imports: import logging
  import numpy
  import torch
  from functools import reduce
  from scipy.stats import pearsonr, spearmanr
  from seqeval.metrics import classification_report
  from seqeval.metrics import f1_score
  from sklearn.metrics import matthews_corrcoef, f1_score, mean_squared_error, r2_score, classification_report
  from farm.utils import flatten_list
label_desc: Use image node_id 5 for calling a global function with example usage: f1_macro(preds, labels) and returns: dict