class_docstr: Test class with extra methods for unit-testing TFMA models / metrics.
class_docstr_tok: ["Test","class","with","extra","methods","for","unit-testing","TFMA","models","\/","metrics","."]
docstr: Checks the elements for two dictionaries.
  
  It asserts all values in `expected_values_dict` are close to values with the
  same key in `got_values_dict`.
  
  Args:
    got_values_dict: The actual dictionary.
    expected_values_dict: The expected dictionary. The values in can be either
      `BoundedValue` or any type accepted by
      `tf.test.TestCase.assertAllClose()`. When the type is `BoundedValue`, it
      expects the corresponding value from `got_values_dict` falls into the
      boundaries provided in the `BoundedValue`.
docstr_tok: ["Checks","the","elements","for","two","dictionaries",".","It","asserts","all","values","in","`","expected_values_dict","`","are","close","to","values","with","the","same","key","in","`","got_values_dict","`",".","Args",":","got_values_dict",":","The","actual","dictionary",".","expected_values_dict",":","The","expected","dictionary",".","The","values","in","can","be","either","`","BoundedValue","`","or","any","type","accepted","by","`","tf.test.TestCase.assertAllClose","(",")","`",".","When","the","type","is","`","BoundedValue","`",",","it","expects","the","corresponding","value","from","`","got_values_dict","`","falls","into","the","boundaries","provided","in","the","`","BoundedValue","`","."]
code: def assertDictElementsWithinBounds(
      self,
      got_values_dict: Dict[str, Any],
      expected_values_dict: Dict[str, Any],
  ):
      """Checks the elements for two dictionaries.
  
      It asserts all values in `expected_values_dict` are close to values with the
      same key in `got_values_dict`.
  
      Args:
        got_values_dict: The actual dictionary.
        expected_values_dict: The expected dictionary. The values in can be either
          `BoundedValue` or any type accepted by
          `tf.test.TestCase.assertAllClose()`. When the type is `BoundedValue`, it
          expects the corresponding value from `got_values_dict` falls into the
          boundaries provided in the `BoundedValue`.
      """
      for key, value in expected_values_dict.items():
          self.assertIn(key, got_values_dict)
          got_value = got_values_dict[key]
          if isinstance(value, BoundedValue):
              if (
                  got_value < value.lower_bound
                  or got_value > value.upper_bound
              ):
                  self.fail(
                      "expecting key %s to have value between %f and %f "
                      "(both ends inclusive), but value was %f instead"
                      % (
                          key,
                          value.lower_bound,
                          value.upper_bound,
                          got_value,
                      )
                  )
          else:
              self.assertAllClose(
                  got_value, value, msg="key = %s" % key
              )
  
imports: from typing import Any, Dict, List, Optional
  import apache_beam
  from apache_beam.testing import util
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import model_eval_lib
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_saved_model import load
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.evaluators import legacy_metrics_and_plots_evaluator
  from tensorflow_model_analysis.extractors import extractor
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.slicer import slicer_lib
  from tfx_bsl.tfxio import raw_tf_record
label_desc: Use image node_id 2 for calling the TestCase obj's underlying member method code with example usage: obj.assertDictElementsWithinBounds(got_values_dict, expected_values_dict) without return types