code: def testPlotKeyFromProto(self):
      plot_keys = [
          metric_types.PlotKey(name="plot_name"),
          metric_types.PlotKey(
              name="plot_name",
              model_name="model_name",
              output_name="output_name",
              sub_key=metric_types.SubKey(class_id=1),
          ),
          metric_types.MetricKey(
              name="plot_name",
              model_name="model_name",
              output_name="output_name",
              sub_key=metric_types.SubKey(top_k=2),
          ),
      ]
      for key in plot_keys:
          got_key = metric_types.PlotKey.from_proto(key.to_proto())
          self.assertEqual(
              key, got_key, "{} != {}".format(key, got_key)
          )
  
file_path: model-analysis/tensorflow_model_analysis/metrics/metric_types_test.py
imports: import tensorflow
  from tensorflow_model_analysis.metrics import metric_types
label_desc: Use image node_id 4 for calling the MetricTypesTest obj's underlying member method code with example usage: obj.testPlotKeyFromProto() without return types