import pickle


def read_file(pickle_file_name):
    """Reads activations from Pickle file.

    :param pickle_file_name: Path to input file.
    :return: activation_matrix: See doc for `write_file`.
    :return: metadata_dict: Dictionary with the following keys.
    metadata_dict['full_id_strings']: See doc for `write_file`.
    metadata_dict['storm_times_unix_sec']: Same.
    metadata_dict['model_file_name']: Same.
    metadata_dict['component_type_string']: Same.
    metadata_dict['target_class']: Same.
    metadata_dict['layer_name']: Same.
    metadata_dict['neuron_index_matrix']: Same.
    metadata_dict['channel_indices']: Same.
    """

    pickle_file_handle = open(pickle_file_name, 'rb')
    activation_matrix = pickle.load(pickle_file_handle)
    metadata_dict = pickle.load(pickle_file_handle)
    pickle_file_handle.close()

    return activation_matrix, metadata_dict