def get_index_values(df, level):
  """Gets index values from a DataFrame MultiIndex.

  Args:
    df: A DataFrame.
    level: The integer position of the level in the MultiIndex, or the name of
      the level.

  Returns:
    Vector of index values.
  """
  return df.index.get_level_values(level).values