@classmethod
    def _from_block_and_mapping(cls, block, mapping):
        def _normalize(val):
            if isinstance(val, list):
                # if we get multiple updates, they look like a list. 
                # normalize these by taking the last item
                return val[-1]
            return val
        
        kwargs = {}
        dynamic_properties = {}
        # if not a dict, it's probably an empty close block
        if isinstance(block, dict):
            for k, v in block.items():
                if mapping in k:
                    kwargs[mapping[k]] = v
                else:
                    dynamic_properties[k] = _normalize(v)
        
        return cls(block, dynamic_properties=dynamic_properties,
                   **kwargs)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/ex-submodules/casexml/apps/case/xml/parser.py/CaseActionBase._from_block_and_mapping/swapped operands of `in`