Identify the first ``ImportFrom`` instance the specified `id`.
(iterable: Iterable[Statement], id: str)
| 126 | |
| 127 | if TYPE_CHECKING or MYPY_EX is None: |
| 128 | def _index(iterable: Iterable[Statement], id: str) -> int: |
| 129 | """Identify the first ``ImportFrom`` instance the specified `id`.""" |
| 130 | for i, value in enumerate(iterable): |
| 131 | if getattr(value, "id", None) == id: |
| 132 | return i |
| 133 | raise ValueError("Failed to identify a `ImportFrom` instance " |
| 134 | f"with the following id: {id!r}") |
| 135 | |
| 136 | def _override_imports( |
| 137 | file: MypyFile, |