def import_consumer(value):
    """Pass in a string in the format of foo.Bar, foo.bar.Baz, foo.bar.baz.Qux
    and it will return a handle to the class

    :param str value: The consumer class in module.Consumer format
    :return: tuple(Class, str)

    """
    parts = value.split('.')
    import_name = '.'.join(parts[0:-1])
    import_handle = importlib.import_module(import_name)
    version = None
    if hasattr(import_handle, '__version__'):
        version = import_handle.__version__
    elif len(parts) > 2:
        package_handle = importlib.import_module(parts[0])
        if hasattr(package_handle, '__version__'):
            version = package_handle.__version__

    # Return the class handle
    return getattr(import_handle, parts[-1]), version
dataset/ETHPy150Open gmr/rejected/rejected/process.py/import_consumer/original