code: def build_dataset(
      filename, sequence_length, alphabet_size, max_lines=-1
  ):
      """Loads a text file, and turns each line into an encoded sequence."""
      with open(filename) as f:
          content = f.readlines()
      content = content[:max_lines]
      content = [
          line for line in content if len(line) > 2
      ]  # Remove blank lines
      seqs = np.zeros((sequence_length, len(content), alphabet_size))
      for ix, line in enumerate(content):
          padded_line = (line + " " * sequence_length)[:sequence_length]
          seqs[:, ix, :] = string_to_one_hot(padded_line, alphabet_size)
      return seqs
  
file_path: autograd/examples/rnn.py
imports: from __future__ import absolute_import
  from __future__ import print_function
  from builtins import range
  import autograd.numpy
  import autograd.numpy.random
  from autograd import grad
  from autograd.scipy.special import logsumexp
  from os.path import dirname, join
  from autograd.misc.optimizers import adam
label_desc: Use image node_id 8 for calling a global function with example usage: build_dataset(filename, sequence_length, alphabet_size, max_lines) and returns: seqs