code: def test_read_hdf5_raises_on_invalid_shape(self):
      vocab = Vocabulary()
      vocab.add_token_to_namespace("word")
      embeddings_filename = unicode(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(vocab, params)
  
imports: from __future__ import division
  from __future__ import with_statement
  from __future__ import absolute_import
  import gzip
  import warnings
  import numpy
  import pytest
  import torch
  from io import open
  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 Embedding, _read_pretrained_embeddings_file, 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