docstr: Test that observations have correct shape and values from `context`.
docstr_tok: ["Test","that","observations","have","correct","shape","and","values","from","`","context","`","."]
code: def testObservationShapeAndValue(self, context, labels, batch_size):
      """Test that observations have correct shape and values from `context`."""
      dataset = (
          tf.data.Dataset.from_tensor_slices((context, labels))
          .repeat()
          .shuffle(4 * batch_size)
      )
      # Rewards of 1. is given when action == label
      reward_distribution = deterministic_reward_distribution(
          tf.eye(len(set(labels)))
      )
      env = ce.ClassificationBanditEnvironment(
          dataset, reward_distribution, batch_size
      )
      expected_observation_shape = [batch_size] + list(
          context.shape[1:]
      )
      self.evaluate(tf.compat.v1.global_variables_initializer())
      for _ in range(100):
          observation = self.evaluate(env.reset().observation)
          np.testing.assert_array_equal(
              observation.shape, expected_observation_shape
          )
          for o in observation:
              self.assertIn(o, context)
  
file_path: agents/tf_agents/bandits/environments/classification_environment_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from absl.testing import parameterized
  from absl.testing.absltest import mock
  import numpy
  import tensorflow
  import tensorflow_probability
  from tf_agents.bandits.environments import classification_environment
label_desc: Use image node_id 2 for calling the ClassificationEnvironmentTest obj's underlying member method code with example usage: obj.testObservationShapeAndValue(context, labels, batch_size) without return types