def series_index_by_value(series, value):
    """Returns the index or indices of a pandas series that correspond to a certain value.

    Parameters
    ----------
    series: pandas.Series
        A pandas Series object
    value
        The value for which the index should be returned

    Returns
    -------
    Any
        The index at which this value occurs. If the value occurs multiple times, a list of indices is returned. If the
        value is not in the series, None is returned.
    """
    ret = series[series == value].index
    if len(ret) == 1:
        return ret[0]
    elif len(ret) > 1:
        return ret
    else:
        return None