code: def test_results_to_proto(self):
      results = [
          {
              "cav_key": "c1-c2-b-model-0.1",
              "cav_concept": "c1",
              "negative_concept": "c2",
              "target_class": 0,
              "cav_accuracies": {
                  "c1": 0.526,
                  "c2": 0.414,
                  "overall": 0.47,
              },
              "i_up": 0.342,
              "val_directional_dirs_abs_mean": 0.25,
              "val_directional_dirs_mean": 0.25,
              "val_directional_dirs_std": 0.144,
              "val_directional_dirs": [0, 0.25, 0.5],
              "note": "alpha_" + str(0.1),
              "alpha": 0.1,
              "bottleneck": "b",
          }
      ]
  
      result_proto = Result()
      result_proto.cav_key = "c1-c2-b-model-0.1"
      result_proto.cav_concept = "c1"
      result_proto.negative_concept = "c2"
      result_proto.target_class = 0
      result_proto.i_up = 0.342
      result_proto.val_directional_dirs_abs_mean = 0.25
      result_proto.val_directional_dirs_mean = 0.25
      result_proto.val_directional_dirs_std = 0.144
      for val in [0, 0.25, 0.5]:
          result_proto.val_directional_dirs.append(val)
      result_proto.note = "alpha_" + str(0.1)
      result_proto.alpha = 0.1
      result_proto.bottleneck = "b"
      result_proto.cav_accuracies.positive_set_accuracy = 0.526
      result_proto.cav_accuracies.negative_set_accuracy = 0.414
      result_proto.cav_accuracies.overall_accuracy = 0.47
      results_proto = Results()
      results_proto.results.append(result_proto)
  
      self.assertEqual(results_proto, results_to_proto(results))
  
file_path: tcav/tcav/utils_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensorflow.python.platform import googletest
  from tcav.tcav_results.results_pb2 import Result, Results
  from tcav.utils import flatten, process_what_to_run_expand, process_what_to_run_concepts, process_what_to_run_randoms, results_to_proto
label_desc: Use image node_id 7 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_results_to_proto() without return types