def data_collector(item_list=None, data_processing_chain=None, meta_processing_chain=None, target_format='single_target_per_sequence', channel_dimension='channels_last', verbose=True, print_indent=2):
    "Data collector\n\n    Collects data and meta into matrices while processing them through processing chains.\n\n    Parameters\n    ----------\n    item_list : list or dict\n        Items in the data sequence. List containing multi-level dictionary with first level key\n        'data' and 'meta'. Second level should contain parameters for process method in the processing chain.\n        Default value None\n\n    data_processing_chain : ProcessingChain\n        Data processing chain.\n        Default value None\n\n    meta_processing_chain : ProcessingChain\n        Meta processing chain.\n        Default value None\n\n    channel_dimension : str\n        Controls where channel dimension should be added. Similar to Keras data format parameter.\n        If None given, no channel dimension is added.\n        Possible values [None, 'channels_first', 'channels_last']\n        Default value None\n\n    target_format : str\n        Meta data interpretation in the relation to the data items.\n        Default value 'single_target_per_segment'\n\n    verbose : bool\n        Print information about the data\n        Default value True\n\n    print_indent : int\n        Default value 2\n\n    Returns\n    -------\n    numpy.ndarray\n        data\n\n    numpy.ndarray\n        meta\n\n    dict\n        data size information\n\n    "
    if item_list:
        X = []
        Y = []
        for item in item_list:
            data = data_processing_chain.process(**item['data'])
            meta = meta_processing_chain.process(**item['meta'])
            X.append(data.data)
            if (target_format == 'single_target_per_sequence'):
                for i in range(0, data.shape[data.sequence_axis]):
                    Y.append(meta.data[:, 0])
            elif (target_format == 'same'):
                Y.append(numpy.repeat(a=meta.data, repeats=data.length, axis=1).T)
        data_size = {}
        if (len(data.shape) == 2):
            if (data.time_axis == 0):
                X = numpy.vstack(X)
                Y = numpy.vstack(Y)
            else:
                X = numpy.hstack(X)
                Y = numpy.hstack(Y)
            data_size = {'data': X.shape[data.data_axis], 'time': X.shape[data.time_axis]}
        elif (len(data.shape) == 3):
            if (data.sequence_axis == 0):
                X = numpy.vstack(X)
                Y = numpy.vstack(Y)
            elif (data.sequence_axis == 1):
                X = numpy.hstack(X)
                Y = numpy.hstack(Y)
            elif (data.sequence_axis == 2):
                X = numpy.dstack(X)
                Y = numpy.dstack(Y)
            if channel_dimension:
                if (channel_dimension == 'channels_first'):
                    X = numpy.expand_dims(X, axis=1)
                elif (channel_dimension == 'channels_last'):
                    X = numpy.expand_dims(X, axis=3)
            data_size = {'data': X.shape[data.data_axis], 'time': X.shape[data.time_axis], 'sequence': X.shape[data.sequence_axis]}
        if verbose:
            data_shape = data.shape
            data_axis = {'time_axis': data.time_axis, 'data_axis': data.data_axis}
            if hasattr(data, 'sequence_axis'):
                data_axis['sequence_axis'] = data.sequence_axis
            meta_shape = meta.shape
            meta_axis = {'time_axis': meta.time_axis, 'data_axis': meta.data_axis}
            if hasattr(meta, 'sequence_axis'):
                meta_axis['sequence_axis'] = meta.sequence_axis
            logger = FancyLogger()
            logger.line('Data', indent=print_indent)
            logger.data(field='Matrix shape', value=X.shape, indent=(print_indent + 2))
            logger.data(field='Item shape', value=data_shape, indent=(print_indent + 2))
            logger.data(field='Time', value=data_shape[data_axis['time_axis']], indent=(print_indent + 4))
            logger.data(field='Data', value=data_shape[data_axis['data_axis']], indent=(print_indent + 4))
            if ('sequence_axis' in data_axis):
                logger.data(field='Sequence', value=data_shape[data_axis['sequence_axis']], indent=(print_indent + 4))
            logger.line('Meta', indent=print_indent)
            logger.data(field='Matrix shape', value=Y.shape, indent=(print_indent + 2))
            logger.data(field='Item shape', value=meta_shape, indent=(print_indent + 2))
            logger.data(field='Time', value=meta_shape[meta_axis['time_axis']], indent=(print_indent + 4))
            logger.data(field='Data', value=meta_shape[meta_axis['data_axis']], indent=(print_indent + 4))
            if ('sequence_axis' in meta_axis):
                logger.data(field='Sequence', value=meta_shape[meta_axis['sequence_axis']], indent=(print_indent + 4))
        return (X, Y, data_size)
Data collector

Collects data and meta into matrices while processing them through processing chains.

Parameters
----------
item_list : list or dict
    Items in the data sequence. List containing multi-level dictionary with first level key
    'data' and 'meta'. Second level should contain parameters for process method in the processing chain.
    Default value None

data_processing_chain : ProcessingChain
    Data processing chain.
    Default value None

meta_processing_chain : ProcessingChain
    Meta processing chain.
    Default value None

channel_dimension : str
    Controls where channel dimension should be added. Similar to Keras data format parameter.
    If None given, no channel dimension is added.
    Possible values [None, 'channels_first', 'channels_last']
    Default value None

target_format : str
    Meta data interpretation in the relation to the data items.
    Default value 'single_target_per_segment'

verbose : bool
    Print information about the data
    Default value True

print_indent : int
    Default value 2

Returns
-------
numpy.ndarray
    data

numpy.ndarray
    meta

dict
    data size information
def data_collector(item_list=None, data_processing_chain=None, meta_processing_chain=None, target_format='single_target_per_sequence', channel_dimension='channels_last', verbose=True, print_indent=2):
    "Data collector\n\n    Collects data and meta into matrices while processing them through processing chains.\n\n    Parameters\n    ----------\n    item_list : list or dict\n        Items in the data sequence. List containing multi-level dictionary with first level key\n        'data' and 'meta'. Second level should contain parameters for process method in the processing chain.\n        Default value None\n\n    data_processing_chain : ProcessingChain\n        Data processing chain.\n        Default value None\n\n    meta_processing_chain : ProcessingChain\n        Meta processing chain.\n        Default value None\n\n    channel_dimension : str\n        Controls where channel dimension should be added. Similar to Keras data format parameter.\n        If None given, no channel dimension is added.\n        Possible values [None, 'channels_first', 'channels_last']\n        Default value None\n\n    target_format : str\n        Meta data interpretation in the relation to the data items.\n        Default value 'single_target_per_segment'\n\n    verbose : bool\n        Print information about the data\n        Default value True\n\n    print_indent : int\n        Default value 2\n\n    Returns\n    -------\n    numpy.ndarray\n        data\n\n    numpy.ndarray\n        meta\n\n    dict\n        data size information\n\n    "
    if item_list:
        X = []
        Y = []
        for item in item_list:
            data = data_processing_chain.process(**item['data'])
            meta = meta_processing_chain.process(**item['meta'])
            X.append(data.data)
            if (target_format == 'single_target_per_sequence'):
                for i in range(0, data.shape[data.sequence_axis]):
                    Y.append(meta.data[:, 0])
            elif (target_format == 'same'):
                Y.append(numpy.repeat(a=meta.data, repeats=data.length, axis=1).T)
        data_size = {}
        if (len(data.shape) == 2):
            if (data.time_axis == 0):
                X = numpy.vstack(X)
                Y = numpy.vstack(Y)
            else:
                X = numpy.hstack(X)
                Y = numpy.hstack(Y)
            data_size = {'data': X.shape[data.data_axis], 'time': X.shape[data.time_axis]}
        elif (len(data.shape) == 3):
            if (data.sequence_axis == 0):
                X = numpy.vstack(X)
                Y = numpy.vstack(Y)
            elif (data.sequence_axis == 1):
                X = numpy.hstack(X)
                Y = numpy.hstack(Y)
            elif (data.sequence_axis == 2):
                X = numpy.dstack(X)
                Y = numpy.dstack(Y)
            if channel_dimension:
                if (channel_dimension == 'channels_first'):
                    X = numpy.expand_dims(X, axis=1)
                elif (channel_dimension == 'channels_last'):
                    X = numpy.expand_dims(X, axis=3)
            data_size = {'data': X.shape[data.data_axis], 'time': X.shape[data.time_axis], 'sequence': X.shape[data.sequence_axis]}
        if verbose:
            data_shape = data.shape
            data_axis = {'time_axis': data.time_axis, 'data_axis': data.data_axis}
            if hasattr(data, 'sequence_axis'):
                data_axis['sequence_axis'] = data.sequence_axis
            meta_shape = meta.shape
            meta_axis = {'time_axis': meta.time_axis, 'data_axis': meta.data_axis}
            if hasattr(meta, 'sequence_axis'):
                meta_axis['sequence_axis'] = meta.sequence_axis
            logger = FancyLogger()
            logger.line('Data', indent=print_indent)
            logger.data(field='Matrix shape', value=X.shape, indent=(print_indent + 2))
            logger.data(field='Item shape', value=data_shape, indent=(print_indent + 2))
            logger.data(field='Time', value=data_shape[data_axis['time_axis']], indent=(print_indent + 4))
            logger.data(field='Data', value=data_shape[data_axis['data_axis']], indent=(print_indent + 4))
            if ('sequence_axis' in data_axis):
                logger.data(field='Sequence', value=data_shape[data_axis['sequence_axis']], indent=(print_indent + 4))
            logger.line('Meta', indent=print_indent)
            logger.data(field='Matrix shape', value=Y.shape, indent=(print_indent + 2))
            logger.data(field='Item shape', value=meta_shape, indent=(print_indent + 2))
            logger.data(field='Time', value=meta_shape[meta_axis['time_axis']], indent=(print_indent + 4))
            logger.data(field='Data', value=meta_shape[meta_axis['data_axis']], indent=(print_indent + 4))
            if ('sequence_axis' in meta_axis):
                logger.data(field='Sequence', value=meta_shape[meta_axis['sequence_axis']], indent=(print_indent + 4))
        return (X, Y, data_size)