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

Method __contains__

src/__init__.py:14326–14345  ·  view source on GitHub ↗
(self, x)

Source from the content-addressed store, hash-verified

14324 return not self.is_empty
14325
14326 def __contains__(self, x):
14327 try:
14328 l = x.__len__()
14329 except Exception:
14330 if g_exceptions_verbose > 1: exception_info()
14331 return False
14332 if l == 2:
14333 return util_point_in_quad(x, self)
14334 if l != 4:
14335 return False
14336 if CheckRect(x):
14337 if Rect(x).is_empty:
14338 return True
14339 return util_point_in_quad(x[:2], self) and util_point_in_quad(x[2:], self)
14340 if CheckQuad(x):
14341 for i in range(4):
14342 if not util_point_in_quad(x[i], self):
14343 return False
14344 return True
14345 return False
14346
14347 def __eq__(self, quad):
14348 if not hasattr(quad, "__len__"):

Callers 1

__contains__Method · 0.45

Calls 6

exception_infoFunction · 0.85
util_point_in_quadFunction · 0.85
CheckRectFunction · 0.85
RectClass · 0.85
CheckQuadFunction · 0.85
__len__Method · 0.45

Tested by

no test coverage detected