def has(cls, registry_name: str, func_name: str) -> bool:
        """Check whether a function is available in a registry."""
        cls.ensure_populated()
        if not hasattr(cls, registry_name):
            return False
        reg = getattr(cls, registry_name)
        if func_name.startswith("spacy."):
            legacy_name = func_name.replace("spacy.", "spacy-legacy.")
            return func_name in reg or legacy_name in reg
        return func_name in reg
Check whether a function is available in a registry.
spacy/util.py