def METHOD_NAME(self, key: str) -> Type[T]:
    self._materialize_entrypoints()
    if _is_importable(key):
        # If the key contains a dot or colon, we treat it as a import path and attempt
        # to load it dynamically.
        MyClass = import_path(key)
        self._check_cls(MyClass)
        return MyClass
    if key in self._aliases:
        real_key, fn = self._aliases[key]
        fn()
        return self.METHOD_NAME(real_key)
    if key not in self._mapping:
        raise KeyError(f"Did not find a registered class for {key}")
    tp = self._ensure_not_lazy(key)
    if isinstance(tp, ModuleNotFoundError):
        raise ConfigurationError(
            f"{key} is disabled; try running: pip install '{__package_name__}[{key}]'"
        ) from tp
    elif isinstance(tp, Exception):
        raise ConfigurationError(
            f"{key} is disabled due to an error in initialization"
        ) from tp
    else:
        # If it's not an exception, then it's a registered type.
        return tp