code: def test_sn_naming_scheme(self):
      sn_name = "this_is_a_wacky_but_valid_name"
      linear_name = "so_is_this"
  
      def f():
          return basic.Linear(output_size=2, name=linear_name)(
              jnp.zeros([6, 6])
          )
  
      init_fn, _ = transform.transform(f)
      params = init_fn(random.PRNGKey(428))
  
      def g(x):
          return spectral_norm.SNParamsTree(
              ignore_regex=".*b", name=sn_name
          )(x)
  
      init_fn, _ = transform.transform_with_state(g)
      _, params_state = init_fn(random.PRNGKey(428), params)
  
      expected_sn_states = [
          f"{sn_name}/{linear_name}__{s}" for s in ["w"]
      ]
      self.assertSameElements(expected_sn_states, params_state.keys())
  
file_path: dm-haiku/haiku/_src/spectral_norm_test.py
imports: from absl.testing import absltest
  from haiku._src import basic
  from haiku._src import spectral_norm
  from haiku._src import test_utils
  from haiku._src import transform
  import jax.numpy
  import jax.random
  import numpy
label_desc: Use image node_id 1 for calling the SNParamsTreeTest obj's underlying member method code with example usage: obj.test_sn_naming_scheme() and returns: basic, spectral_norm