def get_consumer(self, cfg):
        """Import and create a new instance of the configured message consumer.

        :param dict cfg: The named consumer section of the configuration
        :rtype: instance
        :raises: ImportError

        """
        try:
            consumer_, version = import_consumer(cfg['consumer'])
        except __HOLE__ as error:
            if PYTHON26:
                LOGGER.exception('Error importing the consumer %s: %s',
                                 cfg['consumer'], error)
            else:
                LOGGER.exception('Error importing the consumer %s: %s',
                                 cfg['consumer'], error,
                                 exc_info=sys.exc_info())
            return

        if version:
            LOGGER.info('Creating consumer %s v%s', cfg['consumer'], version)
        else:
            LOGGER.info('Creating consumer %s', cfg['consumer'])

        settings = cfg.get('config', dict())
        settings['_import_module'] = '.'.join(cfg['consumer'].split('.')[0:-1])

        try:
            return consumer_(settings=settings, process=self)
        except Exception as error:
            if PYTHON26:
                LOGGER.exception('Error creating the consumer "%s": %s',
                                 cfg['consumer'], error)
            else:
                LOGGER.exception('Error creating the consumer "%s": %s',
                                 cfg['consumer'], error,
                                 exc_info=sys.exc_info())
dataset/ETHPy150Open gmr/rejected/rejected/process.py/Process.get_consumer