from typing import Any


def read_file(file_path: str, mode: str) -> Any:
    """Open the file and return its contents.

    :param file_path: path to the file to read.
    :type file_path: str

    :parm mode: read mode, r = read string, rb =read bytes.
    :type mode: str

    :return: Success[bytes], Success[str], Failure[Exception]
    :rtype: bytes, str
    """
    with open(file_path, mode) as data_file:
        return data_file.read()