Push Tracker
experiments-07-07-12-local-.../agentic_scratch/qwen3.6-27b/t5_parse/parse.py
2026-07-13 01:35:10 +00:00

16 lines
419 B
Python

def parse_kv(text):
result = {}
for line in text.splitlines():
line = line.strip()
if not line:
continue
key, value = line.split('=', 1)
if value.isdigit():
value = int(value)
result[key] = value
return result
if __name__ == '__main__':
assert parse_kv('a=1\nb=hello\n\nc=42') == {'a': 1, 'b': 'hello', 'c': 42}
print("Test passed!")