def METHOD_NAME(cursor):
    """Return the variable name the cursor's music expression is assigned to.
    If the music is in a \\score instead, "\\score" is returned.
    Returns None if no variable name can be found.
    """
    block = cursor.block()
    while block.isValid():
        state = tokeniter.state(block)
        if isinstance(state.parser(), ly.lex.lilypond.ParseGlobal):
            for t in tokeniter.tokens(block)[:2]:
                if type(t) is ly.lex.lilypond.Name:
                    return t[:]
                elif isinstance(t, ly.lex.lilypond.Keyword) and t == '\\score':
                    return '\\score'
        block = block.previous()