def METHOD_NAME(self):
    """Return True if we could need to compile the document."""
    if self._dirty:
        path = self.document().url().path()
        dinfo = documentinfo.docinfo(self.document())
        if (dinfo.mode() == "lilypond"
            and (path.endswith('.ly') or path == '')
            and dinfo.complete()
            and documentinfo.music(self.document()).has_output()):
            h = dinfo.token_hash()
            if h != self._hash:
                self._hash = h
                if h != hash(tuple()):
                    return True
        self._dirty = False