code: def load_reference_from_stream(f):
      """Load Reference reference relevant passages
      Args:f (stream): stream to load.
      Returns:qids_to_relevant_passageids (dict): dictionary mapping from query_id (int) to relevant passages (list of ints).
      """
      qids_to_relevant_passageids = {}
      for l in f:
          try:
              l = l.strip().split("\t")
              qid = int(l[0])
              if qid in qids_to_relevant_passageids:
                  pass
              else:
                  qids_to_relevant_passageids[qid] = []
              qids_to_relevant_passageids[qid].append(int(l[2]))
          except:
              raise IOError('"%s" is not valid format' % l)
      return qids_to_relevant_passageids
  
file_path: FARM/farm/evaluation/msmarco_passage_official.py
imports: import sys
  import statistics
  from collections import Counter
label_desc: Use image node_id 1 for calling a global function with example usage: load_reference_from_stream(f) and returns: qids_to_relevant_passageids