code: def test_disjoint_2_batch():
      X = np.array([[1, 0], [0, 1], [1, 1], [0, 0], [1, 2]])
      I = np.array([0, 0, 0, 1, 1])
      A_data = [1, 1, 1, 1, 1]
      A_row = [0, 1, 2, 3, 4]
      A_col = [1, 0, 1, 4, 3]
      A = sp_matrix_to_sp_tensor(
          sp.csr_matrix((A_data, (A_row, A_col)), shape=(5, 5))
      )
  
      expected_X = np.array(
          [
              [[1.0, 0.0], [0.0, 1.0], [1.0, 1.0]],
              [[0.0, 0.0], [1.0, 2.0], [0.0, 0.0]],
          ]
      )
      expected_A = np.array(
          [
              [[0.0, 1.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0]],
              [[0.0, 1.0, 0.0], [1.0, 0.0, 0.0], [0.0, 0.0, 0.0]],
          ]
      )
  
      result_X, result_A = layers.Disjoint2Batch()((X, A, I))
      assert np.allclose(result_A, expected_A, atol=tol)
      assert np.allclose(result_X, expected_X, atol=tol)
  
      _test_get_config(layers.Disjoint2Batch)
  
file_path: spektral/tests/test_layers/test_base.py
imports: import numpy
  import scipy.sparse
  import tensorflow
  from spektral import layers
  from spektral.utils.sparse import sp_matrix_to_sp_tensor
  from tests.test_layers.convolutional.core import _test_get_config
label_desc: Use image node_id 1 for calling a global function with example usage: test_disjoint_2_batch() without return types