SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.
Python bingbravedegoogleduckduckgogooglemetasearchprivacypythonqwantsearchsearch-enginesearxsearxngstartpageyahoo
[mod] searx.utils.dict_subset: rewrite with comprehension
Alexandre Flament697ebeddcc60
diff --git a/searx/utils.py b/searx/utils.pyindex 5e2ab18c4..22824d829 100644--- a/searx/utils.py+++ b/searx/utils.py@@ -262,11 +262,7 @@ def dict_subset(d, properties):>>> >> dict_subset({'A': 'a', 'B': 'b', 'C': 'c'}, ['A', 'D']){'A': 'a'}"""- result = {}- for k in properties:- if k in d:- result[k] = d[k]- return result+ return {k: d[k] for k in properties if k in d}def get_torrent_size(filesize, filesize_multiplier):