Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/nonebot/nonebot2
/ flattern
Function
flattern
tests/fake_server.py:39–40 ·
view source on GitHub ↗
(d: "MultiDict[K, V]")
Source
from the content-addressed store, hash-verified
37
38
39
def
flattern(d:
"MultiDict[K, V]"
) -> dict[K, V | list[V]]:
40
return
{k: v[0]
if
len(v) == 1
else
v
for
k, v in d.to_dict(flat=False).items()}
41
42
43
def
http_echo(request: Request) -> Response:
Callers
1
http_echo
Function · 0.85
Calls
1
items
Method · 0.45
Tested by
no test coverage detected