Decide whether this is running in a REPL or IPython notebook
()
| 341 | """ |
| 342 | |
| 343 | def _is_interactive(): |
| 344 | """Decide whether this is running in a REPL or IPython notebook""" |
| 345 | if hasattr(sys, "ps1") or hasattr(sys, "ps2"): |
| 346 | return True |
| 347 | try: |
| 348 | main = __import__("__main__", None, None, fromlist=["__file__"]) |
| 349 | except ModuleNotFoundError: |
| 350 | return False |
| 351 | return not hasattr(main, "__file__") |
| 352 | |
| 353 | def _is_debugger(): |
| 354 | return sys.gettrace() is not None |
no outgoing calls
no test coverage detected
searching dependent graphs…