code: def seq_data_iter(corpus, batch_size, num_steps):
      # Offset the iterator over the data for uniform starts
      corpus = corpus[random.randint(0, num_steps) :]
      # Subtract 1 extra since we need to account for label
      num_examples = (len(corpus) - 1) // num_steps
      example_indices = list(
          range(0, num_examples * num_steps, num_steps)
      )
      random.shuffle(example_indices)
  
      def data(pos):
          # This returns a sequence of length `num_steps` starting from `pos`
          return corpus[pos : pos + num_steps]
  
      # Discard half empty batches
      num_batches = num_examples // batch_size
      for i in range(0, batch_size * num_batches, batch_size):
          # `batch_size` indicates the random examples read each time
          batch_indices = example_indices[i : (i + batch_size)]
          X = [data(j) for j in batch_indices]
          Y = [data(j + 1) for j in batch_indices]
          yield X, Y
  
imports: import collections
  import random
  import re
  import jax
  import jax.numpy
  import tensorflow_datasets
  import objax
  from objax.functional import one_hot
  from objax.zoo.rnn import RNN
label_desc: Use image node_id 3 for calling a global function with example usage: seq_data_iter(corpus, batch_size, num_steps) and returns: corpus