code: def test_assign_pretrained_weights(self):
      embeddings_ref = PretrainedEmbedding()
      embeddings_ref.load_cached_embeddings(EMBED_CACHED_PATH)
      VOCAB = ["UNK", "aloha", "the"]
      embed_vocab_to_idx = {tok: i for i, tok in enumerate(VOCAB)}
      pretrained_embeds = embeddings_ref.initialize_embeddings_weights(
          embed_vocab_to_idx, "UNK", EMBED_DIM, EmbedInitStrategy.RANDOM
      )
      assert pretrained_embeds.shape[0] == len(VOCAB)
      assert pretrained_embeds.shape[1] == EMBED_DIM
      np.testing.assert_array_almost_equal(
          pretrained_embeds[1].numpy(),
          [-0.43124, 0.014934, -0.50635, 0.60506, 0.56051],
      )  # embedding vector for 'aloha'
      np.testing.assert_array_almost_equal(
          pretrained_embeds[2].numpy(),
          [-0.39153, -0.19803, 0.2573, -0.18617, 0.25551],
      )
  
file_path: pytext/pytext/utils/tests/embeddings_utils_test.py
imports: import tempfile
  import unittest
  import numpy
  from pytext.common.constants import DatasetFieldName
  from pytext.config.field_config import DocLabelConfig, EmbedInitStrategy, FeatureConfig, WordFeatConfig, WordLabelConfig
  from pytext.data.featurizer import SimpleFeaturizer
  from pytext.utils.test import import_tests_module
  from pytorch.text.fb.utils.embeddings import PretrainedEmbedding
label_desc: Use image node_id 3 for calling the PretrainedEmbedsTest obj's underlying member method code with example usage: obj.test_assign_pretrained_weights() without return types