def get_line_indentation_spaces(line, tab_spaces=4):
    """Return the number of spaces chars the line begin with

    :param str line: the line string to parse
    :param int tab_spaces: The tab char is represent how many spaces
    """
    if not line or len(line) < tab_spaces:
        return 0
    spaces = 0
    for char in line:
        if char not in (' ', '\t'):
            break
        if char == '\t':
            spaces += tab_spaces
        else:
            spaces += 1
    return spaces
