MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _parse_weight_text

Function _parse_weight_text

deployments/desktop/shared/agents.py:1855–1872  ·  view source on GitHub ↗
(value: Any)

Source from the content-addressed store, hash-verified

1853 action_type="must_read_update",
1854 category="desktop_gui",
1855 metadata={"value": cleaned_value, "item_type": normalized_type},
1856 )
1857
1858 return {
1859 "result": result,
1860 "profile": _profile_summary(profile),
1861 **list_must_read(user_id),
1862 }
1863
1864
1865def _parse_weight_text(value: Any) -> Dict[str, float]:
1866 result: Dict[str, float] = {}
1867 for item in _string_list(str(value or "").replace("\n", ";").split(";")):
1868 label = item
1869 weight = 1.0
1870 if ":" in item:
1871 label, raw_weight = item.rsplit(":", 1)
1872 elif "=" in item:
1873 label, raw_weight = item.rsplit("=", 1)
1874 else:
1875 raw_weight = ""

Callers 1

_manual_profile_updatesFunction · 0.85

Calls 2

_string_listFunction · 0.85
_to_floatFunction · 0.85

Tested by

no test coverage detected