def METHOD_NAME(template_path: str, raise_validation_err: bool = True) -> dict:
    try:
        template_dict = transform_comments(yaml.load(open(template_path)))
        template_type = template_dict.get("template_type")
        if template_type and template_type not in ["NOQ::Core::Config"]:
            template_dict["file_path"] = template_path
            return template_dict
    except ScannerError as err:
        log.critical(
            "Invalid template structure", file_path=template_path, error=repr(err)
        )
        if raise_validation_err:
            raise ValueError(f"{template_path} template has validation error.") from err