code: def _get_add_noise(stddev, seed: Optional[int] = None):
      """Utility function to decide which `add_noise` to use according to tf version."""
      if distutils.version.LooseVersion(
          tf.__version__
      ) < distutils.version.LooseVersion("2.0.0"):
          # The seed should be only used for testing purpose.
          if seed is not None:
              tf.random.set_seed(seed)
  
          def add_noise(v):
              return v + tf.random.normal(
                  tf.shape(input=v), stddev=stddev, dtype=v.dtype
              )
  
      else:
          random_normal = tf.random_normal_initializer(
              stddev=stddev, seed=seed
          )
  
          def add_noise(v):
              return v + tf.cast(
                  random_normal(tf.shape(input=v)), dtype=v.dtype
              )
  
      return add_noise
  
file_path: privacy/tensorflow_privacy/privacy/dp_query/tree_range_query.py
imports: import distutils
  import math
  from typing import Any, NamedTuple, Optional
  import dp_accounting
  import tensorflow
  from tensorflow_privacy.privacy.dp_query import distributed_discrete_gaussian_query
  from tensorflow_privacy.privacy.dp_query import dp_query
  from tensorflow_privacy.privacy.dp_query import gaussian_query
label_desc: Use image node_id 2 for calling a global function with example usage: _get_add_noise(stddev, seed) and returns: add_noise, unknown, unknown