def top_values(place_vals,
               num_to_include,
               is_top=True,
               is_comp=True):
  """Get the top values from place data.

  Args:
    place_vals: place values from chartdata_handlers.filter_place_obs_vals
    num_to_include: number of bars to include.
    is_top: is top stats to plot.
    is_comp: is the comparison stats to pick.

  Returns:
    sorted list of (place id, val) tuples
  """
  top_vals = []
  sorted_obs = sorted(place_vals.items(), key=lambda x: x[1], reverse=is_top)
  for i, (dcid, val) in enumerate(sorted_obs):
    if i < num_to_include or (is_comp and i == len(sorted_obs) - 1):
      top_vals.append((dcid, val))
  return top_vals