def adapt(self, value):
        """Coerces value to a native type.

        If *value* is an instance of :attr:`type_`, returns it unchanged.  If
        a string, attempts to parse it and construct a :attr:`type` as
        described in the attribute documentation.

        """
        if value is None:
            return value
        elif isinstance(value, self.type_):
            return value
        elif isinstance(value, basestring):
            if self.strip:
                value = value.strip()
            match = self.regex.match(value)
            if not match:
                raise AdaptationError()
            try:
                args = [int(match.group(f)) for f in self.used]
                return self.type_(*args)
            except (TypeError, __HOLE__):
                raise AdaptationError()
        else:
            raise AdaptationError()
dataset/ETHPy150Open jek/flatland/flatland/schema/scalars.py/Temporal.adapt