code: def _quantile(a, q, axis=None, interpolation="nearest"):
      if isinstance(q, float):
          q = paddle.to_tensor(q)
      ret_dtype = a.dtype
      if q.ndim > 1:
          raise ValueError(
              "q argument must be a scalar or 1-dimensional!"
          )
      if axis is None:
          axis = 0
          a = paddle.flatten(a)
      elif axis != 0:
          a = a.moveaxis(axis, 0)
          axis = 0
  
      n = a.shape[axis]
  
      indices = q * (n - 1)
  
      a = paddle.sort(a, axis)
  
      if interpolation == "lower":
          indices = paddle.floor(indices)
      elif interpolation == "higher":
          indices = paddle.ceil(indices)
      elif interpolation == "nearest":
          indices = paddle.round(indices)
      elif interpolation == "midpoint":
          index_floor = paddle.floor(indices)
          index_ceil = paddle.ceil(indices)
          indices = (index_ceil + index_floor) / 2
  
      indices_below = paddle.floor(indices).astype(paddle.int32)
      indices_upper = paddle.ceil(indices).astype(paddle.int32)
      weights = indices - indices_below.astype(paddle.float64)
      if interpolation == "nearest_jax":
          indices_below = paddle.clip(indices_below, 0, n - 1)
          indices_upper = paddle.clip(indices_upper, 0, n - 1)
          tensor_upper = paddle.gather(a, indices_upper, axis=axis)
          tensor_below = paddle.gather(a, indices_below, axis=axis)
  
          pred = weights <= 0.5
          out = paddle.where(pred, tensor_below, tensor_upper)
      else:
          tensor_upper = paddle.gather(a, indices_upper, axis=axis)
          tensor_below = paddle.gather(a, indices_below, axis=axis)
          out = paddle.lerp(
              tensor_below.astype(paddle.float64),
              tensor_upper.astype(paddle.float64),
              weights.astype(paddle.float64),
          )
  
      return out.astype(ret_dtype)
  
imports: from typing import Optional, Union, Tuple, Sequence, Any
  import paddle
  import ivy.functional.backends.paddle
  import ivy
  from copy import deepcopy
  from ivy.func_wrapper import with_unsupported_device_and_dtypes, with_supported_dtypes
  from .None import backend_version
label_desc: Use image node_id 9 for calling a global function with example usage: _quantile(a, q, axis, interpolation) and returns: out