def quantile(data, column, q):
    """ Returns number of users responsible for a specific

    :param data: an input pd.Dataframe, e.g. commit_user_stats.reset_index()
        note that without index reset commit_user_stats is a Series
    :param column: a column to aggregate on, e.g. username
    :param q: quantile, e.g. 0.9
    :return: pd.Dataframe aggregated on the specified column
    >>> df = pd.DataFrame({'foo': 1, 'bar': [1,1,1,1,1,1,1,1,1,1]})
    >>> quantile(df, 'foo', 0.5).loc[1, 'bar']
    5
    >>> quantile(df, 'foo', 0.9).loc[1, 'bar']
    9
    """
    return data.groupby(column).aggregate(lambda x: sum(x.sort_values(
        ascending=False).cumsum() / x.sum() <= q))
