def _fill_el_planning_free(el_planning, starttime, endtime):
    """An internal function to compute the planning free of all elements"""
    if len(el_planning['busy']) > 0:
        if el_planning['busy'][0][0] > starttime:
            el_planning['free'].append((starttime, el_planning['busy'][0][0]))
        for i in range(0, len(el_planning['busy']) - 1):
            el_planning['free'].append((el_planning['busy'][i][1],
                el_planning['busy'][i + 1][0]))
        if el_planning['busy'][len(el_planning['busy']) - 1][1] < endtime:
            el_planning['free'].append((el_planning['busy'][len(el_planning
                ['busy']) - 1][1], endtime))
    else:
        el_planning['free'].append((starttime, endtime))
