code: def rebase_donate_argnums(
      donate_argnums, static_argnums
  ) -> tuple[int, ...]:
      """Shifts donate to account for static.
  
      >>> rebase_donate_argnums((3, 4), (0, 1))
      (1, 2)
  
      Args:
        donate_argnums: An iterable of ints.
        static_argnums: An iterable of ints.
  
      Returns:
        A tuple of unique, sorted integer values based on donate_argnums with each
        element offset to account for static_argnums.
      """
      if not (static_argnums or donate_argnums):
          return tuple(sorted(donate_argnums))
  
      static_argnums = sorted(set(static_argnums))
      donate_argnums = sorted(set(donate_argnums))
      i = j = o = 0
      out = []
      while j < len(donate_argnums):
          if (
              i < len(static_argnums)
              and static_argnums[i] == donate_argnums[j]
          ):
              raise ValueError(
                  f"`static_argnums` {static_argnums} and "
                  f"`donate_argnums` {donate_argnums} cannot intersect."
              )
  
          if (
              i < len(static_argnums)
              and static_argnums[i] < donate_argnums[j]
          ):
              o += 1
              i += 1
          else:
              out.append(donate_argnums[j] - o)
              j += 1
      return tuple(out)
  
imports: from __future__ import annotations
  from collections.abc import Iterable, Sequence
  import inspect
  import operator
  from functools import partial
  from typing import Any, Callable
  import warnings
  import numpy
  from jax._src import core
  from jax._src import dtypes
  from jax._src.abstract_arrays import numpy_scalar_types
  from jax._src.core import ShapedArray
  from jax._src.tree_util import PyTreeDef, tree_flatten, tree_unflatten, tree_map, tree_structure, treedef_children, generate_key_paths, keystr, broadcast_prefix, prefix_errors
  from jax._src.tree_util import _replace_nones
  from jax._src import linear_util
  from jax._src.linear_util import TracingDebugInfo
  from jax._src.util import safe_map, WrapKwArgs, Hashable, HashableFunction, Unhashable
  from jax._src import traceback_util
label_desc: Use image node_id 20 for calling a global function with example usage: rebase_donate_argnums(donate_argnums, static_argnums) and returns: tuple, tuple