(module, attr, only_modules)
| 149 | |
| 150 | |
| 151 | def 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 | |
| 158 | def try_import(mod: str, only_modules=False) -> List[str]: |