code: def test_quantile(quantile_params):
      type, sorted = quantile_params
  
      sample = (0.5 + tf.range(1e6)) / 1e6
      if not sorted:
          sample = tf.random.shuffle(sample)
  
      np.testing.assert_almost_equal(
          quantile(sample, 0.001, type=type, sorted=sorted),
          0.001,
          decimal=6,
      )
      np.testing.assert_almost_equal(
          quantile(sample, 0.999, type=type, sorted=sorted),
          0.999,
          decimal=6,
      )
  
      assert (
          quantile(tf.ones((100,)), 0.42, type=type, sorted=sorted) == 1
      )
      with pytest.raises(ValueError):
          quantile(tf.ones((10,)), 0.999, type=type, sorted=sorted)
      with pytest.raises(ValueError):
          quantile(tf.ones((100, 100)), 0.5, type=type, sorted=sorted)
  
file_path: alibi-detect/alibi_detect/utils/tensorflow/tests/test_misc_tf.py
imports: from itertools import product
  import pytest
  import tensorflow
  from tensorflow.keras.layers import Dense, Input, InputLayer
  import numpy
  from alibi_detect.utils.tensorflow import zero_diag, quantile, subset_matrix
  from alibi_detect.utils.tensorflow.misc import clone_model
label_desc: Use image node_id 3 for calling a global function with example usage: test_quantile(quantile_params) without return types