code: def prep_data(
      raw_input,
      input_type,
      max_len,
      vocab,
      dtype="int32",
      index_from=2,
      oov=1,
  ):
      """
      Transforms the raw received input data to put it in the required
      format for running through neon.
      Args:
          raw_input (blob): input data contents ex. a stream of text
          input_type (str): type for input data file
          max_len (int): max sentence length to deal with
          vocab (dict): vocabulary file
          dtype (type, optional): type for each element of a tensor.  Defaults to
                                  float32
      Returns:
          Tensor: neon input data file of appropriate shape.
      """
      dtype = np.dtype(dtype)
      if input_type == "text":
          in_shape = (max_len, 1)
  
          tokens = tokenize(raw_input)
          sent_inp = np.array(
              [
                  oov if t not in vocab else (vocab[t] + index_from)
                  for t in tokens
              ]
          )
          l = min(len(sent_inp), max_len)
          xbuf = np.zeros(in_shape, dtype=dtype)
          xbuf[-l:] = sent_inp[-l:].reshape(-1, 1)
  
          return xbuf
      else:
          raise ValueError("Unsupported data type: %s" % input_type)
  
imports: import os
  import numpy
  from collections import defaultdict, OrderedDict
  from neon.layers import LookupTable, RecurrentSum, RecurrentLast, Linear, Bias, GeneralizedCost
  from neon.initializers import Gaussian, Constant
  from neon.data import ArrayIterator
  from neon.data.text_preprocessing import clean_string
  from neon.optimizers import GradientDescentMomentum
  from neon.transforms import SumSquared
  from neon.callbacks.callbacks import Callbacks
  from neon.models import Model
  from neon.util.persist import load_obj, save_obj
  from neon import logger
label_desc: Use image node_id 1 for calling a global function with example usage: prep_data(raw_input, input_type, max_len, vocab, dtype, index_from, oov) and returns: xbuf