<qiyuangong>408_Valid_Word_Abbreviation_1.py
def validWordAbbreviation( word, abbr):
    if word == abbr:
        return True
    pos1 = pos2 = 0
    curr = 0
    while pos1 < len(abbr) and pos2 < len(word):
        try:
            num = int(abbr[pos1])
            
            if num == 0 and curr == 0:
                return False
            curr = curr * 10 + num
        except ValueError:
            if curr > 0:
                pos2 += curr
            
            if pos2 >= len(word):
                return False
            curr = 0
            if abbr[pos1] != word[pos2]:
                return False
            pos2 += 1
        pos1 += 1
    
    if curr > 0:
        pos2 += curr
    if pos1 == len(abbr) and pos2 == len(word):
        return True
    return False
def sample_funcname ( var_0 , var_1 ) :
    if var_0 == var_1 :
        return True
    var_5 = var_3 = 0
    var_6 = 0
    while var_5 < len ( var_1 ) and var_3 < len ( var_0 ) :
        try :
            var_9 = int ( var_1 [ var_5 ] )
            if var_9 == 0 and var_6 == 0 :
                return False
            var_6 = var_6 * 10 + var_9
        except ValueError :
            if var_6 > 0 :
                var_3 += var_6
            if var_3 >= len ( var_0 ) :
                return False
            var_6 = 0
            if var_1 [ var_5 ] != var_0 [ var_3 ] :
                return False
            var_3 += 1
        var_5 += 1
    if var_6 > 0 :
        var_3 += var_6
    if var_5 == len ( var_1 ) and var_3 == len ( var_0 ) :
        return True
    return False
