code: def _prepare_labels(
      complete_pairs: List[Tuple],
      ground_truth_pairs: List[Tuple],
      retrieved_pairs: List[Tuple],
  ) -> Tuple[List, List]:
      """
      Given all possible unique pairs, ground truth positive pairs and retrieved positive pairs, generate true and
      predicted labels to feed into classification metrics functions.
      """
      ground_truth_pairs = set(ground_truth_pairs)
      retrieved_pairs = set(retrieved_pairs)
  
      y_true = [
          1 if i in ground_truth_pairs else 0 for i in complete_pairs
      ]
      y_pred = [
          1 if i in retrieved_pairs else 0 for i in complete_pairs
      ]
      return y_true, y_pred
  
file_path: imagededup/imagededup/handlers/metrics/classification.py
imports: import itertools
  from typing import Dict, List, Tuple
  import numpy
  from sklearn.metrics import classification_report, precision_score, recall_score, precision_recall_fscore_support
  from imagededup.utils.logger import return_logger
label_desc: Use image node_id 4 for calling a global function with example usage: _prepare_labels(complete_pairs, ground_truth_pairs, retrieved_pairs) and returns: y_true,  y_pred