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

Function build_pyplot

tools/boilerplate.py:379–395  ·  view source on GitHub ↗
(pyplot_path)

Source from the content-addressed store, hash-verified

377
378
379def build_pyplot(pyplot_path):
380 pyplot_orig = pyplot_path.read_text().splitlines(keepends=True)
381 try:
382 pyplot_orig = pyplot_orig[:pyplot_orig.index(PYPLOT_MAGIC_HEADER) + 1]
383 except IndexError as err:
384 raise ValueError('The pyplot.py file *must* have the exact line: %s'
385 % PYPLOT_MAGIC_HEADER) from err
386
387 with pyplot_path.open('w') as pyplot:
388 pyplot.writelines(pyplot_orig)
389 pyplot.writelines(boilerplate_gen())
390
391 # Run black to autoformat pyplot
392 subprocess.run(
393 [sys.executable, "-m", "black", "--line-length=88", pyplot_path],
394 check=True
395 )
396
397
398### Methods for retrieving signatures from pyi stub files

Callers 1

boilerplate.pyFile · 0.85

Calls 4

boilerplate_genFunction · 0.85
indexMethod · 0.80
openMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…