<!-- # hard line break macro for HTML -->

# fiftyone.operators.decorators

FiftyOne operator decorators.

Copyright 2017-2026, Voxel51, Inc.
<br/>
[voxel51.com](https://voxel51.com/)
<br/>
<br/>

**Functions:**

| [`coroutine_timeout`](#fiftyone.operators.decorators.coroutine_timeout)(seconds)     |                                                                                                            |
|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------|
| [`timeout`](#fiftyone.operators.decorators.timeout)(seconds)                         | Context manager that raises a `TimeoutError` if its body runs for longer than the given number of seconds. |
| [`raise_timeout_error`](#fiftyone.operators.decorators.raise_timeout_error)(seconds) |                                                                                                            |
| [`plugins_cache`](#fiftyone.operators.decorators.plugins_cache)(func)                | Decorator that returns cached function results as long as no plugins have been modified since last time.   |
| [`dir_state`](#fiftyone.operators.decorators.dir_state)(dirpath)                     |                                                                                                            |

### fiftyone.operators.decorators.coroutine_timeout(seconds)

### fiftyone.operators.decorators.timeout(seconds: int)

Context manager that raises a `TimeoutError` if its body runs for
longer than the given number of seconds.

Must be entered from the main thread of the main interpreter, because it
installs a `SIGALRM` handler and `signal.signal()` raises a
`ValueError` in any other thread.

* **Parameters:**
  **seconds** – the timeout, in seconds

### fiftyone.operators.decorators.raise_timeout_error(seconds)

### fiftyone.operators.decorators.plugins_cache(func)

Decorator that returns cached function results as long as no plugins
have been modified since last time.

### fiftyone.operators.decorators.dir_state(dirpath)
