code: def test_grad_cos_result_order_tf(seed):
      """
      `grad_cos` finds data points with small angular separation to be more similar independent of length. Test is
      applied to `tensorflow` backend.
      """
      ds = np.array(
          [[1, 0], [0.9, 0.1], [0.5 * 100, 0.5 * 100]]
      ).astype("float32")
      model = keras.Sequential([keras.layers.Dense(1, use_bias=False)])
      # GradientSimilarity method checks weights are trainable so we need to build the model before passing it to the
      # method
      model.build((None, 2))
  
      explainer = GradientSimilarity(
          model,
          task="regression",
          loss_fn=loss_tf,
          sim_fn="grad_cos",
          backend="tensorflow",
      )
      explainer = explainer.fit(ds, ds)
      explanation = explainer.explain(ds[0], Y=ds[0])
      np.testing.assert_array_equal(
          ds[explanation["ordered_indices"][0][1]], ds[1]
      )
      np.testing.assert_array_equal(
          ds[explanation["ordered_indices"][0][-1]], ds[-1]
      )
  
imports: import pytest
  import numpy
  import torch.nn
  import torch
  import tensorflow
  from tensorflow import keras
  from alibi.explainers.similarity.grad import GradientSimilarity
label_desc: Use image node_id 13 for calling a global function with example usage: test_grad_cos_result_order_tf(seed) without return types