count the number of spaces that precede a non-space token (not including
  empty string tokens) in a string.

  :param space_s_pres_split: the string, split into tokens around spaces,
                             but with the spaces conserved as tokens.

def _rm_compute_leading_space(space_s_pres_split):
  """
  count the number of spaces that precede a non-space token (not including
  empty string tokens) in a string.

  :param space_s_pres_split: the string, split into tokens around spaces,
                             but with the spaces conserved as tokens.
  """
  i = 0
  c = 0
  while (i < len(space_s_pres_split) and
         (space_s_pres_split[i].isspace() or
         (space_s_pres_split[i] == ""))):
    c += len(space_s_pres_split[i])
    i += 1
  return c