import csv


def resolve_scenarios(scenario_string):
    """Convert a comma-separated string of scenarios into a set of scenarios

    Scenarios can be specified as either scenario names (optionally quoted)
    or scenario indexes."""

    scenario_string = scenario_string.strip()
    if not scenario_string:
        return []

    scenario_parser = csv.reader([scenario_string])
    scenarios = next(scenario_parser)
    scenarios = {
        int(s) if s.isdigit() else s for s in scenarios
    }
    return scenarios