Check if we're inside an IPython zmq frontend. Returns ------- bool
()
| 78 | |
| 79 | |
| 80 | def in_ipython_frontend() -> bool: |
| 81 | """ |
| 82 | Check if we're inside an IPython zmq frontend. |
| 83 | |
| 84 | Returns |
| 85 | ------- |
| 86 | bool |
| 87 | """ |
| 88 | try: |
| 89 | # error: Name 'get_ipython' is not defined |
| 90 | ip = get_ipython() # type: ignore[name-defined] |
| 91 | return "zmq" in str(type(ip)).lower() |
| 92 | except NameError: |
| 93 | pass |
| 94 | |
| 95 | return False |
no test coverage detected