code: def test_tree_noise_restart(self):
      sample_num, tolerance, stddev = 1000, 0.3, 0.1
      initial_estimate, expected_num_records = 5.0, 2.0
      record1 = tf.constant(1.0)
      record2 = tf.constant(10.0)
  
      query = _make_quantile_estimator_query(
          initial_estimate=initial_estimate,
          target_quantile=0.5,
          learning_rate=1.0,
          below_estimate_stddev=stddev,
          expected_num_records=expected_num_records,
          geometric_update=False,
          tree_aggregation=True,
      )
  
      global_state = query.initial_global_state()
  
      self.assertAllClose(
          global_state.current_estimate, initial_estimate
      )
  
      # As the target quantile is accurate, there is no signal and only noise.
      samples = []
      for _ in range(sample_num):
          noised_estimate, global_state = test_utils.run_query(
              query, [record1, record2], global_state
          )
          samples.append(noised_estimate.numpy())
          global_state = query.reset_state(
              noised_estimate, global_state
          )
          self.assertNotEqual(
              global_state.current_estimate, initial_estimate
          )
          global_state = global_state._replace(
              current_estimate=initial_estimate
          )
  
      self.assertAllClose(
          np.std(samples), stddev / expected_num_records, rtol=tolerance
      )
  
file_path: privacy/tensorflow_privacy/privacy/dp_query/quantile_estimator_query_test.py
imports: from absl.testing import parameterized
  import numpy
  import tensorflow
  from tensorflow_privacy.privacy.dp_query import quantile_estimator_query
  from tensorflow_privacy.privacy.dp_query import test_utils
label_desc: Use image node_id 8 for calling the QuantileEstimatorQueryTest obj's underlying member method code with example usage: obj.test_tree_noise_restart() without return types