def to_native(self, value, context=None):
        if isinstance(value, StateTypeObject):
            return value
        try:
            return STATE_TYPES.values()[int(value)]
        except __HOLE__:
            try:
                return STATE_TYPES[value.lower()]
            except KeyError:
                raise ValidationError(self.messages['choices'].format(
                    unicode(self.choices)))
dataset/ETHPy150Open cloudtools/nymms/nymms/schemas/types/__init__.py/StateTypeType.to_native