:param text:
    :type text: str
    :return:

def calculate_indent(text):
    """
    :param text:
    :type text: str
    :return:
    """
    indent = 0
    for c in text:
        if c is '\t':
            raise ValueError()
        if c is not ' ':
            return indent,text[indent:]
        indent += 1
    return indent,''