def qualifications(config):
    """Format participant qualificiations"""
    qualifications = []

    # Country of origin
    cfg = config['crowdsource']['filter']
    if 'countries' in cfg:
        locales = [{'Country': country} for country in cfg['countries']]
        qualifications.append({
            'QualificationTypeId': '00000000000000000071',
            'Comparator': 'In',
            'LocaleValues': locales,
            'RequiredToPreview': True})

    # Number of approved tasks
    if 'approved_tasks' in cfg and cfg['approved_tasks'] > 0:
        qualifications.append({
            'QualificationTypeId': '00000000000000000040',
            'Comparator': 'GreaterThan',
            'IntegerValues': [cfg['approved_tasks']],
            'RequiredToPreview': True})

    # Approval rating
    if 'approval_rating' in cfg and cfg['approval_rating'] > 0:
        qualifications.append({
            'QualificationTypeId': '000000000000000000L0',
            'Comparator': 'GreaterThanOrEqualTo',
            'IntegerValues': [cfg['approval_rating']],
            'RequiredToPreview': True})

    return qualifications