def METHOD_NAME(name, version):
    import sys
    from packaging.version import Version
    from .core.preferences import prefs
    from .utils.logger import get_logger
    logger = get_logger(__name__)
    module = sys.modules[name]
    if not isinstance(module.__version__, str):  # mocked module
        return
    if not Version(module.__version__) >= Version(version):
        message = (
            f"{name} is outdated (got version {module.__version__}, need version"
            f" {version})"
        )
        if prefs.core.outdated_dependency_error:
            raise ImportError(message)
        else:
            logger.warn(message, "outdated_dependency")