code: def ptb_iterator(data, batch_size, num_steps):
      """Iterates through the ptb data."""
      data_length = len(data)
      batch_length = data_length // batch_size
  
      data = np.asarray(data[: batch_size * batch_length])
      data = data.reshape([batch_size, batch_length])
  
      epoch_size = (batch_length - 1) // num_steps
      if epoch_size == 0:
          raise ValueError(
              "epoch_size == 0, decrease batch_size or num_steps"
          )
  
      for i in range(epoch_size):
          x = data[:, i * num_steps : (i + 1) * num_steps]
          y = data[:, i * num_steps + 1 : (i + 1) * num_steps + 1]
          yield (x, y)
  
imports: import os
  import numpy
  import tensorflow
  import texar.tf
label_desc: Use image node_id 1 for calling a global function with example usage: ptb_iterator(data, batch_size, num_steps) without return types