How to use _check_threshold method in lisa

Best Python code snippet using lisa_python

slow.py

Source:slow.py Github

copy

Full Screen

...65 results = tanimoto_search(queries, targets, threshold)66 for i, (id, hits) in enumerate(results):67 results[i] = (id, heapq.nlargest(k, hits, key = operator.itemgetter(1)))68 return results69def _check_threshold(threshold):70 if not (0.0 <= threshold <= 1.0):71 raise ValueError("threshold must between 0.0 and 1.0, inclusive")72class SlowFingerprints(Fingerprints):73 def count_tanimoto_hits_fp(self, query_fp, threshold=0.7):74 if not (0.0 <= threshold <= 1.0):75 raise ValueError("threshold must between 0.0 and 1.0, inclusive")76 return count_tanimoto_hits_fp(query_fp, self._id_fp_pairs, threshold)77 def id_count_tanimoto_hits(self, queries, threshold=0.7, batch_size=100):78 _check_threshold(threshold)79 for query_arena in queries.iter_arenas(batch_size):80 for result in count_tanimoto_hits(query_arena, self._id_fp_pairs, threshold):81 yield result82 def id_threshold_tanimoto_search_fp(self, fp, threshold=0.7):83 _check_threshold(threshold)84 return threshold_tanimoto_search_fp(fp, self._id_fp_pairs, threshold)85 def id_threshold_tanimoto_search(self, queries, threshold=0.7, batch_size=100):86 _check_threshold(threshold)87 for query_arena in queries.iter_arenas(batch_size):88 for result in threshold_tanimoto_search(query_arena, self._id_fp_pairs,89 threshold): 90 yield result91 def id_knearest_tanimoto_search_fp(self, fp, k=3, threshold=0.7):92 if k < 0:93 raise ValueError("k must be non-negative")94 _check_threshold(threshold)95 return knearest_tanimoto_search_fp(fp, self._id_fp_pairs, k, threshold)96 def id_knearest_tanimoto_search(self, queries, k=3, threshold=0.7, batch_size=100):97 if k < 0:98 raise ValueError("k must be non-negative")99 _check_threshold(threshold)100 101 for query_arena in queries.iter_arenas(batch_size):102 for result in knearest_tanimoto_search(query_arena, self._id_fp_pairs,103 k, threshold):...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run lisa automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful