def _do_checks(self):
        assert not self.weights or (len(self.weights) is 4 and all(map(
            lambda x: isinstance(x, (int, float)),
            self.weights
        ))), 'weights must be of length 4 and type float or integer'

        assert not self.normalization or all(map(
            lambda x: (isinstance(x, int) and x in self.NORMALIZATION),
            self.normalization
        )), 'normalization must be in (%s)' % (
            ', '.join('%d' % i for i in self.NORMALIZATION))
        assert len(self.extra) == 1, 'to many arguments for %s' % (
            self.__class__.__name__)
        if self.srt_lookup not in TSVectorBaseField.valid_lookups:
            raise exceptions.FieldError(
                "The '%s' isn't valid Lookup for %s" % (
                    self.srt_lookup, self.__class__.__name__))
dataset/ETHPy150Open dvdmgl/django-pg-fts/pg_fts/ranks.py/RankBase._do_checks/original