code: def test_call():
      calib_layer = CalibrationLayer(
          pos_size=5, neg_size=5, calib_w=10, calib_b=10
      )
  
      calib_layer.build((10, 10))
  
      out = calib_layer.call(
          scores_pos=tf.constant([-2, 1, -1], dtype=tf.float32),
          scores_neg=tf.constant([10, 11, 12], dtype=tf.float32),
          training=0,
      )
      assert (
          np.around(out.numpy(), 2)
          == np.array([1, 0, 0.5], dtype=np.float32)
      ).all(), "CalibrationLayer: calibration scores don't match"
  
      out1 = calib_layer.call(
          scores_pos=tf.constant([-2, 1, -1], dtype=tf.float32),
          scores_neg=tf.constant([10, 11, 12], dtype=tf.float32),
          training=1,
      )
      assert np.around(out1.numpy(), 2) == np.array(
          [11.78], dtype=np.float32
      ), "CalibrationLayer: calibration scores don't match"
  
      calib_layer2 = CalibrationLayer(
          pos_size=5, positive_base_rate=0.5, calib_w=10, calib_b=10
      )
      calib_layer2.build((10, 10))
      out2 = calib_layer2.call(
          scores_pos=tf.constant([-2, 1, -1], dtype=tf.float32),
          scores_neg=tf.constant([10, 11, 12], dtype=tf.float32),
          training=1,
      )
  
      assert np.around(out1.numpy(), 2) == np.around(
          out2.numpy(), 2
      ), "CalibrationLayer: calibration scores don't match"
  
imports: from ampligraph.latent_features.layers.calibration import CalibrationLayer
  import pytest
  import tensorflow
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: test_call() without return types