# guard_extras

Python API: `luxonis_ml.guard_extras`

## Functions

| Name | Description |
| --- | --- |
|
[`guard_missing_extra`](https://docs.luxonis.com/software-v3/ai-inference/model-source/training/luxonis-ml/luxonis-ml-api-reference/guard_extras.md)
| Rewrite missing optional-extra import errors with install guidance. |

### function `guard_missing_extra`

```python
def guard_missing_extra(name: str) -> Generator[None, None, None]
```

Rewrite missing optional-extra import errors with install guidance.

Args

| Name | Type | Description | Default |
| --- | --- | --- | --- |
| `name` | `str` | Optional extra name, such as `"data"`. | required |

Returns

| Type | Description |
| --- | --- |
| `Generator[None, None, None]` |  |

Yields

| Type | Description |
| --- | --- |
|  | Control to the guarded import block. |

Raises

| Type | Description |
| --- | --- |
| `ImportError` | If the guarded block raises `ImportError`. |
