MCPcopy Create free account
hub / github.com/dask/dask / import_required

Function import_required

dask/utils.py:321–329  ·  view source on GitHub ↗

Attempt to import a required dependency. Raises a RuntimeError if the requested module is not available.

(mod_name, error_msg)

Source from the content-addressed store, hash-verified

319
320
321def import_required(mod_name, error_msg):
322 """Attempt to import a required dependency.
323
324 Raises a RuntimeError if the requested module is not available.
325 """
326 try:
327 return import_module(mod_name)
328 except ImportError as e:
329 raise RuntimeError(error_msg) from e
330
331
332@contextmanager

Callers 15

to_graphvizFunction · 0.90
cytoscape_graphFunction · 0.90
to_graphvizFunction · 0.90
_to_graphvizMethod · 0.90
make_peopleFunction · 0.90
read_avroFunction · 0.90
to_avroFunction · 0.90
_metaMethod · 0.90
analyzeFunction · 0.90
explainFunction · 0.90
get_engineFunction · 0.90
get_colorsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected