def METHOD_NAME(cls, listeners, method_names, prefix=None,
                     raise_on_error=False):
    imported = []
    for listener in listeners:
        try:
            imported.append(cls(listener, method_names, prefix))
        except DataError as err:
            name = listener if is_string(listener) else type_name(listener)
            msg = "Taking listener '%s' into use failed: %s" % (name, err)
            if raise_on_error:
                raise DataError(msg)
            LOGGER.error(msg)
    return imported