code: def find_result_taskmodel_json(
      task, task_jsons: list, models: list, number_of_shots: list
  ):
      model_jsons = {
          model: {shot: [] for shot in number_of_shots}
          for model in models
      }
  
      if task_jsons != []:
          for model in models:
              model_found = False
              for i, file_name in enumerate(task_jsons):
                  for si, number_of_shot in enumerate(number_of_shots):
                      if (
                          file_name.endswith("metrics.jsonl")
                          and model in file_name
                          and f"{number_of_shot}_shot" in file_name
                      ):
                          model_found = True
                          model_jsons[model][number_of_shot].append(
                              file_name
                          )
              if not model_found:
                  warnings.warn(
                      f"Result of model '{model}' not found in the {task} subset."
                  )
  
      assert len(models) == len(model_jsons.keys())
  
      return model_jsons
  
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 8 for calling a global function with example usage: find_result_taskmodel_json(task, task_jsons, models, number_of_shots) and returns: model_jsons