code: def winogrande_jsonl_iterator(input_fname, eval=False):
      with open(input_fname) as fin:
          for line in fin:
              sample = json.loads(line.strip())
              sentence, option1, option2 = (
                  sample["sentence"],
                  sample["option1"],
                  sample["option2"],
              )
  
              pronoun_span = (
                  sentence.index("_"),
                  sentence.index("_") + 1,
              )
  
              if eval:
                  query, cand = option1, option2
              else:
                  query = (
                      option1 if sample["answer"] == "1" else option2
                  )
                  cand = option2 if sample["answer"] == "1" else option1
              yield sentence, pronoun_span, query, cand
  
file_path: fairseq/examples/roberta/wsc/wsc_utils.py
imports: import json
  from functools import lru_cache
label_desc: Use image node_id 8 for calling a global function with example usage: winogrande_jsonl_iterator(input_fname, eval) without return types