import pickle


def read_config_file(filename):
    """Read config file `filename`."""
    if filename[-4:] != '.pkl':
        raise ValueError("Unknown file format for config file: " + str(filename))
    with open(filename, 'rb') as f:
        config = pickle.load(f)
    return config