MCPcopy
hub / github.com/AstrBotDevs/AstrBot / get

Method get

astrbot/dashboard/api/multipart.py:44–54  ·  view source on GitHub ↗
(self, key: str, default: Any = None, type: Callable | None = None)

Source from the content-addressed store, hash-verified

42 self._pairs = pairs
43
44 def get(self, key: str, default: Any = None, type: Callable | None = None):
45 for item_key, item_value in reversed(self._pairs):
46 if item_key != key:
47 continue
48 if type is None:
49 return item_value
50 try:
51 return type(item_value)
52 except (TypeError, ValueError):
53 return default
54 return default
55
56 def getlist(self, key: str) -> list[Any]:
57 return [item_value for item_key, item_value in self._pairs if item_key == key]

Callers 15

__getitem__Method · 0.95
to_dashboard_configMethod · 0.45
to_dashboard_configMethod · 0.45
is_asset_tokenMethod · 0.45
extract_asset_tokenMethod · 0.45
is_scope_validMethod · 0.45
get_or_createMethod · 0.45
_get_request_log_hostMethod · 0.45

Calls

no outgoing calls

Tested by 5

test_mcp_connectionMethod · 0.36
test_providerMethod · 0.36