code: def inv(
      x: JaxArray,
      /,
      *,
      adjoint: bool = False,
      out: Optional[JaxArray] = None,
  ) -> JaxArray:
      if adjoint:
          if x.ndim < 2:
              raise ValueError("Input must be at least 2D")
          permutation = list(range(x.ndim))
          permutation[-2], permutation[-1] = (
              permutation[-1],
              permutation[-2],
          )
          x_adj = jnp.transpose(x, permutation).conj()
          return jnp.linalg.inv(x_adj)
      return jnp.linalg.inv(x)
  
imports: from collections import namedtuple
  from typing import Union, Optional, Tuple, Literal, Sequence, NamedTuple
  import jax.numpy
  import ivy
  from ivy import inf
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.backends.jax import JaxArray
  from .None import backend_version
  from ivy import promote_types_of_inputs
label_desc: Use image node_id 10 for calling a global function with example usage: inv() and returns: jnp, jnp