init commit of samurai

This commit is contained in:
Cheng-Yen Yang
2024-11-19 22:12:54 -08:00
parent f65f4ba181
commit c17e4cecc0
679 changed files with 123982 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
from typing import Iterable
def resolve_videos(node_ids: Iterable[str], required: bool = False):
"""
Resolve videos given node ids.
"""
from data.store import get_videos
all_videos = get_videos()
return [
all_videos[nid] if required else all_videos.get(nid, None) for nid in node_ids
]