def mode_str_to_int(modestr):
    mode = 0
    for iteration, char in enumerate(reversed(modestr[-6:])):
        mode += int(char) << iteration * 3
    # END for each char
    return mode
:param modestr: string like 755 or 644 or 100644 - only the last 6 chars will be used
dataset/ETHPy150Open gitpython-developers/GitPython/git/objects/util.py/mode_str_to_int