def METHOD_NAME(self) -> int:
    if self._lines[0].strip().startswith("#version"):
        try:
            return int(self._lines[0].split()[1])
        except Exception:
            pass
    source = "\n".join(
        f"{str(i+1).zfill(3)}: {line} " for i, line in enumerate(self._lines)
    )
    raise ShaderException(
        (
            "Cannot find #version in shader source. "
            "Please provide at least a #version 330 statement in the beginning of the shader.\n"
            f"---- [{SHADER_TYPE_NAMES[self._type]}] ---\n"
            f"{source}"
        )
    )