def add_range(self, field_name, rel, value):
        if rel not in self.range_query_templates:
            raise scorched.exc.SolrError("No such relation '%s' defined" % rel)
        insts = (value,)
        if rel in ('range', 'rangeexc'):
            try:
                assert len(value) == 2
            except (__HOLE__, TypeError):
                raise scorched.exc.SolrError(
                    "'%s__%s' argument must be a length-2 iterable" % (
                        field_name, rel))
        elif rel == 'any':
            if value is not True:
                raise scorched.exc.SolrError("'%s__%s' argument must be True")
            insts = ()
        self.ranges.add((field_name, rel, insts))
dataset/ETHPy150Open lugensa/scorched/scorched/search.py/LuceneQuery.add_range