code: def test_validate_hparams(self):
      hparams = {"allowed_key": "allowed_value"}
      tfr_estimator._validate_hparams(hparams, [], [])
      tfr_estimator._validate_hparams(
          hparams, [], ["allowed_key", "not_set_allowed"]
      )
      with self.assertRaises(ValueError):
          tfr_estimator._validate_hparams(hparams, ["required"])
  
imports: import os
  from absl.testing import parameterized
  import six
  import tensorflow
  from tensorflow import estimator
  from google.protobuf import text_format
  from tensorflow_ranking.python import data
  from tensorflow_ranking.python import estimator
  from tensorflow_ranking.python import feature
  from tensorflow_serving.apis import input_pb2
label_desc: Use image node_id 2 for calling the EstimatorBuilderTest obj's underlying member method code with example usage: obj.test_validate_hparams() without return types