<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def percent_initiated_interactions(records, user):
 """ The percentage of calls initiated by the user. """

    if len(records) == 0:
        return 0

    initiated = sum(1 for r in records if r.direction == 'out')
    return initiated / len(records)