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

Function get_ipython_module_path

IPython/paths.py:96–108  ·  view source on GitHub ↗

Find the path to an IPython module in this version of IPython. This will always find the version of the module that is in this importable IPython package. This will always return the path to the ``.py`` version of the module.

(module_str)

Source from the content-addressed store, hash-verified

94
95
96def get_ipython_module_path(module_str):
97 """Find the path to an IPython module in this version of IPython.
98
99 This will always find the version of the module that is in this importable
100 IPython package. This will always return the path to the ``.py``
101 version of the module.
102 """
103 if module_str == 'IPython':
104 return os.path.join(get_ipython_package_dir(), '__init__.py')
105 mod = import_item(module_str)
106 the_path = mod.__file__.replace('.pyc', '.py')
107 the_path = the_path.replace('.pyo', '.py')
108 return the_path
109
110
111def locate_profile(profile='default'):

Callers

nothing calls this directly

Calls 3

import_itemFunction · 0.90
get_ipython_package_dirFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…