def _get_event_data_values(self, xform, data_element_names):
        """
        Return event dataElement-value pairs.

        The data_element_names map caters for both a simple mapping, and
        mapping dropdown field-value tuples to DHIS2 boolean dataElements. See
        RISK_ASSESSMENT_EVENT_FIELDS for an example.
        """
        # data_values = [{
        #     'dataElement': self._data_elements[element_name],
        #     'value': xform.form[field_name],
        # } for field_name, element_name in data_element_names.iteritems() if field_name in xform.form]
        data_values = []
        for field, element_name in data_element_names.iteritems():
            if isinstance(field, tuple):
                # field is (field_name, field_value) where field_value is one of many checkboxes
                field_name, field_value = field
                # e.g. xform.form['multi-select_field'] == 'checkbox_one checkbox_two checkbox_five'
                if field_value in xform.form.get(field_name, '').split():
                    data_values.append({
                        'dataElement': self._data_elements[element_name],
                        'value': True
                    })
            else:
                if xform.form in field:
                    data_values.append({
                        'dataElement': self._data_elements[element_name],
                        'value': xform.form[field]
                    })
        return data_values
dataset/ETHPy150Open dimagi/commcare-hq/custom/dhis2/models.py/Dhis2Api._get_event_data_values/swapped operands of `in`