code: def average_precision_score(
      conditions, prediction_scores, average="micro", sample_weight=None
  ):
      # average == [micro, macro, sampled, weidhted]
      return metrics.average_precision_score(
          conditions,
          prediction_scores,
          average=average,
          sample_weight=sample_weight,
      )
  
imports: import logging
  from collections import OrderedDict
  import numpy
  from sklearn import metrics
  from sklearn.metrics import confusion_matrix
label_desc: Use image node_id 4 for calling a global function with example usage: average_precision_score(conditions, prediction_scores, average, sample_weight) and returns: metrics