MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / normalize_result

Function normalize_result

scripts/issue_good_first_issue_check_openhands.py:439–457  ·  view source on GitHub ↗
(result: dict[str, Any])

Source from the content-addressed store, hash-verified

437
438
439def normalize_result(result: dict[str, Any]) -> dict[str, Any]:
440 normalized = dict(result)
441 normalized['should_apply_label'] = as_bool(normalized.get('should_apply_label'))
442
443 confidence = str(normalized.get('confidence') or 'low').strip().lower()
444 if confidence not in {'high', 'medium', 'low'}:
445 confidence = 'low'
446 normalized['confidence'] = confidence
447
448 normalized['summary'] = str(normalized.get('summary') or '').strip()
449 normalized['criteria_met'] = normalize_string_list(normalized.get('criteria_met'))
450 normalized['disqualifiers'] = normalize_string_list(normalized.get('disqualifiers'))
451
452 if confidence != 'high':
453 normalized['should_apply_label'] = False
454 if normalized['disqualifiers']:
455 normalized['should_apply_label'] = False
456
457 return normalized
458
459
460def main() -> int:

Callers 1

mainFunction · 0.70

Calls 3

normalize_string_listFunction · 0.85
as_boolFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected