code: def test_disallows_variables_in_apply(self):
      _, apply_fn = hk.transform(lambda: tf.Variable(1))
      with self.assertRaisesRegex(
          ValueError, "Apply function cannot create new variables"
      ):
          apply_fn({})
  
imports: from absl.testing import parameterized
  import sonnet
  from sonnet.src import test_utils
  from sonnet.src.functional import haiku
  import tensorflow
  import tree
label_desc: Use image node_id 4 for calling the NetworkTest obj's underlying member method code with example usage: obj.test_disallows_variables_in_apply() without return types