chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 13:08:41 +08:00
commit bcc7968ff6
9988 changed files with 1016778 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import asyncio
from typing import AsyncGenerator, Callable, Iterator, TypeVar
T = TypeVar("T")
def iterator_to_async(
func: Callable[..., Iterator[T]],
) -> Callable[..., AsyncGenerator[T, None]]:
async def wrapper(*args, **kwargs) -> AsyncGenerator[T, None]:
iterator = func(*args, **kwargs)
for item in iterator:
yield item
await asyncio.sleep(0)
return wrapper