code: def test_read_hdf5_raises_on_invalid_shape(self):
      vocab = Vocabulary()
      vocab.add_token_to_namespace("word")
      embeddings_filename = str(self.TEST_DIR / "embeddings.hdf5")
      embeddings = numpy.random.rand(vocab.get_vocab_size(), 10)
      with h5py.File(embeddings_filename, "w") as fout:
          _ = fout.create_dataset(
              "embedding",
              embeddings.shape,
              dtype="float32",
              data=embeddings,
          )
  
      params = Params(
          {"pretrained_file": embeddings_filename, "embedding_dim": 5}
      )
      with pytest.raises(ConfigurationError):
          _ = Embedding.from_params(params, vocab=vocab)
  
imports: import gzip
  import warnings
  import numpy
  import pytest
  import torch
  from allennlp.common import Params
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data import Vocabulary
  from allennlp.modules.token_embedders.embedding import _read_pretrained_embeddings_file, Embedding, EmbeddingsTextFile, format_embeddings_file_uri, parse_embeddings_file_uri
label_desc: Use image node_id 6 for calling the TestEmbedding obj's underlying member method code with example usage: obj.test_read_hdf5_raises_on_invalid_shape() without return types