MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / CheckRect

Function CheckRect

src/__init__.py:22094–22104  ·  view source on GitHub ↗

Check whether an object is non-degenerate rect-like. It must be a sequence of 4 numbers.

(r: typing.Any)

Source from the content-addressed store, hash-verified

22092
22093
22094def CheckRect(r: typing.Any) -> bool:
22095 """Check whether an object is non-degenerate rect-like.
22096
22097 It must be a sequence of 4 numbers.
22098 """
22099 try:
22100 r = Rect(r)
22101 except Exception:
22102 if g_exceptions_verbose > 1: exception_info()
22103 return False
22104 return not (r.is_empty or r.is_infinite)
22105
22106
22107def ColorCode(c: typing.Union[list, tuple, float, None], f: str) -> str:

Callers 2

__contains__Method · 0.85
CheckMarkerArgFunction · 0.85

Calls 2

RectClass · 0.85
exception_infoFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…