code: def find_best_thresh(preds, scores, na_probs, qid_to_has_ans):
      num_no_ans = sum(
          1 for k in qid_to_has_ans if not qid_to_has_ans[k]
      )
      cur_score = num_no_ans
      best_score = cur_score
      best_thresh = 0.0
      qid_list = sorted(na_probs, key=lambda k: na_probs[k])
      for i, qid in enumerate(qid_list):
          if qid not in scores:
              continue
          if qid_to_has_ans[qid]:
              diff = scores[qid]
          else:
              if preds[qid]:
                  diff = -1
              else:
                  diff = 0
          cur_score += diff
          if cur_score > best_score:
              best_score = cur_score
              best_thresh = na_probs[qid]
      return 100.0 * best_score / len(scores), best_thresh
  
imports: import argparse
  import collections
  import json
  import numpy
  import os
  import re
  import string
  import sys
label_desc: Use image node_id 15 for calling a global function with example usage: find_best_thresh(preds, scores, na_probs, qid_to_has_ans) and returns: unknown,  best_thresh