code: def retrieve_and_write_repo(
      file_to_save: str,
      repo_dir: list,
      models: list,
      tasks: list,
      number_of_shots: list = [3],
  ):
      task_dirs, _ = find_repo_task_dir(repo_dir, tasks)
      normalized_scores = {task: [] for task in tasks}
      task_metric_metainfos = {task: [] for task in tasks}
      for task_dir, task in zip(task_dirs, tasks):
          model_jsons, task_metric_meta = find_repo_task_model_json(
              task_dir, models
          )
          normalized_scores[task] = compute_scores_repo(
              models, model_jsons, number_of_shots
          )
          task_metric_metainfos[task] = task_metric_meta
  
      def custom_sort_key(item):
          return tasks.index(item[0])
  
      normalized_scores = dict(
          sorted(normalized_scores.items(), key=custom_sort_key)
      )
      Header = [["model"] + tasks]
      score_mat = [models] + [
          inner_dict.values()
          for outer_key, inner_dict in normalized_scores.items()
      ]
      df1 = pd.DataFrame(Header)
      df2 = pd.DataFrame(score_mat).transpose()
      df = pd.concat([df1, df2], ignore_index=True)
      df.to_csv(file_to_save, header=False, index=False)
      return df, task_metric_metainfos
  
file_path: open-moe/eval/result_retrieval_bigbenchlite.py
imports: import json
  import subprocess
  import os
  import logging
  import sys
  import warnings
  import pandas
label_desc: Use image node_id 6 for calling a global function with example usage: retrieve_and_write_repo(file_to_save, repo_dir, models, tasks, number_of_shots) and returns: df,  task_metric_metainfos, tasks