def ensure_plugin_compatibility(
    plugin_name, error_level=None, log_success=False
):
    """Ensures that the given plugin is compatible with your current FiftyOne
    package version.

    Args:
        plugin_name: the plugin name
        error_level (None): the error level to use, defined as:

            -   0: raise error if plugin is not compatible
            -   1: log warning if plugin is not satisfied
            -   2: ignore fiftyone compatibility requirements

            By default, ``fiftyone.config.requirement_error_level`` is used
        log_success (False): whether to generate a log message if the plugin is
            compatible
    """
    if error_level is None:
        error_level = fo.config.requirement_error_level

    pd = get_plugin(plugin_name)
    req_str = pd.fiftyone_requirement
    if req_str is None:
        return

    try:
        req = Requirement(req_str)
    except:
        logger.warning(
            f"Unable to understand plugin {plugin_name}'s fiftyone version '{pd.fiftyone_compatibility}'"
        )
        return

    if not req.specifier.contains(foc.VERSION):
        exception = ImportError(
            f"Plugin {plugin_name} requires {req_str} but you are running {foc.VERSION}, which is not compatible"
        )
        fou.handle_error(exception, error_level)
    elif log_success:
        logger.info(
            f"Plugin {plugin_name} is compatible: requires {req_str} (found {foc.VERSION})"
        )
Ensures that the given plugin is compatible with your current FiftyOne
    package version.

    Args:
        plugin_name: the plugin name
        error_level (None): the error level to use, defined as:

            -   0: raise error if plugin is not compatible
            -   1: log warning if plugin is not satisfied
            -   2: ignore fiftyone compatibility requirements

            By default, ``fiftyone.config.requirement_error_level`` is used
        log_success (False): whether to generate a log message if the plugin is
            compatible
    
fiftyone/plugins/core.py