def _get_modified_counts(issue):
  """Helper to determine the modified line counts of the latest patch set."""
  modified_added_count = 0
  modified_removed_count = 0

  # Count the modified lines in the patchset.
  patchsets = list(issue.patchsets)
  if patchsets:
    for patch in patchsets[-1].patches:
      modified_added_count += patch.num_added
      modified_removed_count += patch.num_removed

  return modified_added_count, modified_removed_count