code: def calculate_and_print_differences(predictions, actuals, name=None):
      pos_differences = []
      neg_differences = []
      # Technically, we're ignoring cases where we are spot on
      for idx, pred in enumerate(predictions):
          difference = pred - actuals[idx]
          if difference > 0:
              pos_differences.append(difference)
          elif difference < 0:
              neg_differences.append(difference)
  
      if name != None:
          print(name)
      print("Count of positive differences (prediction > actual):")
      print(len(pos_differences))
      print("Count of negative differences:")
      print(len(neg_differences))
      if len(pos_differences) > 0:
          print("Average positive difference:")
          print(sum(pos_differences) * 1.0 / len(pos_differences))
      if len(neg_differences) > 0:
          print("Average negative difference:")
          print(sum(neg_differences) * 1.0 / len(neg_differences))
  
imports: from collections import OrderedDict
  import math
  from auto_ml import utils
  import pandas
  from sklearn.ensemble import GradientBoostingRegressor, GradientBoostingClassifier
  from sklearn.metrics import mean_squared_error, make_scorer, brier_score_loss, accuracy_score, explained_variance_score, mean_absolute_error, median_absolute_error, r2_score, log_loss, roc_auc_score
  import numpy
  from tabulate import tabulate
label_desc: Use image node_id 2 for calling a global function with example usage: calculate_and_print_differences(predictions, actuals, name) without return types