code: def setUp(self):
      super().setUp()
      self.metrics_for_slices = [
          text_format.Parse(
              """
          slice_key {
             single_slice_keys {
               column: "age"
               float_value: 38.0
             }
             single_slice_keys {
               column: "sex"
               bytes_value: "Female"
             }
           }
           metric_keys_and_values {
             key {
               name: "mean_absolute_error"
               example_weighted {
               }
             }
             value {
               double_value {
                 value: 0.1
               }
             }
           }
           metric_keys_and_values {
             key {
               name: "mean_squared_logarithmic_error"
               example_weighted {
               }
             }
             value {
               double_value {
               value: 0.02
               }
             }
           }
           """,
              metrics_for_slice_pb2.MetricsForSlice(),
          ),
          text_format.Parse(
              """
           slice_key {}
           metric_keys_and_values {
             key {
               name: "mean_absolute_error"
             }
             value {
               double_value {
                 value: 0.3
               }
             }
           }
           """,
              metrics_for_slice_pb2.MetricsForSlice(),
          ),
      ]
  
      self.metrics_overall_slice_only = [
          text_format.Parse(
              """
           slice_key {}
           metric_keys_and_values {
             key {
               name: "mean_absolute_error"
             }
             value {
               double_value {
                 value: 0.3
               }
             }
           }
           metric_keys_and_values {
             key {
               name: "example_count"
             }
             value {
               double_value {
                 value: 10
               }
             }
           }
           """,
              metrics_for_slice_pb2.MetricsForSlice(),
          )
      ]
  
imports: import dataclasses
  import numpy
  import pandas
  import tensorflow
  from tensorflow_model_analysis.experimental import dataframe
  from tensorflow_model_analysis.proto import metrics_for_slice_pb2
  from google.protobuf import text_format
label_desc: Use image node_id 1 for calling the MetricsAsDataFrameTest obj's underlying member method code with example usage: obj.setUp() without return types