@grouping(user_kwd=True, interaction='call')
def percent_initiated_interactions(records, user):
    records = list(records)

    if len(records) == 0:
        return 0

    initiated = sum(1 for r in records if r.direction == 'out')
    return float(initiated) / len(records)
The percentage of calls initiated by the user.
dataset/ETHPy150Open yvesalexandre/bandicoot/bandicoot/individual.py/percent_initiated_interactions