def get_cm(unique_vals):
    """Returns a class mapping based on the unique values.

    The unique values must be created by Pandas' `unique()` method.

    Format: {'label_1': 0, 'label_2': 1, ...}
    """
    return {val: i for i, val in enumerate(unique_vals) if isinstance(val, str)}