code: def main():
      opt = setup_args()
      n_sel = opt["num_selected"]
      n_cont = opt["num_context"]
      dpath = opt["datapath"]
      for name in json.loads(opt["subreddit_list"]):
          data_split = json.load(
              open("pre_computed/%s_split_keys.json" % (name,))
          )
          qda_list = []
          slice_json = pjoin(
              dpath,
              "eli5/processed_data/selected_%d_%d/%s/selected_slice_*.json"
              % (n_sel, n_cont, name),
          )
          for f_name in glob(slice_json):
              qda_list += json.load(open(f_name))
          qda_dict = dict([(dct["id"], dct) for dct in qda_list])
          for spl in ["train", "valid", "test"]:
              split_list = [
                  qda_dict[k] for k in data_split[spl] if k in qda_dict
              ]
              selected_json = pjoin(
                  dpath,
                  "eli5/processed_data/selected_%d_%d/%s_%s.json"
                  % (n_sel, n_cont, name, spl),
              )
              json.dump(split_list, open(selected_json, "w"))
  
imports: import json
  from glob import glob
  from os.path import join
  from parlai.core.params import ParlaiParser
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types