def __call__(self, func):
        if self.type_ is None:
            gen_func = self.__arbitrary_generator(func)
        else:
            def validate(value):
                if not isinstance(value, self.type_):
                    raise TypeError(
                        "arbitrary value %r is of type %s; expected %s" % (
                            value, type(value).__name__, self.type_.__name__))
                return value

            gen_func = self.__arbitrary_generator(func, validate)
            self.registry.setdefault(self.type_, [])
            self.registry[self.type_].append(gen_func)

        gen_func._arbitrary = True  # marker attribute
        return gen_func
Applies the @arbitrary decorator to given function.
dataset/ETHPy150Open Xion/pyqcy/pyqcy/arbitraries/__init__.py/arbitrary.__call__