code: def norm(x, scope, *, axis=-1, epsilon=1e-5):
      """Normalize to mean = 0, std = 1, then do a diagonal affine transform."""
      with tf.compat.v1.variable_scope(scope):
          n_state = get_value(x.shape[-1])
          g = tf.compat.v1.get_variable(
              "g",
              [n_state],
              initializer=tf.compat.v1.constant_initializer(1),
          )
          b = tf.compat.v1.get_variable(
              "b",
              [n_state],
              initializer=tf.compat.v1.constant_initializer(0),
          )
          u = tf.reduce_mean(input_tensor=x, axis=axis, keepdims=True)
          s = tf.reduce_mean(
              input_tensor=tf.square(x - u), axis=axis, keepdims=True
          )
          x = (x - u) * tf.math.rsqrt(s + epsilon)
          x = x * g + b
          return x
  
imports: import numpy
  import tensorflow
label_desc: Use image node_id 5 for calling a global function with example usage: norm(x, scope) and returns: x