code: def state_parser(self, state_str):
      result = []
      for line in state_str.split("\n"):
          # .*?(\d*)C.*\|(.*?)MiB.*?/(.*?)MiB.*?\|.*?(\d*)\%
          # .*?(\d*)C.*\|(.*?)MiB.*?/(.*?)MiB.*?\|.*?(\d*)%
          pattern = re.search(
              ".*?(\d*)C.*\|(.*?)MiB.*?/(.*?)MiB.*?\|.*?(\d*)%", line
          )
          if pattern is not None:
              result.append([int(x) for x in pattern.groups()])
      if self.gpuid >= len(result):
          return None
      # assert self.gpuid < len(result), 'Parsing error or not enough gpus.'
      return result[self.gpuid]
  
imports: from subprocess import Popen, PIPE
  from threading import Thread, Lock
  from queue import Queue
  from time import sleep
  from sys import stderr
  import re
  import json
label_desc: Use image node_id 2 for calling the GpuChecker obj's underlying member method code with example usage: obj.state_parser(state_str) and returns: result, None