code: def test_base_cases(self):
      embedding = self.build_embedding()
      x, y = SMP2018ECDTCorpus.load_data()
      processor = SequenceProcessor()
      processor.build_vocab(x, y)
      embedding.setup_text_processor(processor)
  
      samples = random.sample(x, sample_count)
      res = embedding.embed(samples)
      max_len = max([len(i) for i in samples]) + 2
  
      if embedding.max_position is not None:
          max_len = embedding.max_position
  
      assert res.shape == (
          len(samples),
          max_len,
          embedding.embedding_size,
      )
  
      # Test Save And Load
      embed_dict = embedding.to_dict()
      embedding2 = load_data_object(embed_dict)
      embedding2.setup_text_processor(processor)
      assert embedding2.embed(samples).shape == (
          len(samples),
          max_len,
          embedding.embedding_size,
      )
  
file_path: Kashgari/tests/test_embeddings/test_bare_embedding.py
imports: import os
  import time
  import random
  import tempfile
  import unittest
  from kashgari.logger import logger
  from kashgari.processors import SequenceProcessor
  from kashgari.corpus import SMP2018ECDTCorpus
  from kashgari.embeddings import BareEmbedding
  from kashgari.tasks.classification import BiGRU_Model
  from kashgari.utils import load_data_object
label_desc: Use image node_id 2 for calling the TestBareEmbedding obj's underlying member method code with example usage: obj.test_base_cases() without return types