def METHOD_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 = {}
    lines = open(log_path, 'r').read().splitlines()
    if 'python_infer' in log_path:  # parse python inference
        for line in lines:
            split_items = line.replace('\t', ' ')
            split_items = split_items.split(' ')
            split_items = [item for item in split_items if len(item) > 0]
            for name in names_list:
                if name in line:
                    if '.' in split_items[-1]:
                        parser_results[name] = float(split_items[-1])
                    else:
                        parser_results[name] = int(split_items[-1])
    else:  # parse cpp inference
        for line in lines:
            split_items = line.replace('\t', ' ')
            split_items = split_items.split(' ')
            split_items = [item for item in split_items if len(item) > 0]
            if all([(name + ':') in split_items for name in names_list]):
                # print(split_items)
                parser_results['class'] = int(split_items[2])
                parser_results['score'] = float(split_items[-1])
    return parser_results