code: def to_abs_axes(axis: AxesOrSlice, ndim: int) -> tuple[int, ...]:
      if isinstance(axis, slice):
          return tuple(range(ndim)[axis])
      else:
          return tuple(sorted({a % ndim for a in axis}))
  
imports: import collections.abc
  from collections.abc import Sequence
  from typing import Optional, Union
  from haiku._src import base
  from haiku._src import initializers
  from haiku._src import module
  from haiku._src import utils
  import jax
  import jax.numpy
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: to_abs_axes(axis, ndim) and returns: tuple, tuple