code: def permutation(key, x, axis=0, independent=False):
      x = ivy.array(x)
      seed = _get_seed(key)
      if not ivy.get_num_dims(x):
          r = int(x)
          return ivy.shuffle(ivy.arange(r), axis, seed=seed)
      if independent:
          return ivy.shuffle(x, axis, seed=seed)
      rand = ivy.arange(x.shape[axis])
      ind = ivy.shuffle(rand, 0, seed=seed)
      return ivy.gather(x, ind, axis=axis)
  
imports: import operator
  import ivy
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from ivy.functional.frontends.jax.func_wrapper import to_ivy_arrays_and_back, handle_jax_dtype
label_desc: Use image node_id 23 for calling a global function with example usage: permutation(key, x, axis, independent) and returns: ivy, ivy, ivy