code: def _canonicalize_axes(rank: int, axes: Axes) -> tp.Tuple[int, ...]:
      """Returns a tuple of deduplicated, sorted, and positive axes."""
      if not isinstance(axes, tp.Iterable):
          axes = (axes,)
      return tuple(
          set([rank + axis if axis < 0 else axis for axis in axes])
      )
  
file_path: flax/flax/experimental/nnx/nnx/nn/normalization.py
imports: import typing
  import jax
  import jax.numpy
  from jax import lax
  from flax.experimental import nnx
  from flax.experimental.nnx.nnx import flaglib, rnglib
  from flax.experimental.nnx.nnx.module import Module, first_from
  from flax.experimental.nnx.nnx.nn import dtypes, initializers
label_desc: Use image node_id 1 for calling a global function with example usage: _canonicalize_axes(rank, axes) and returns: tuple