MCPcopy Create free account
hub / github.com/ChartGalaxy/ChartGalaxy / is_zero

Function is_zero

code_generation_benchmark/utils/utils_eval.py:18–26  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

16import re
17
18def is_zero(value):
19 pattern = r"^([-+]?\d*\.?\d+)(px|em|rem|%|vh|vw|pt|cm|mm|in|ex|ch|pc)?$"
20
21 match = re.match(pattern, value.strip().lower())
22 if match:
23 number = float(match.group(1))
24 if number == 0:
25 return True
26 return False
27
28def box_area(box):
29 # box = xyxy(4,n)

Callers 1

judge_invalid_elementsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected