def addConstraint(self, func):
        """
        Add a global filter constraint to the graph pattern. 'func'
        must be a method with a single input parameter (a dictionary)
        returning a boolean. This method is I{added} to previously
        added methods, ie, I{all} methods must return True to accept a
        binding.

        :param func: filter function

        """

        if type(func) == FunctionType:
            self.constraints.append(func)
        else:
            raise SPARQLError(
                type(func) % "illegal argument, constraint must be a function type, got %s")
dataset/ETHPy150Open RDFLib/rdfextras/rdfextras/sparql/graph.py/GraphPattern.addConstraint/swapped operands of `%`