code: def toxicity(preds, toxic_classifier, toxic_label):
      toxic_scores = []
      if (
          toxic_label
          not in toxic_classifier.model.config.id2label.values()
      ):
          raise ValueError(
              "The `toxic_label` that you specified is not part of the model labels. Run `model.config.id2label` to see what labels your model outputs."
          )
  
      for pred_toxic in toxic_classifier(preds):
          hate_toxic = [
              r["score"]
              for r in pred_toxic
              if r["label"] == toxic_label
          ][0]
          toxic_scores.append(hate_toxic)
      return toxic_scores
  
file_path: evaluate/measurements/toxicity/toxicity.py
imports: import datasets
  from transformers import pipeline
  import evaluate
label_desc: Use image node_id 1 for calling a global function with example usage: toxicity(preds, toxic_classifier, toxic_label) and returns: toxic_scores