code: def _get_noise_fn(specs, stddev=NOISE_STD, seed=1):
      random_generator = tf.random.Generator.from_seed(seed)
  
      def noise_fn():
          shape = tf.nest.map_structure(lambda spec: spec.shape, specs)
          return tf.nest.map_structure(
              lambda x: random_generator.normal(x, stddev=stddev), shape
          )
  
      return noise_fn
  
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 2 for calling a global function with example usage: _get_noise_fn(specs, stddev, seed) and returns: noise_fn, tf