def get_index_levels_codes(df, level):
    """Return the category-values and codes for a specific level"""
    level = df.index._get_level_number(level)
    return df.index.levels[level], df.index.codes[level]