def __getitem__(self, index):
    start_index = (index * self.batch_size)
    stop_index = ((index + 1) * self.batch_size)
    batch_buffer_data = []
    batch_buffer_meta = []
    for item_index in range(start_index, stop_index):
        if (item_index < len(self.item_list)):
            item = self.item_list[item_index]
            (data, meta) = self.process_item(item=item)
            if self.transformer_callbacks:
                for callback in self.transformer_callbacks:
                    (data, meta) = callback(data=data, meta=meta)
            batch_buffer_data.append(data.data)
            if (self.target_format == 'single_target_per_sequence'):
                for i in range(0, data.shape[data.sequence_axis]):
                    batch_buffer_meta.append(meta.data[:, 0])
            elif (self.target_format == 'same'):
                batch_buffer_meta.append(numpy.repeat(a=meta.data, repeats=data.length, axis=1))
    if (len(data.shape) == 2):
        if (data.time_axis == 0):
            batch_buffer_data = numpy.vstack(batch_buffer_data)
        elif (data.time_axis == 1):
            batch_buffer_data = numpy.hstack(batch_buffer_data)
    elif (len(data.shape) == 3):
        if (data.sequence_axis == 0):
            batch_buffer_data = numpy.vstack(batch_buffer_data)
        elif (data.sequence_axis == 1):
            batch_buffer_data = numpy.hstack(batch_buffer_data)
        elif (data.sequence_axis == 2):
            batch_buffer_data = numpy.dstack(batch_buffer_data)
        if (self.data_format == 'channels_first'):
            batch_buffer_data = numpy.expand_dims(batch_buffer_data, axis=0)
        elif (self.data_format == 'channels_last'):
            batch_buffer_data = numpy.expand_dims(batch_buffer_data, axis=3)
    if (self.target_format == 'single_target_per_sequence'):
        batch_buffer_meta = numpy.vstack(batch_buffer_meta)
    elif (self.target_format == 'same'):
        batch_buffer_meta = numpy.hstack(batch_buffer_meta).T
    return (batch_buffer_data, batch_buffer_meta)
def __getitem__(self, index):
    start_index = (index * self.batch_size)
    stop_index = ((index + 1) * self.batch_size)
    batch_buffer_data = []
    batch_buffer_meta = []
    for item_index in range(start_index, stop_index):
        if (item_index < len(self.item_list)):
            item = self.item_list[item_index]
            (data, meta) = self.process_item(item=item)
            if self.transformer_callbacks:
                for callback in self.transformer_callbacks:
                    (data, meta) = callback(data=data, meta=meta)
            batch_buffer_data.append(data.data)
            if (self.target_format == 'single_target_per_sequence'):
                for i in range(0, data.shape[data.sequence_axis]):
                    batch_buffer_meta.append(meta.data[:, 0])
            elif (self.target_format == 'same'):
                batch_buffer_meta.append(numpy.repeat(a=meta.data, repeats=data.length, axis=1))
    if (len(data.shape) == 2):
        if (data.time_axis == 0):
            batch_buffer_data = numpy.vstack(batch_buffer_data)
        elif (data.time_axis == 1):
            batch_buffer_data = numpy.hstack(batch_buffer_data)
    elif (len(data.shape) == 3):
        if (data.sequence_axis == 0):
            batch_buffer_data = numpy.vstack(batch_buffer_data)
        elif (data.sequence_axis == 1):
            batch_buffer_data = numpy.hstack(batch_buffer_data)
        elif (data.sequence_axis == 2):
            batch_buffer_data = numpy.dstack(batch_buffer_data)
        if (self.data_format == 'channels_first'):
            batch_buffer_data = numpy.expand_dims(batch_buffer_data, axis=0)
        elif (self.data_format == 'channels_last'):
            batch_buffer_data = numpy.expand_dims(batch_buffer_data, axis=3)
    if (self.target_format == 'single_target_per_sequence'):
        batch_buffer_meta = numpy.vstack(batch_buffer_meta)
    elif (self.target_format == 'same'):
        batch_buffer_meta = numpy.hstack(batch_buffer_meta).T
    return (batch_buffer_data, batch_buffer_meta)