def _interventions(chat, index_date, msg_length):
    """Get number of interventions per day per user

    Args:
        WhatsAppChat: Chat instance.

    Returns: 
        pandas.DataFrame: Table with interventions per day per user.

    """
    if msg_length:
        counts_ = chat.df.copy()
        counts_['message_length'] = counts_['message'].apply(lambda x: len(x))
        counts = counts_.groupby(by=index_date + ['username']).agg({
            'message_length': lambda x: x.sum()})
    else:
        counts = chat.df.groupby(by=index_date + ['username']).agg('count')
    counts = counts.unstack(fill_value=0)
    return counts
