def query_by_external_samples(self, **kwds):
        counts = defaultdict(int)
        samples = self.sample_db.get_samples(self.n_samples, **kwds)
        if len(samples) == 0:
            raise NoSamplesInDB(
                'There are no samples in the database. '
                'Generate some with graph.generate_samples(N).')
        if self.n_samples < len(samples) and self.enforce_minimum_samples:
            raise InsufficientSamplesException(
                'There are less samples in the sampling '
                'database than are required by this graph. '
                'Either generate more samples '
                '(graph.generate_samples(N) or '
                'decrease the number of samples '
                'required for querying (graph.n_samples). ')
        for sample in samples:
            for name, val in sample.items():
                key = (name, val)
                counts[key] += 1
        normalized = dict(
            [(k, v / len(samples)) for k, v in counts.items()])
        return normalized
dataset/ETHPy150Open eBay/bayesian-belief-networks/bayesian/factor_graph.py/FactorGraph.query_by_external_samples/swapped operands of `<`