code: def testParametersFromDictMissingNestedDictKeyFailure(self):
      one = tf.constant(1.0)
      d = tfp.distributions.Normal(
          loc=one, scale=3.0, validate_args=True
      )
      d = tfp.bijectors.Tanh()(d)
      d = tfp.bijectors.Tanh()(d)
      p = utils.get_parameters(d)
      p_dict = utils.parameters_to_dict(p)
  
      # Remove a non-nested key in the dictionary; this is fine.
      del p_dict["distribution"]["validate_args"]
  
      # We can reconstruct from this (we just use the default value from p)
      utils.merge_to_parameters_from_dict(p, p_dict)
  
      # Remove a nested entry in the dictionary; this can lead to subtle errors so
      # we don't allow it.
      del p_dict["bijector"]["bijectors:1"]
  
      # Flattening nested params lost information about the nested structure, so
      # we can't e.g. remove a bijector from a list and override just a subset of
      # the nested bijectors list.
      with self.assertRaisesRegex(
          KeyError,
          r"Only saw partial information from the dictionary for nested key "
          r"\'bijectors\' in params_dict.*"
          r"Entries provided: \[\'bijectors:0\'\].*"
          r"Entries required: \[\'bijectors:0\', \'bijectors:1\'\]",
      ):
          utils.merge_to_parameters_from_dict(p, p_dict)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  import numpy
  import tensorflow
  import tensorflow_probability
  from tf_agents.distributions import utils
  from tf_agents.specs import tensor_spec
label_desc: Use image node_id 9 for calling the UtilsTest obj's underlying member method code with example usage: obj.testParametersFromDictMissingNestedDictKeyFailure() without return types