from typing import Union


def read_file(path: str, mode: str) -> Union[str, bytes]:
    """ Reads the content of the given file.
    Args:
        path (str): the path of the file
        mode (str): the open mode, could be "r" or "rb"

    Returns:
        the content of the file, as string or bytes depending on the mode
    """
    with open(path, mode) as f:
        return f.read()