code: def with_metadata(
      initializer: F,
      set_value_hooks: tp.Union[
          SetValueHook[A], tp.Sequence[SetValueHook[A]]
      ] = (),
      get_value_hooks: tp.Union[
          SetValueHook[A], tp.Sequence[SetValueHook[A]]
      ] = (),
      create_value_hooks: tp.Union[
          CreateValueHook[A], tp.Sequence[CreateValueHook[A]]
      ] = (),
      add_axis_hooks: tp.Union[
          AddAxisHook["Variable[A]"],
          tp.Sequence[AddAxisHook["Variable[A]"]],
      ] = (),
      remove_axis_hooks: tp.Union[
          RemoveAxisHook["Variable[A]"],
          tp.Sequence[RemoveAxisHook["Variable[A]"]],
      ] = (),
      **metadata: tp.Any,
  ) -> F:
      if set_value_hooks:
          if callable(set_value_hooks):
              set_value_hooks = (set_value_hooks,)
          else:
              set_value_hooks = tuple(set_value_hooks)
      else:
          set_value_hooks = ()
  
      if get_value_hooks:
          if callable(get_value_hooks):
              get_value_hooks = (get_value_hooks,)
          else:
              get_value_hooks = tuple(get_value_hooks)
      else:
          get_value_hooks = ()
  
      if create_value_hooks:
          if callable(create_value_hooks):
              create_value_hooks = (create_value_hooks,)
          else:
              create_value_hooks = tuple(create_value_hooks)
      else:
          create_value_hooks = ()
  
      if add_axis_hooks:
          if callable(add_axis_hooks):
              add_axis_hooks = (add_axis_hooks,)
          else:
              add_axis_hooks = tuple(add_axis_hooks)
      else:
          add_axis_hooks = ()
  
      if remove_axis_hooks:
          if callable(remove_axis_hooks):
              remove_axis_hooks = (remove_axis_hooks,)
          else:
              remove_axis_hooks = tuple(remove_axis_hooks)
      else:
          remove_axis_hooks = ()
  
      @functools.wraps(initializer)
      def wrapper(*args):
          return VariableMetadata(
              initializer(*args),
              set_value_hooks=set_value_hooks,
              get_value_hooks=get_value_hooks,
              create_value_hooks=create_value_hooks,
              add_axis_hooks=add_axis_hooks,
              remove_axis_hooks=remove_axis_hooks,
              metadata=metadata,
          )
  
      return wrapper
  
imports: import dataclasses
  import functools
  import typing
  from abc import ABCMeta
  from functools import partial
  from typing import Any
  import jax
  import jax.tree_util
  from flax.experimental.nnx.nnx import reprlib
label_desc: Use image node_id 3 for calling a global function with example usage: with_metadata(initializer, set_value_hooks, get_value_hooks, create_value_hooks, add_axis_hooks, remove_axis_hooks) and returns: wrapper, VariableMetadata