<commit_before># coding=utf-8
# Filename: __init__.py
"""
A collection of pumps for different kinds of data formats.

"""
from __future__ import division, absolute_import, print_function

import os

from km3pipe.pumps.evt import EvtPump  # noqa
from km3pipe.pumps.daq import DAQPump  # noqa
from km3pipe.pumps.clb import CLBPump  # noqa
from km3pipe.pumps.aanet import AanetPump  # noqa
from km3pipe.pumps.jpp import JPPPump  # noqa
from km3pipe.pumps.ch import CHPump  # noqa
from km3pipe.pumps.hdf5 import HDF5Pump  # noqa
from km3pipe.pumps.hdf5 import HDF5Sink  # noqa
from km3pipe.pumps.pickle import PicklePump  # noqa

from km3pipe.logger import logging

__author__ = "<NAME>"
__copyright__ = "Copyright 2016, <NAME> and the KM3NeT collaboration."
__credits__ = []
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"


log = logging.getLogger(__name__)


def GenericPump(filename, use_jppy=False):
    """A generic pump which utilises the appropriate pump."""
    extension = os.path.splitext(filename)[1]

    pumps = {
            '.evt': EvtPump,
            '.h5': HDF5Pump,
            '.aa.root': AanetPump,
            '.root': JPPPump if use_jppy else AanetPump,
            '.dat': DAQPump,
            '.dqd': CLBPump,
            }

    if extension not in pumps:
        log.critical("No pump found for '{0}'".format(extension))

    return pumps[extension](filename=filename)<commit_msg>Add name parameter to generic pump<commit_after># coding=utf-8
# Filename: __init__.py
"""
A collection of pumps for different kinds of data formats.

"""
from __future__ import division, absolute_import, print_function

import os

from km3pipe.pumps.evt import EvtPump  # noqa
from km3pipe.pumps.daq import DAQPump  # noqa
from km3pipe.pumps.clb import CLBPump  # noqa
from km3pipe.pumps.aanet import AanetPump  # noqa
from km3pipe.pumps.jpp import JPPPump  # noqa
from km3pipe.pumps.ch import CHPump  # noqa
from km3pipe.pumps.hdf5 import HDF5Pump  # noqa
from km3pipe.pumps.hdf5 import HDF5Sink  # noqa
from km3pipe.pumps.pickle import PicklePump  # noqa

from km3pipe.logger import logging

__author__ = "<NAME>"
__copyright__ = "Copyright 2016, <NAME> and the KM3NeT collaboration."
__credits__ = []
__license__ = "MIT"
__maintainer__ = "<NAME>"
__email__ = "<EMAIL>"
__status__ = "Development"


log = logging.getLogger(__name__)


def GenericPump(filename, use_jppy=False, name="GenericPump"):
    """A generic pump which utilises the appropriate pump."""
    extension = os.path.splitext(filename)[1]

    pumps = {
            '.evt': EvtPump,
            '.h5': HDF5Pump,
            '.aa.root': AanetPump,
            '.root': JPPPump if use_jppy else AanetPump,
            '.dat': DAQPump,
            '.dqd': CLBPump,
            }

    if extension not in pumps:
        log.critical("No pump found for '{0}'".format(extension))

    return pumps[extension](filename=filename, name=name)
{'fraction_non_alphanumeric': 0.10501355013550136, 'fraction_numerical': 0.016260162601626018, 'mean_word_length': 3.460725075528701, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1173933', 'n_tokens_mistral': 1056, 'n_tokens_neox': 1015, 'n_words': 274}