from typing import Union
from typing import Dict
from typing import List
import json


def read_json(filename: str) -> Union[Dict, List]:
    """Read a JSON object or list from the given output file. By convention,
    the Java wrapper for Metanome algorithms stores all algorithm as JSON
    seriaizations.

    Parameter
    ---------
    filename: string
        Path to the input file on disk.

    Returns
    -------
    dict or list
    """
    with open(filename, 'r') as f:
        return json.load(f)