Spaces:
Running
Running
""" | |
File: practical_tasks.py | |
Author: Dmitry Ryumin | |
Description: Utility functions for working with practical tasks data. | |
License: MIT License | |
""" | |
import yaml | |
from typing import Dict, List | |
# Importing necessary components for the Gradio app | |
def load_practical_tasks_data(file_path: str) -> List: | |
with open(file_path, "r") as file: | |
return yaml.safe_load(file) or [] | |
def transform_practical_tasks_data(data: List) -> Dict: | |
output_dict = {item["task"]: item["subtasks"] for item in data} | |
return output_dict | |
yaml_file_path = "./practical_tasks.yaml" | |
practical_tasks_data = load_practical_tasks_data(yaml_file_path) | |
supported_practical_tasks = transform_practical_tasks_data(practical_tasks_data) | |