(self)
| 374 | return result |
| 375 | |
| 376 | def __await__(self): |
| 377 | try: |
| 378 | from distributed import futures_of, wait |
| 379 | except ImportError as e: |
| 380 | raise ImportError( |
| 381 | "Using async/await with dask requires the `distributed` package" |
| 382 | ) from e |
| 383 | |
| 384 | async def f(): |
| 385 | if futures_of(self): |
| 386 | await wait(self) |
| 387 | return self |
| 388 | |
| 389 | return f().__await__() |
| 390 | |
| 391 | |
| 392 | def compute_as_if_collection(cls, dsk, keys, scheduler=None, get=None, **kwargs): |