docstr: Reformat this task's raw predictions to have the structure expected
  by SuperGLUE.
docstr_tok: ["Reformat","this","task","'s","raw","predictions","to","have","the","structure","expected","by","SuperGLUE","."]
code: def super_glue_format_preds(pred_dict):
      """Reformat this task's raw predictions to have the structure expected
      by SuperGLUE.
      """
      lines = []
      # formatting code adapted from: https://github.com/nyu-mll/jiant/blob/
      # 14fae87d2ebc5a45dbe7254e9007d1a148dd6b18/jiant/evaluate.py#L427
      par_qst_ans_d = collections.defaultdict(
          lambda: collections.defaultdict(list)
      )
      for pred, guid in zip(
          list(pred_dict["preds"]), list(pred_dict["guids"])
      ):
          passage_id, question_id, answer_id = [
              int(i) for i in guid.split("-")[1:]
          ]
          ans_d = {"idx": answer_id, "label": int(pred)}
          par_qst_ans_d[passage_id][question_id].append(ans_d)
      for par_idx, qst_ans_d in par_qst_ans_d.items():
          qst_ds = []
          for qst_idx, answers in qst_ans_d.items():
              qst_d = {"idx": qst_idx, "answers": answers}
              qst_ds.append(qst_d)
          out_d = {"idx": par_idx, "passage": {"questions": qst_ds}}
          lines.append(out_d)
      return lines
  
imports: import collections
  import numpy
  import torch
  from dataclasses import dataclass
  from typing import List
  from jiant.tasks.core import BaseExample, BaseTokenizedExample, BaseDataRow, BatchMixin, SuperGlueMixin, Task, TaskTypes
  from jiant.tasks.lib.templates.shared import labels_to_bimap, add_cls_token, create_input_set_from_tokens_and_segments
  from jiant.tasks.utils import truncate_sequences
  from jiant.utils.python.io import read_json_lines
label_desc: Use image node_id 6 for calling the MultiRCTask obj's underlying member method code with example usage: obj.super_glue_format_preds(pred_dict) and returns: lines