code: def test_tree_sum_last_step_expected(
      self, total_steps, expected_value, step_value
  ):
      # Test whether `tree_aggregator` will output `expected_value` after
      # `total_steps` of leaf nodes are traversed. The value of each tree node
      # is a constant `node_value` for test purpose. Note that `node_value`
      # denotes the "noise" without private values in private algorithms. The
      # `expected_value` is based on a weighting schema strongly depends on the
      # depth of the binary tree.
      tree_aggregator = tree_aggregation.EfficientTreeAggregator(
          value_generator=ConstantValueGenerator(step_value)
      )
      state = tree_aggregator.init_state()
      for leaf_node_idx in range(total_steps):
          self.assertEqual(
              leaf_node_idx, tree_aggregation.get_step_idx(state)
          )
          val, state = tree_aggregator.get_cumsum_and_update(state)
      self.assertAllClose(expected_value, val)
  
imports: import math
  import random
  from absl.testing import parameterized
  import tensorflow
  from tensorflow_privacy.privacy.dp_query import tree_aggregation
label_desc: Use image node_id 1 for calling the EfficientTreeAggregatorTest obj's underlying member method code with example usage: obj.test_tree_sum_last_step_expected(total_steps, expected_value, step_value) without return types