Download data/conda_envs/evalclaw/lib/python3.11/asyncio/mixins.py from assassinlike/everything132: direct link, hf CLI and curl.
- Browser
- Download file 481 Bytes
-
https://huggingface.co/datasets/assassinlike/everything132/resolve/main/data/conda_envs/evalclaw/lib/python3.11/asyncio/mixins.py
- Command line
-
hf download hf://datasets/assassinlike/everything132/data/conda_envs/evalclaw/lib/python3.11/asyncio/mixins.py
-
curl -L -o mixins.py https://huggingface.co/datasets/assassinlike/everything132/resolve/main/data/conda_envs/evalclaw/lib/python3.11/asyncio/mixins.py
481 Bytes
| """Event loop mixins.""" | |
| import threading | |
| from . import events | |
| _global_lock = threading.Lock() | |
| class _LoopBoundMixin: | |
| _loop = None | |
| def _get_loop(self): | |
| loop = events._get_running_loop() | |
| if self._loop is None: | |
| with _global_lock: | |
| if self._loop is None: | |
| self._loop = loop | |
| if loop is not self._loop: | |
| raise RuntimeError(f'{self!r} is bound to a different event loop') | |
| return loop | |