<qiyuangong>408_Valid_Word_Abbreviation_2.py
def validWordAbbreviation( word, abbr):
    pos = curr = 0
    for i in range(len(abbr)):
        try:
            num = int(abbr[i])
            if num == 0 and curr == 0:
                return False
            curr = curr * 10 + num
        except ValueError:
            pos += curr
            curr = 0
            if pos >= len(word):
                return False
            if word[pos] != abbr[i]:
                return False
            pos += 1
    pos += curr
    if pos == len(word):
        return True
    return False
def sample_funcname ( var_0 , var_1 ) :
    var_4 = var_2 = 0
    for var_7 in range ( len ( var_1 ) ) :
        try :
            var_9 = int ( var_1 [ var_7 ] )
            if var_9 == 0 and var_2 == 0 :
                return False
            var_2 = var_2 * 10 + var_9
        except ValueError :
            var_4 += var_2
            var_2 = 0
            if var_4 >= len ( var_0 ) :
                return False
            if var_0 [ var_4 ] != var_1 [ var_7 ] :
                return False
            var_4 += 1
    var_4 += var_2
    if var_4 == len ( var_0 ) :
        return True
    return False
