code: def get_indent(text):
      
      indent = ''
  
      ret = re.match(r'(\s*)', text)
      if ret:
          indent = ret.group(1)
  
      return indent
docs: Get indent of text.
  
      https://stackoverflow.com/questions/2268532/grab-a-lines-whitespace-
      indention-with-python