'Load data from underlying arrays, internal use only.'

def _getdata(self, data_source):

    assert (self.cursor < self.num_data), 'DataIter    needs    reset.'
    if ((self.cursor + self.batch_size) <= self.num_data):
        return [(x[1][self.cursor:(self.cursor + self.batch_size)] if isinstance(x[1], (np.ndarray, NDArray)) else array(x[1][sorted(self.idx[self.cursor:(self.cursor + self.batch_size)])][[list(self.idx[self.cursor:(self.cursor + self.batch_size)]).index(i) for i in sorted(self.idx[self.cursor:(self.cursor + self.batch_size)])]])) for x in data_source]
    else:
        pad = ((self.batch_size - self.num_data) + self.cursor)
        return [(concatenate([x[1][self.cursor:], x[1][:pad]]) if isinstance(x[1], (np.ndarray, NDArray)) else concatenate([array(x[1][sorted(self.idx[self.cursor:])][[list(self.idx[self.cursor:]).index(i) for i in sorted(self.idx[self.cursor:])]]), array(x[1][sorted(self.idx[:pad])][[list(self.idx[:pad]).index(i) for i in sorted(self.idx[:pad])]])])) for x in data_source]
