MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / contains_doctest

Function contains_doctest

lib/matplotlib/sphinxext/plot_directive.py:365–374  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

363
364
365def contains_doctest(text):
366 try:
367 # check if it's valid Python as-is
368 compile(text, '<string>', 'exec')
369 return False
370 except SyntaxError:
371 pass
372 r = re.compile(r'^\s*>>>', re.M)
373 m = r.search(text)
374 return bool(m)
375
376
377def _split_code_at_show(text, function_name):

Callers 2

_split_code_at_showFunction · 0.85
runFunction · 0.85

Calls 1

searchMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…