import json


def load(filename, data_format=None):
    """Load the contents of a file."""
    with open(filename, 'r') as file:
        if data_format is not None:
            # Coerce the data
            if data_format == "json":
                return json.load(file)

            message = "Data format ({}) is not known".format(data_format)
            raise ValueError(message)

        return file.readlines()