code: def _extract_answer(self, completion):
      matches = ANS_RE.findall(completion)
      if matches:
          match_str = matches[-1].strip(".")
          match_str = match_str.replace(",", "")
          try:
              match_float = float(match_str)
          except ValueError:
              return INVALID_ANS
          if match_float.is_integer():
              return int(match_float)
  
      return INVALID_ANS
  
imports: import os
  from lm_eval.base import rf
  from lm_eval.tasks.gsm8k import GradeSchoolMath8K, INVALID_ANS
  import re
  import inspect
label_desc: Use image node_id 6 for calling the MGSM obj's underlying member method code with example usage: obj._extract_answer(completion) and returns: INVALID_ANS, int, INVALID_ANS