MCPcopy Create free account
hub / github.com/ipython/ipython / is_importable

Function is_importable

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

Source from the content-addressed store, hash-verified

149
150
151def is_importable(module, attr, only_modules):
152 if only_modules:
153 return inspect.ismodule(getattr(module, attr))
154 else:
155 return not(attr[:2] == '__' and attr[-2:] == '__')
156
157
158def try_import(mod: str, only_modules=False) -> List[str]:

Callers 1

try_importFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected