code: def test_sorting_padding():
      data = np.array(
          [[3, 4, 0], [1, 2, 2], [5, 0, 1]], dtype=int
      ).reshape((1, 3, 3))
      mask = np.array([[True, True, True]])
      data_sorted = np.array(
          [[1, 2, 2], [5, 0, 1], [3, 4, 0], [0, 0, 0]], dtype=int
      ).reshape((1, 4, 3))
  
      layer = SortPooling(k=4)
  
      data_out = layer(data, mask=mask)
  
      np.testing.assert_array_equal(data_out, data_sorted)
  
      # for mini-batch of size > 1
      data = np.array(
          [[3, 1], [1, 2], [5, 0], [0, -4]], dtype=int
      ).reshape((2, 2, 2))
      mask = np.array([[True, True], [True, True]])
      data_sorted = np.array(
          [[1, 2], [3, 1], [0, 0], [5, 0], [0, -4], [0, 0]], dtype=int
      ).reshape((2, 3, 2))
  
      layer = SortPooling(k=3)
  
      data_out = layer(data, mask=mask)
  
      np.testing.assert_array_equal(data_out, data_sorted)
  
file_path: stellargraph/tests/layer/test_sort_pooling.py
imports: import pytest
  import numpy
  from stellargraph.layer.sort_pooling import SortPooling
label_desc: Use image node_id 1 for calling a global function with example usage: test_sorting_padding() without return types