code: def encode(self, sequence):
      sequence_size = len(sequence)
  
      data = np.zeros((sequence_size, self.n_characters))
      data[(np.arange(sequence_size), sequence)] = 1
  
      return np.expand_dims(data, axis=0)
  
file_path: neupy/examples/rnn/shakespeare_lstm.py
imports: import os
  import numpy
  from tqdm import trange
  from sklearn.model_selection import train_test_split
  from neupy import layers, algorithms
label_desc: Use image node_id 3 for calling the TextPreprocessing obj's underlying member method code with example usage: obj.encode(sequence) and returns: np