code: def pad_batch(b, seq_limit):
      """convert a batch of encoded sequence
      to pretrained word vectors from the embed weights (lookup dictionary)
      """
      batch_seq = []
      batch_senti_onehot = []
      batch_senti = []
      for r in b:
          # r[0] encoded sequence
          # r[1] label 1 or 0
          encoded = None
          if len(r[0]) >= seq_limit:
              encoded = r[0][:seq_limit]
          else:
              encoded = r[0] + [0] * (seq_limit - len(r[0]))
  
          batch_seq.append(encoded)
          batch_senti.append(r[1])
          if r[1] == 1:
              batch_senti_onehot.append([0, 1])
          else:
              batch_senti_onehot.append([1, 0])
      batch_senti = np.array(batch_senti).astype(np.float32)
      batch_senti_onehot = np.array(batch_senti_onehot).astype(
          np.float32
      )
      batch_seq = np.array(batch_seq).astype(np.int32)
      return batch_seq, batch_senti_onehot, batch_senti
  
imports: import re
  import os
  import pickle
  import urllib
  import tarfile
  import numpy
  import pandas
  import nltk
  from nltk.stem import PorterStemmer
  from nltk.tokenize.toktok import ToktokTokenizer
  from gensim.models.keyedvectors import KeyedVectors
  from sklearn.model_selection import train_test_split
  from bs4 import BeautifulSoup
label_desc: Use image node_id 1 for calling a global function with example usage: pad_batch(b, seq_limit) and returns: batch_seq,  batch_senti_onehot,  batch_senti