def METHOD_NAME(package: str) -> bool:
    if '|' in package:
        return any(METHOD_NAME(p) for p in package.split('|'))
    req = Requirement(package)
    if find_spec(req.name) is None:
        return False
    module = import_module(req.name)
    if not hasattr(module, '__version__'):
        return True
    version = module.__version__
    # `req.specifier` does not support `.dev` suffixes, e.g., for
    # `pyg_lib==0.1.0.dev*`, so we manually drop them:
    if '.dev' in version:
        version = '.'.join(version.split('.dev')[:-1])
    return version in req.specifier