(module, attr)
| 164 | return not(attr[:2] == '__' and attr[-2:] == '__') |
| 165 | |
| 166 | def is_possible_submodule(module, attr): |
| 167 | try: |
| 168 | obj = getattr(module, attr) |
| 169 | except AttributeError: |
| 170 | # Is possibly an unimported submodule |
| 171 | return True |
| 172 | except TypeError: |
| 173 | # https://github.com/ipython/ipython/issues/9678 |
| 174 | return False |
| 175 | return inspect.ismodule(obj) |
| 176 | |
| 177 | |
| 178 | def try_import(mod: str, only_modules=False) -> List[str]: |
no outgoing calls
no test coverage detected
searching dependent graphs…