from typing import Union
from typing import List


def check_filetype(estimated_filetype: str, allowed_types: Union[str, List[str]]) -> bool:
    """
    Check if a file has an expected filetype.

    param: estimated_filetype: The filetype that was estimated by magic.
    param: allowed_types: A string or a list of strings to check.

    return: correct: Whether the filetype contains the correct keyword.
    """
    if isinstance(allowed_types, str):
        allowed_types = [allowed_types]

    correct = any([file_type in estimated_filetype for file_type in allowed_types])
    return correct