class_docstr: Tuple Metric 
code: def count_instance(self, gold_list, pred_list):
      if self.match_mode == "set":
          gold_list = set(gold_list)
          pred_list = set(pred_list)
          if self.verbose:
              print("Gold:", gold_list)
              print("Pred:", pred_list)
          self.gold_num += len(gold_list)
          self.pred_num += len(pred_list)
          self.tp += len(gold_list & pred_list)
  
      else:
          if self.verbose:
              print("Gold:", gold_list)
              print("Pred:", pred_list)
          self.gold_num += len(gold_list)
          self.pred_num += len(pred_list)
  
          if len(gold_list) > 0 and len(pred_list) > 0:
              # guarantee length same
              assert len(gold_list[0]) == len(pred_list[0])
  
          dup_gold_list = deepcopy(gold_list)
          for pred in pred_list:
              if pred in dup_gold_list:
                  self.tp += 1
                  if self.match_mode == "normal":
                      # Each Gold Instance can be matched one time
                      dup_gold_list.remove(pred)
  
imports: from collections import defaultdict
  from copy import deepcopy
  from typing import Dict, List
  import sys
label_desc: Use image node_id 5 for calling the Metric obj's underlying member method code with example usage: obj.count_instance(gold_list, pred_list) without return types