code: def testTypeSpecNest(self):
      vals = (
          constant_op.constant(1.0),
          constant_op.constant([5.0, 6.0]),
      )
      per_replica = values_lib.PerReplica(vals)
  
      # Note: nest.map_structure exercises nest.flatten and
      # nest.pack_sequence_as.
      result = nest.map_structure(
          lambda t: t + 10, per_replica, expand_composites=True
      )
  
      self.assertLen(result.values, 2)
      self.assertAllEqual(result.values[0], 11.0)
      self.assertAllEqual(result.values[1], [15.0, 16.0])
  
imports: from absl.testing import parameterized
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import test_util
  from tensorflow.python.distribute import values
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import cond
  from tensorflow.python.util import nest
label_desc: Use image node_id 3 for calling the PerReplicaTest obj's underlying member method code with example usage: obj.testTypeSpecNest() without return types