code: def create_batches(data_text, map_to_ids, batch_size, cuda=True):
      data_ids = map_to_ids(data_text)
      N = len(data_ids)
      L = ((N - 1) // batch_size) * batch_size
      x = np.copy(data_ids[:L].reshape(batch_size, -1).T)
      y = np.copy(data_ids[1 : L + 1].reshape(batch_size, -1).T)
      x, y = torch.from_numpy(x), torch.from_numpy(y)
      x, y = x.contiguous(), y.contiguous()
      if cuda:
          x, y = x.cuda(), y.cuda()
      return x, y
  
imports: import sys
  import os
  import argparse
  import time
  import random
  import math
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.autograd import Variable
  import sru
label_desc: Use image node_id 2 for calling a global function with example usage: create_batches(data_text, map_to_ids, batch_size, cuda) and returns: x,  y