code: def _quantile(a, q, axis=None):
      ret_dtype = a.dtype
      if tf.experimental.numpy.ndim(q) > 1:
          raise ValueError(
              "q argument must be a scalar or 1-dimensional!"
          )
      if axis is None:
          axis = 0
          a = tf.reshape(a, [-1])
      elif axis != 0:
          a = tf.experimental.numpy.moveaxis(a, axis, 0)
          axis = 0
  
      n = a.shape[axis]
  
      indices = q * (n - 1)
  
      a = tf.sort(a, axis)
  
      indices_below = tf.cast(tf.math.floor(indices), dtype=tf.int32)
      indices_upper = tf.cast(tf.math.ceil(indices), dtype=tf.int32)
  
      weights = indices - tf.cast(indices_below, dtype=ret_dtype)
  
      indices_below = tf.clip_by_value(indices_below, 0, n - 1)
      indices_upper = tf.clip_by_value(indices_upper, 0, n - 1)
      tensor_upper = tf.gather(a, indices_upper, axis=axis)
      tensor_below = tf.gather(a, indices_below, axis=axis)
  
      pred = weights <= 0.5
      out = tf.where(pred, tensor_below, tensor_upper)
  
      return tf.cast(out, ret_dtype)
  
imports: from typing import Union, Optional, Tuple, Sequence
  import tensorflow
  from tensorflow.python.ops.numpy_ops import np_math_ops
  import ivy
  from ivy import with_unsupported_dtypes, with_supported_dtypes, with_supported_device_and_dtypes
  from ..None import backend_version
  from copy import deepcopy
label_desc: Use image node_id 10 for calling a global function with example usage: _quantile(a, q, axis) and returns: tf