code: def fft(
      x: JaxArray,
      dim: int,
      /,
      *,
      norm: str = "backward",
      n: Optional[Union[int, Tuple[int]]] = None,
      out: Optional[JaxArray] = None,
  ) -> JaxArray:
      if not isinstance(dim, int):
          raise ivy.utils.exceptions.IvyError(
              f"Expecting <class 'int'> instead of {type(dim)}"
          )
      if n is None:
          n = x.shape[dim]
      if n < -len(x.shape):
          raise ivy.utils.exceptions.IvyError(
              f"Invalid dim {dim}, expecting ranging"
              " from {-len(x.shape)} to {len(x.shape)-1}  "
          )
      if not isinstance(n, int):
          raise ivy.utils.exceptions.IvyError(
              f"Expecting <class 'int'> instead of {type(n)}"
          )
      if n <= 1:
          raise ivy.utils.exceptions.IvyError(
              f"Invalid data points {n}, expecting more than 1"
          )
      if norm not in {"backward", "ortho", "forward"}:
          raise ivy.utils.exceptions.IvyError(
              f"Unrecognized normalization mode {norm}"
          )
      return jnp.fft.fft(x, n, dim, norm)
  
imports: from typing import Optional, Union, Tuple, List, Literal, Sequence, Callable
  import jax
  import jax.lax
  import jax.numpy
  import math
  import ivy
  from ivy import output_to_native_arrays
  from ivy.functional.backends.jax import JaxArray
  from ivy.functional.backends.jax.random import RNG
  from ivy.functional.ivy.experimental.general import _correct_ivy_callable
  from ivy.functional.ivy.layers import _handle_padding, _validate_max_pool_params, _depth_max_pooling_helper
  from ivy.functional.ivy.experimental.layers import _padding_ceil_mode, _get_size
  from ivy.func_wrapper import with_supported_dtypes
  from ivy.func_wrapper import with_unsupported_dtypes
  from .None import backend_version
  from ivy.functional.backends.jax.experimental.manipulation import _to_nested_tuple
label_desc: Use image node_id 12 for calling a global function with example usage: fft() and returns: jnp