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

Function is_importable

IPython/core/completerlib.py:155–164  ·  view source on GitHub ↗
(module, attr: str, only_modules)

Source from the content-addressed store, hash-verified

153
154
155def is_importable(module, attr: str, only_modules) -> bool:
156 if only_modules:
157 try:
158 mod = getattr(module, attr)
159 except ModuleNotFoundError:
160 # See gh-14434
161 return False
162 return inspect.ismodule(mod)
163 else:
164 return not(attr[:2] == '__' and attr[-2:] == '__')
165
166def is_possible_submodule(module, attr):
167 try:

Callers 1

try_importFunction · 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…