def _normalize(v, desired_segments=0):
  """
  :param v: Input string of the form "#.#.#" or "#.#.#.#"
  :param desired_segments: If greater than 0, and if v has fewer segments this parameter, will pad v with segments
  containing "0" until the desired segments is reached.
  :return: Returns a list of integers representing the segments of the version
  """
  v_list = v.split(".")
  if desired_segments > 0 and len(v_list) < desired_segments:
    v_list = v_list + ((desired_segments - len(v_list)) * ["0", ])
  return [int(x) for x in v_list]