code: def parser_results_from_log_by_name(log_path, names_list):
      if not os.path.exists(log_path):
          raise ValueError(
              "The log file {} does not exists!".format(log_path)
          )
  
      if names_list is None or len(names_list) < 1:
          return []
  
      parser_results = {}
      for name in names_list:
          cmd = "grep {} {}".format(name, log_path)
          outs = run_shell_command(cmd)
          outs = outs.split("\n")[0]
          result = outs.split("{}".format(name))[-1]
          try:
              result = json.loads(result)
          except:
              result = np.array(
                  [int(r) for r in result.split()]
              ).reshape(-1, 4)
          parser_results[name] = result
      return parser_results
  
file_path: PaddleDetection/test_tipc/compare_results.py
imports: import numpy
  import os
  import subprocess
  import json
  import argparse
  import glob
label_desc: Use image node_id 4 for calling a global function with example usage: parser_results_from_log_by_name(log_path, names_list) and returns: parser_results, list