MCPcopy Index your code
hub / github.com/ipython/ipython / _matplotlib_manages_backends

Function _matplotlib_manages_backends

IPython/core/pylabtools.py:455–478  ·  view source on GitHub ↗

Return True if Matplotlib manages backends, False otherwise. If it returns True, the caller can be sure that matplotlib.backends.registry.backend_registry is available along with member functions resolve_gui_or_backend, resolve_backend, list_all, and list_gui_frameworks. This f

()

Source from the content-addressed store, hash-verified

453
454
455def _matplotlib_manages_backends() -> bool:
456 """Return True if Matplotlib manages backends, False otherwise.
457
458 If it returns True, the caller can be sure that
459 matplotlib.backends.registry.backend_registry is available along with
460 member functions resolve_gui_or_backend, resolve_backend, list_all, and
461 list_gui_frameworks.
462
463 This function can be removed as it will always return True when Python
464 3.12, the latest version supported by Matplotlib < 3.9, reaches
465 end-of-life in late 2028.
466 """
467 global _matplotlib_manages_backends_value
468 if _matplotlib_manages_backends_value is None:
469 try:
470 from matplotlib.backends.registry import backend_registry
471
472 _matplotlib_manages_backends_value = hasattr(
473 backend_registry, "resolve_gui_or_backend"
474 )
475 except ImportError:
476 _matplotlib_manages_backends_value = False
477
478 return _matplotlib_manages_backends_value
479
480
481def _list_matplotlib_backends_and_gui_loops() -> list[str]:

Callers 3

enable_matplotlibMethod · 0.85
find_gui_and_backendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…