from typing import Dict
from typing import List


def extract_based_on_ids(dataset: Dict, id_file: str) -> List[str]:
    """Extract ids from dataset files

    Args:
        dataset (Dict): dict of dataset
        id_file (str): id of the dataset file

    Returns:
        List[str]: return list of dataset entries
    """
    lines = []
    with open(id_file) as f:
        for line in f:
            id = line.strip()
            try:
                lines.append(dataset[id])
            except ValueError:
                print(f"Error: Invalid ID {id} in {id_file}")
    return lines