def METHOD_NAME(self, definition_name: str) -> T_RepositoryLevelDefinition:
    check.str_param(definition_name, "definition_name")
    if not self.has_definition(definition_name):
        raise DagsterInvariantViolationError(
            "Could not find {definition_kind} '{definition_name}'. Found: "
            "{found_names}.".format(
                definition_kind=self._definition_kind,
                definition_name=definition_name,
                found_names=", ".join(
                    [f"'{found_name}'" for found_name in self.get_definition_names()]
                ),
            )
        )
    if definition_name in self._definition_cache:
        return self._definition_cache[definition_name]
    definition_source = self._definitions[definition_name]
    if isinstance(definition_source, self._definition_class):
        self._definition_cache[definition_name] = self._validation_fn(definition_source)
        return definition_source
    else:
        definition = cast(Callable, definition_source)()
        self._validate_and_cache_definition(definition, definition_name)
        return definition