def gen_fixture(user, indicator_set):
    """
    Example output:

    indicator_set.name = 'demo'
    indicator_set.get_data() = {'user_case1': {'indicator_a': 1, 'indicator_b': 2}}

    <fixture id="indicators:demo" user_id="...">
        <indicators>
            <case id="user_case1">
                <indicator_a>1</indicator_a>
                <indicator_b>2</indicator_2>
            </case>
        </indicators>
    </fixture>
    """
    name = indicator_set.name
    data = indicator_set.get_data()

    fixture = ElementTree.Element('fixture', attrib={
        'id': ':'.join((IndicatorsFixturesProvider.id, name)),
        'user_id': user.user_id,
        'date': indicator_set.reference_date.isoformat()
    })
    indicators_node = ElementTree.SubElement(fixture, 'indicators')
    for case_id, indicators in data.iteritems():
        group = ElementTree.SubElement(indicators_node, 'case', attrib={'id': case_id})
        for name, value in indicators.items():
            indicator = ElementTree.SubElement(group, name)
            indicator.text = str(value)

    return fixture
Return the resource corresponding to all calendar events.
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/callcenter/fixturegenerators.py/gen_fixture--crossover with--dataset/ETHPy150Open ducksboard/libsaas/libsaas/services/basecamp/calendars.py/Calendar.calendar_events