code: def test_scalar_tree_aggregation_reset(
      self, scalar_value, tree_node_value, frequency
  ):
      total_steps = 20
      query = tree_aggregation_query.TreeResidualSumQuery(
          clip_fn=_get_l2_clip_fn(),
          clip_value=scalar_value + 1.0,  # no clip
          noise_generator=lambda: tree_node_value,
          record_specs=tf.TensorSpec([]),
          use_efficient=False,
      )
      global_state = query.initial_global_state()
      params = query.derive_sample_params(global_state)
      for i in range(total_steps):
          sample_state = query.initial_sample_state(scalar_value)
          sample_state = query.accumulate_record(
              params, sample_state, scalar_value
          )
          query_result, global_state, _ = query.get_noised_result(
              sample_state, global_state
          )
          if i % frequency == frequency - 1:
              global_state = query.reset_state(
                  query_result, global_state
              )
          # Expected value is the signal of the current round plus the residual of
          # two continous tree aggregation values. The tree aggregation value can
          # be inferred from the binary representation of the current step.
          expected = scalar_value + tree_node_value * (
              bin(i % frequency + 1)[2:].count("1")
              - bin(i % frequency)[2:].count("1")
          )
          print(i, query_result, expected)
          self.assertEqual(query_result, expected)
  
imports: from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_privacy.privacy.dp_query import test_utils
  from tensorflow_privacy.privacy.dp_query import tree_aggregation
  from tensorflow_privacy.privacy.dp_query import tree_aggregation_query
label_desc: Use image node_id 4 for calling the TreeResidualQueryTest obj's underlying member method code with example usage: obj.test_scalar_tree_aggregation_reset(scalar_value, tree_node_value, frequency) without return types