':type batch_size: int
:param batch_size: Make the data iterator return minibatches of this
size. A minibatch has time as its first dimenion, the different
examples as the second and the example dimensionality as the
last. If set to 1, the iterator will return a matrix, where
first dimension is time and second dimension is the data
dimensionality
:type path: string
:param path: string; path where the dataset can be found
:type use_infinite_loop: bool
:param use_infinite_loop: If set to true, the iterator will not
raise StopIteration, but rather loop for an infinite amound of
steps
:type seq_len: int
:param seq_len: The length of each sequence in the minibatch
:type mode: string
:param mode: It can have one of the following values {\'train\',
\'valid\', test\'}, depicting which fold of the dataset it needs to
loop over
:type chunks: string
:param chunks: It can be either {\'word\', \'char\'}. It says what is
the input of the dataset.
:type shift: int
:param shift: The target of at each time step is the `shift`-th
word/charater in the future. For example `shift` is 1, means the
next one, `shift` is 2 means predict the word at position t+2
:type reset: int or None
:param reset: If negative, the data iterator will stop after it
looped over all examples in the dataset. If positive, the
iterator will only loop over the first `reset` examples of the
dataset.
:type allow_short_sequences: bool
:param allow_short_sequences: allow the iterator to return sequences
that are shorter than the required `seq_len`
:type output_format: None or function
:param output_format: function wraps the returned samples into a
different format. Specifically, the iterator will return
`output_format`(x) instead of x
:type can_fit: bool
:param can_fit: Flag saying if the dataset fits in memory or not'

def __init__(self, batch_size, path=None, use_infinite_loop=True, stop=(-1), seq_len=10, mode='train', chunks='words', shift=1, reset=None, allow_short_sequences=False, output_format=None, can_fit=False):

    assert (type(path) is not None), 'Target    language    file    should    be    a    list.'
    self.reset = reset
    self.batch_size = batch_size
    self.offset = 0
    self.allow_short_sequences = allow_short_sequences
    self.output_format = output_format
    self.stop = stop
    self.can_fit = can_fit
    self.path = None
    self.chunks = chunks
    self.path = path
    self.mode = mode
    self.seq_len = seq_len
    self.batch_no = 0
    self.use_infinite_loop = use_infinite_loop
    self.data_len = 0
    self.load_files()
    self.shift = shift
