code: def expand_indent(line):
      r
      if '\t' not in line:
          return len(line) - len(line.lstrip())
      result = 0
      for char in line:
          if char == '\t':
              result = result // 8 * 8 + 8
          elif char == ' ':
              result += 1
          else:
              break
      return result
docs: r"""Return the amount of indentation.
  
      Tabs are expanded to the next multiple of 8.
  
      >>> expand_indent('    ')
      4
      >>> expand_indent('\t')
      8
      >>> expand_indent('       \t')
      8
      >>> expand_indent('        \t')
      16