MCPcopy Index your code
hub / github.com/mne-tools/mne-python / load_module

Function load_module

mne/commands/utils.py:27–48  ·  view source on GitHub ↗

Load module from .py/.pyc file. Parameters ---------- name : str Name of the module. path : str Path to .py/.pyc file. Returns ------- mod : module Imported module.

(name, path)

Source from the content-addressed store, hash-verified

25
26
27def load_module(name, path):
28 """Load module from .py/.pyc file.
29
30 Parameters
31 ----------
32 name : str
33 Name of the module.
34 path : str
35 Path to .py/.pyc file.
36
37 Returns
38 -------
39 mod : module
40 Imported module.
41
42 """
43 from importlib.util import module_from_spec, spec_from_file_location
44
45 spec = spec_from_file_location(name, path)
46 mod = module_from_spec(spec)
47 spec.loader.exec_module(mod)
48 return mod
49
50
51def get_optparser(cmdpath, usage=None, prog_prefix="mne", version=None):

Callers 1

get_optparserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected