def get_cases(category_name, category_value, samples):
    """Return sets for case and control sample names."""
    cases, controls = set(), set()
    for sample in samples:
        if sample['metadata'][category_name] == category_value:
            cases.add(sample['name'])
            continue
        controls.add(sample['name'])
    return cases, controls