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