code: def test_unit_ball_L_inf(shape, precondition, eps=1e-6):
      """Tests that a L infinity unit ball variables' stay roughly within 1.0.
      Note: only holds down to eps ~= 5e-7.
      """
      with tf.Session() as sess:
          unit_ball = unit_ball_L_inf(shape, precondition=precondition)
          unit_ball_max = tf.reduce_max(unit_ball)
          optimizer = tf.train.GradientDescentOptimizer(learning_rate)
          objective = optimizer.minimize(-unit_ball)
          tf.global_variables_initializer().run()
          for i in range(num_steps):
              _, unit_ball_max_value, unit_ball_value = sess.run(
                  [objective, unit_ball_max, unit_ball]
              )
              log.info(
                  "Linf: %s, Value: %s",
                  unit_ball_max_value,
                  unit_ball_value,
              )
              assert unit_ball_max_value <= 1.0 + eps
  
imports: from __future__ import absolute_import, division, print_function
  import pytest
  import tensorflow
  import logging
  from lucid.optvis.param.unit_balls import unit_ball_L2, unit_ball_L_inf
label_desc: Use image node_id 2 for calling a global function with example usage: test_unit_ball_L_inf(shape, precondition, eps) without return types