code: def _parse_string_to_list_of_pairs(s, seconds_to_int=False):
    r
    ret = []
    for p in [s.split(":") for s in re.sub("[,.;]", " ", s).split()]:
      if len(p) != 2:
        raise ValueError("bad input to _parse_string_to_list_of_pairs %s" % s)
      if seconds_to_int:
        ret.append((p[0], int(p[1])))
      else:
        ret.append(tuple(p))
    return ret
docs: r"""Parses a string into a list of pairs.
  
    In the input string, each pair is separated by a colon, and the delimiters
    between pairs are any of " ,.;".
  
    e.g. "rows:32,cols:32"
  
    Args:
      s: str to parse.
      seconds_to_int: Boolean. If True, then the second elements are returned
        as integers;  otherwise they are strings.
  
    Returns:
      List of tuple pairs.
  
    Raises:
      ValueError: Badly formatted string.