import base64 import os import random from pathlib import Path from typing import List def get_files_in_dir(path: Path) -> List[str]: files = [] for file in os.listdir(path): if os.path.isfile(os.path.join(path, file)): files.append(file) return files def get_random_img(img_names: List[str]) -> str: return random.choice(img_names)