def adapt(self, value):
        """Generic numeric coercion.

        :returns: an instance of :attr:`type_` or ``None``

        Attempt to convert *value* using the class's :attr:`type_` callable.

        """
        if value is None:
            return None
        if isinstance(value, basestring):
            value = value.strip()  # decimal.Decimal doesn't like whitespace
        try:
            native = self.type_(value)
        except (ValueError, __HOLE__, ArithmeticError):
            raise AdaptationError()
        else:
            if not self.signed:
                if native < 0:
                    raise AdaptationError()
            return native
dataset/ETHPy150Open jek/flatland/flatland/schema/scalars.py/Number.adapt