code: def _expand_duplicate_retrieved_docs(predictions, targets):
      counter = {}
      expanded_predictions = []
      expanded_targets = targets
      for doc_id in predictions:
          if doc_id not in counter:
              counter[doc_id] = 1
              expanded_predictions.append(doc_id)
          else:
              counter[doc_id] += 1
              new_doc_id = f"{doc_id}_bc574ae_{counter[doc_id]}"  # adding a random string to avoid collisions
              expanded_predictions.append(new_doc_id)
              expanded_targets.add(new_doc_id)
      return expanded_predictions, expanded_targets
  
imports: import functools
  import logging
  import os
  import numpy
  from mlflow.metrics.base import MetricValue, standard_aggregations
label_desc: Use image node_id 24 for calling a global function with example usage: _expand_duplicate_retrieved_docs(predictions, targets) and returns: expanded_predictions,  expanded_targets