code: def test_get_batch_num_gradients_cityblock(shape, batch_size):
      u = np.random.rand(batch_size, *shape)
      v = np.random.rand(1, *shape)
  
      grad_true = np.sign(u - v).reshape(
          batch_size, 1, *shape
      )  # expand dims to incorporate 1-d scalar response
      grad_approx = num_grad_batch(cityblock_batch, u, args=tuple([v]))
  
      assert grad_approx.shape == grad_true.shape
      assert np.allclose(grad_true, grad_approx)
  
file_path: alibi/alibi/utils/tests/test_gradients.py
imports: import numpy
  import pytest
  from sklearn.datasets import load_iris
  from sklearn.linear_model import LogisticRegression
  from alibi.utils.distance import cityblock_batch
  from alibi.utils.gradients import num_grad_batch
label_desc: Use image node_id 2 for calling a global function with example usage: test_get_batch_num_gradients_cityblock(shape, batch_size) without return types