[~] Refactor

This commit is contained in:
Siarhei Siniak 2024-07-06 23:07:57 +03:00
parent 8bbb43f1ca
commit 2f8274297e

@ -7,6 +7,7 @@ from typing import (
Any,
Optional,
Callable,
Iterable,
)
def shared_task(func: Optional[Callable[Any, Any]]=None, **kwargs: Any) -> Any:
@ -133,3 +134,21 @@ def kombu_register_json_dataclass():
content_type='application/json',
content_encoding='utf-8',
)
def grid_of_videos(paths: Iterable[str]) -> Any:
from ipywidgets import Output, GridspecLayout
from IPython import display
grid = GridspecLayout(1, len(paths))
for i, filepath in enumerate(paths):
out = Output()
with out:
display.display(display.Video(
url='/files/%s' % filepath,
#embed=True
))
grid[0, i] = out
return grid