code: def pure_callback_lowering(
      ctx,
      *args,
      callback,
      sharding: SingleDeviceSharding | None,
      **params,
  ):
      def _callback(*flat_args):
          return tuple(
              pure_callback_impl(
                  *flat_args,
                  callback=callback,
                  sharding=None,  # unused.
                  **params,
              )
          )
  
      op_sharding = _callback_op_sharding(
          ctx.module_context.axis_context, sharding
      )
      result, _, _ = mlir.emit_python_callback(
          ctx,
          _callback,
          None,
          list(args),
          ctx.avals_in,
          ctx.avals_out,
          False,
          sharding=op_sharding,
      )
      return result
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  import functools
  from typing import Any, Callable
  import numpy
  from jax._src import core
  from jax._src import dispatch
  from jax._src import dtypes
  from jax._src import effects
  from jax._src import sharding_impls
  from jax._src import tree_util
  from jax._src import util
  from jax._src.interpreters import ad
  from jax._src.interpreters import batching
  from jax._src.interpreters import mlir
  from jax._src.lib import xla_client
  from jax._src.lax.control_flow.loops import map
  from jax._src.sharding_impls import SingleDeviceSharding
label_desc: Use image node_id 7 for calling a global function with example usage: pure_callback_lowering(ctx) and returns: result, tuple