code: def agreement_test(
      tfe_layer_cls,
      kwargs=None,
      batch_input_shape=None,
      batch_input_data=None,
      rtol=1e-1,
      atol=1e-8,
      **tfe_kwargs,
  ):
      """Check agreement between a tf.keras layer and a tfe.keras layer.
      Arguments:
        tfe_layer_cls: Layer class object (from tfe.keras).
        kwargs: Optional dictionary of keyword arguments for instantiating the
            layers.
        input_shape: Input shape tuple.
        input_data: Numpy array of input data.
        expected_output: Shape tuple for the expected shape of the output.
        tfe_kwargs: Additional kwargs to supply the tfe.keras Layer not included in
            the argspec of the original tf.keras Layer object.
      Raises:
          ValueError: if `input_data is None and input_shape is None`.
      """
      batch_input_shape, batch_input_data = _sanitize_testing_args(
          batch_input_shape, batch_input_data
      )
  
      tf_layer_cls = getattr(tf.keras.layers, tfe_layer_cls.__name__)
      tfe_kwargs = {**kwargs, **tfe_kwargs}
  
      with tf.name_scope("TFE"):
          tfe_layer = tfe_layer_cls(**tfe_kwargs)
          x = tfe.define_private_variable(batch_input_data)
          y = tfe_layer(x)
  
          d_y = tfe.define_private_variable(np.ones(y.shape))
          try:
              _, tfe_dx = tfe_layer.backward(d_y)
          except NotImplementedError:
              tfe_dx = None
  
          actual_y = y.reveal().to_native()
          if tfe_dx is not None:
              actual_dx = tfe_dx.reveal().to_native()
  
      with tf.name_scope("TF"):
          tf_layer = tf_layer_cls(**kwargs)
          x = tf.Variable(batch_input_data, dtype=tf.float32)
  
          with tf.GradientTape() as tape:
              expected_y = tf_layer(x)
              if tfe_dx is not None:
                  expected_dx = tape.gradient(expected_y, x)
  
      np.testing.assert_allclose(
          actual_y, expected_y, rtol=rtol, atol=atol
      )
      if tfe_dx is not None:
          np.testing.assert_allclose(
              actual_dx, expected_dx, rtol=rtol, atol=atol
          )
  
imports: import numpy
  import tensorflow
  import tf_encrypted
  from tf_encrypted.keras.models import Sequential
label_desc: Use image node_id 1 for calling a global function with example usage: agreement_test(tfe_layer_cls, kwargs, batch_input_shape, batch_input_data, rtol, atol) without return types