(self)
| 393 | return result |
| 394 | |
| 395 | def __await__(self): |
| 396 | try: |
| 397 | from distributed import futures_of, wait |
| 398 | except ImportError as e: |
| 399 | raise type(e)( |
| 400 | "Using async/await with dask requires the `distributed` package" |
| 401 | ) from e |
| 402 | |
| 403 | async def f(): |
| 404 | if futures_of(self): |
| 405 | await wait(self) |
| 406 | return self |
| 407 | |
| 408 | return f().__await__() |
| 409 | |
| 410 | |
| 411 | def compute_as_if_collection(cls, dsk, keys, scheduler=None, get=None, **kwargs): |