code: def inv(
      x: np.ndarray,
      /,
      *,
      adjoint: bool = False,
      out: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      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 = np.transpose(x, permutation).conj()
          return np.linalg.inv(x_adj)
      return np.linalg.inv(x)
  
imports: from collections import namedtuple
  from typing import Union, Optional, Tuple, Literal, List, NamedTuple, Sequence
  import numpy
  import ivy
  from ivy import inf
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.backends.numpy.helpers import _scalar_output_to_0d_array
  from .None import backend_version
label_desc: Use image node_id 8 for calling a global function with example usage: inv() and returns: np, np