code: def _swap_pp_rule(eqn, context, settings) -> pp.Doc:
      (y,) = eqn.outvars
      x, v, *flat_idx = eqn.invars
      indexers = tree_util.tree_unflatten(eqn.params["tree"], flat_idx)
      if type(y) is core.DropVar:
          # In the case of a set (ignored return value),
          # pretty print `_ = swap x v i` as `x[i] <- v`
          del y
          return pp.concat(
              [
                  pp_ref_indexers(context, x, indexers),
                  pp.text(" <- "),
                  pp.text(core.pp_var(v, context)),
              ]
          )
      else:
          # pretty-print `y:T = swap x v i` as `y:T, x[i] <- x[i], v`
          x_i = pp_ref_indexers(context, x, indexers)
          y = core.pp_vars(
              [y], context, print_shapes=settings.print_shapes
          )
          return pp.concat(
              [
                  y,
                  pp.text(", "),
                  x_i,
                  pp.text(" <- "),
                  x_i,
                  pp.text(", "),
                  pp.text(core.pp_var(v, context)),
              ]
          )
  
imports: from __future__ import annotations
  from functools import partial
  from typing import Any, Union
  import numpy
  from jax._src import ad_util
  from jax._src import core
  from jax._src import pretty_printer
  from jax._src import tree_util
  from jax._src.interpreters import ad
  from jax._src.interpreters import batching
  from jax._src.interpreters import partial_eval
  from jax._src.interpreters import mlir
  from jax._src.lax import lax
  from jax._src.typing import Array
  from jax._src.state import indexing
  from jax._src.state.types import AbstractRef, RefView, ReadEffect, WriteEffect, AccumEffect
  from jax._src.util import safe_map, safe_zip
label_desc: Use image node_id 19 for calling a global function with example usage: _swap_pp_rule(eqn, context, settings) and returns: pp, pp