code: def _canonicalize_axes(rank: int, axes: Axes) -> Tuple[int, ...]:
      """Returns a tuple of deduplicated, sorted, and positive axes."""
      if not isinstance(axes, Iterable):
          axes = (axes,)
      return tuple(
          set([rank + axis if axis < 0 else axis for axis in axes])
      )
  
imports: import dataclasses
  import functools
  from typing import Any, Callable, Iterable, Optional, Sequence, Tuple, Union
  import jax
  import jax.numpy
  from jax import lax
  from jax.nn import initializers
  from flax.linen import dtypes, module, transforms
label_desc: Use image node_id 1 for calling a global function with example usage: _canonicalize_axes(rank, axes) and returns: tuple