MCPcopy Index your code
hub / github.com/fluentpython/example-code-2e / search

Function search

21-async/mojifinder/web_mojifinder_bottle.py:18–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16
17@route('/search')
18def search():
19 query = request.query['q']
20 chars = index.search(query)
21 results = []
22 for char in chars:
23 name = unicodedata.name(char)
24 results.append({'char': char, 'name': name})
25 return json.dumps(results).encode('UTF-8')
26
27
28def main(port):

Callers

nothing calls this directly

Calls 2

searchMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected