human
I am working on the file "3_tv-script-generation/dlnd_tv_script_generation.ipynb".
The first task is:
Batches
Implement get_batches to create batches of input and targets using int_text.  The batches should be a Numpy array with the shape (number of batches, 2, batch size, sequence length). Each batch contains two elements:
- The first element is a single batch of input with the shape [batch size, sequence length]
- The second element is a single batch of targets with the shape [batch size, sequence length]
If you can't fill the last batch with enough data, drop the last batch.
For exmple, get_batches([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], 2, 3) would return a Numpy array of the following:
```
[
  # First Batch
  [
    # Batch of Input
    [[ 1  2  3], [ 7  8  9]],
    # Batch of targets
    [[ 2  3  4], [ 8  9 10]]
  ],
# Second Batch
  [
    # Batch of Input
    [[ 4  5  6], [10 11 12]],
    # Batch of targets
    [[ 5  6  7], [11 12 13]]
  ]
]
```
Can you write Python program for it?
assistant
#Here is the Python program you requested.

def get_batches(int_text, batch_size, seq_length):
    """
    Return batches of input and target
    :param int_text: Text with the words replaced by their ids
    :param batch_size: The size of batch
    :param seq_length: The length of sequence
    :return: Batches as a Numpy array
    """
    
    def parse_text(offset):
        starts = range(offset, len(int_text), seq_length)
        ends = range(offset+seq_length, len(int_text), seq_length)
        return [ int_text[start:end] for start, end in zip(starts,ends) ]        
    
    n_batches = int(len(int_text)/(batch_size*seq_length))
    batches = np.empty((n_batches, 2, batch_size, seq_length))
    
    inputss = parse_text(0)
    targetss = parse_text(1)

    indices = [(inputs_i, batches_i) for inputs_i in range(batch_size) \
                                                         for batches_i in range(n_batches)]
    
    for (inputs_i, batch_i), inputs, targets in zip(indices, inputss, targetss): 
        # Inputs
        batches[batch_i, 0, inputs_i] = inputs
        # Targets
        batches[batch_i, 1, inputs_i] = targets
            
    return batches

"""
DON'T MODIFY ANYTHING IN THIS CELL THAT IS BELOW THIS LINE
"""
tests.test_get_batches(get_batches)