def prepare(self, obj, value):
        try:
            setattr(obj, self.determinant._name, self.type_map[type(value)])
        except __HOLE__:
            if not self.accept_missing:
                raise
        if isinstance(self.length, Field):
            setattr(obj, self.length._name, len(value.serialise()))
dataset/ETHPy150Open pebble/libpebble2/libpebble2/protocol/base/types.py/Union.prepare