code: def RegenerateJsonByDataset(data):
      new_data = {}
      new_data["dataset"] = {}
      for i in range(len(dataset_list)):
          new_data["dataset"][dataset_list[i]] = []
      for mo in data["models"]:
          ds = mo["dataset"]
          item = {}
          item["name"] = mo["name"]
          item["framework"] = mo["framework"]
          item["source"] = mo["source"]
          item["link"] = mo["link"]
          item["version"] = ""
          new_data["dataset"][ds].append(item)
  
      # with open('modelmapbydataset.json', 'w') as outfile:
      #     json.dump(new_data, outfile)
      return new_data
  
file_path: MMdnn/mmdnn/models/GenerateMdByDataset.py
imports: import json
  import os
  import argparse
label_desc: Use image node_id 6 for calling a global function with example usage: RegenerateJsonByDataset(data) and returns: new_data