def _count_leading(line, ch):
 (i, n) = (0, len(line))
 while ((i < n) and (line[i] == ch)):
  i += 1
 return i

def _count_leading ( line , ch ) : ( i , n ) = ( 0 , len ( line ) ) while ( ( i < n ) and ( line [ i ] == ch ) ) : i += 1 return i
return number of ch characters at the start of line .