def _from_base_type(self, value):
        value = int(value, 16)
        if 2 ** (self._bits - 1) >= value:
            value -= 2 ** self._bits
        return value


# Define an entity class holding some long integers.
dataset/ETHPy150Open GoogleCloudPlatform/python-docs-samples/appengine/ndb/property_subclasses/my_models.py/BoundedLongIntegerProperty._from_base_type/swapped operands of `>=`