code: def testMapStructureWithNamedArgs(self):
      x = {
          "a": [1.0, 2.0, (3.0, 4.0)],
          "b": -4.0,
          "c": {"d": 10.0, "e": (0.0, 0.0)},
      }
      powers = {
          "a": [1.0, 1.0, (2.0, 3.0)],
          "b": 3.0,
          "c": {"d": 0.5, "e": (1.0, 1.0)},
      }
      coefs = {
          "a": [1.0, 1.0, (1.0, 1.0)],
          "b": -1.0,
          "c": {"d": 10.0, "e": (10.0, 10.0)},
      }
      intercepts = {
          "a": [-3.0, -6.0, (24.0, -19.0)],
          "b": 0.0,
          "c": {"d": 100.0, "e": (-3.0, -9.0)},
      }
      func = lambda x, power, coef, intercept: coef * (
          x**power + intercept
      )
      expected_result = tf.nest.map_structure(
          func, x, powers, coefs, intercepts
      )
  
      # Call with positional args.
      self.assertAllEqualNested(
          tf.nest.map_structure(func, x, powers, coefs, intercepts),
          nest_util.map_structure_with_named_args(
              func, x, powers, coefs, intercepts
          ),
      )
  
      # Call with named args only.
      self.assertAllEqualNested(
          expected_result,
          nest_util.map_structure_with_named_args(
              func, x=x, intercept=intercepts, coef=coefs, power=powers
          ),
      )
  
      # Call with both positional and named args.
      self.assertAllEqualNested(
          expected_result,
          nest_util.map_structure_with_named_args(
              func, x, powers, intercept=intercepts, coef=coefs
          ),
      )
  
      # Out-of-order arguments raise an error.
      with self.assertRaisesRegex(
          TypeError, "got multiple values for argument"
      ):
          nest_util.map_structure_with_named_args(
              func, powers, coefs, intercepts, x=x
          )
  
imports: import collections
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import deterministic
  from tensorflow_probability.python.distributions import half_cauchy
  from tensorflow_probability.python.distributions import joint_distribution_auto_batched
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.internal import nest_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow.python.util import nest
label_desc: Use image node_id 2 for calling the NestUtilTest obj's underlying member method code with example usage: obj.testMapStructureWithNamedArgs() without return types