def class_names_indices_mapping(class_names):
    """
    Given list of class names, generate mapping from class names to class indices and vice versa.

    Parameters
    ----------
    class_names : list, optional
        List of class names. The order of names should correspond to class index at classifier output.

    Returns
    -------
    name_to_ind : dict
        Dictionary which maps from name to index.
    ind_to_name : dict
        Dictionary which maps from index to name.
    """

    name_to_ind = dict(zip(class_names, range(len(class_names))))
    ind_to_name = dict(zip(range(len(class_names)), class_names))

    return name_to_ind, ind_to_name