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

Function search

21-async/mojifinder/web_mojifinder.py:28–30  ·  view source on GitHub ↗
(q: str)

Source from the content-addressed store, hash-verified

26
27@app.get('/search', response_model=list[CharName]) # <6>
28async def search(q: str): # <7>
29 chars = sorted(app.state.index.search(q))
30 return ({'char': c, 'name': name(c)} for c in chars) # <8>
31
32@app.get('/', response_class=HTMLResponse, include_in_schema=False)
33def form(): # <9>

Callers

nothing calls this directly

Calls 1

searchMethod · 0.45

Tested by

no test coverage detected