import json


def import_from_file(path: str) -> dict | list:
    """
    Import a file from the given path.

    :param path: Path to the file to import.
    :return: The content of the file.
    """
    with open(path, 'r') as f:
        return json.load(f) if path.endswith('.json') else f.readlines()