code: def test_get_embedding_layer_uses_correct_embedding_dim(self):
      vocab = Vocabulary()
      vocab.add_token_to_namespace("word1")
      vocab.add_token_to_namespace("word2")
      embeddings_filename = str(self.TEST_DIR / "embeddings.gz")
      with gzip.open(embeddings_filename, "wb") as embeddings_file:
          embeddings_file.write("word1 1.0 2.3 -1.0\n".encode("utf-8"))
          embeddings_file.write("word2 0.1 0.4 -4.0\n".encode("utf-8"))
      embedding_weights = _read_pretrained_embeddings_file(
          embeddings_filename, 3, vocab
      )
      assert tuple(embedding_weights.size()) == (
          4,
          3,
      )  # 4 because of padding and OOV
      with pytest.raises(ConfigurationError):
          _read_pretrained_embeddings_file(
              embeddings_filename, 4, 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 1 for calling the TestEmbedding obj's underlying member method code with example usage: obj.test_get_embedding_layer_uses_correct_embedding_dim() without return types