def get_calender_ids_from_list(email, calendar_list):
    """
    Parse calendar_list and to retrieve calendar_ids, separated
    to active and deleted

    Response:
    {
      "active":["id1","id2"],
      "deleted":["id3","id4"]
    }
    """
    assert calendar_list['items']

    response = {}
    response['email'] = email
    response['active'] = []
    response['deleted'] = []

    for item in calendar_list['items']:

        if 'deleted' in item.keys():
            if item['deleted']:
                response['deleted'].append(item['id'])
            else:
                response['active'].append(item['id'])
        else:
            response['active'].append(item['id'])

    return response