def add_entry_to_stats(results, project_id, episode_id, task_type_id,
    task_status_id, task_status_short_name, task_status_color, task_count,
    entity_nb_frames):
    """
    Add to stats results, information of given count for given entity, task
    type and task satus.
    """
    episode_id = str(episode_id)
    task_type_id = str(task_type_id)
    task_status_id = str(task_status_id)
    results.setdefault(episode_id, {})
    results[episode_id].setdefault(task_type_id, {})
    results[episode_id][task_type_id].setdefault(task_status_id, {})
    results[episode_id][task_type_id][task_status_id] = {'name':
        task_status_short_name, 'color': task_status_color, 'count':
        task_count, 'frames': entity_nb_frames or 0}
    results[episode_id].setdefault('all', {})
    results[episode_id]['all'].setdefault(task_status_id, {'name':
        task_status_short_name, 'color': task_status_color, 'count': 0,
        'frames': 0})
    results[episode_id]['all'][task_status_id]['count'] += task_count or 0
    results[episode_id]['all'][task_status_id]['frames'
        ] += entity_nb_frames or 0
