code: def _str_to_fft_type(s: str) -> xla_client.FftType:
      if s in ("fft", "FFT"):
          return xla_client.FftType.FFT
      elif s in ("ifft", "IFFT"):
          return xla_client.FftType.IFFT
      elif s in ("rfft", "RFFT"):
          return xla_client.FftType.RFFT
      elif s in ("irfft", "IRFFT"):
          return xla_client.FftType.IRFFT
      else:
          raise ValueError(f"Unknown FFT type '{s}'")
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  from functools import partial
  import math
  import numpy
  from jax import lax
  from jax._src import dispatch
  from jax._src.api import jit, linear_transpose, ShapeDtypeStruct
  from jax._src.core import Primitive, is_constant_shape
  from jax._src.interpreters import ad
  from jax._src.interpreters import batching
  from jax._src.interpreters import mlir
  from jax._src.lib.mlir.dialects import hlo
  from jax._src.lib import xla_client
  from jax._src.lib import xla_extension_version
  from jax._src.lib import ducc_fft
  from jax._src.numpy.util import promote_dtypes_complex, promote_dtypes_inexact
label_desc: Use image node_id 1 for calling a global function with example usage: _str_to_fft_type(s) and returns: xla_client, xla_client, xla_client, xla_client