MCPcopy 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
39def 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
43def http_echo(request: Request) -> Response:

Callers 1

http_echoFunction · 0.85

Calls 1

itemsMethod · 0.45

Tested by

no test coverage detected