def get_datasets(info_blob):
    """
    Get the dataset names and numpy array contents.

    Every output layer will get one dataset each for both the label and
    the prediction. E.g. if your model has an output layer called "energy",
    the datasets "label_energy" and "pred_energy" will be made.
    If there are no labels (e.g. during orga.inference), the label dataset
    will not be generated.

    Parameters
    ----------
    info_blob : dict
        Contains the following infos as keys/values:
        xs : ndarray
            Input to the network, after sample modifier has been applied.
        y_values : ndarray or None
            A structured array containing infos for every event, right from
            the input files.
            Can also be None, e.g. for when there are no y_values.
        ys : dict or None
            The labels for each output layer of the network.
            Can also be None, e.g. for when there are no y_values.
        y_pred : dict
            The predictions of each output layer of the network.

    Returns
    -------
    datasets : dict
        Keys are the name of the datagroups, values the content in the
        form of numpy arrays.

    """
    datasets = dict()
    if 'y_values' in info_blob:
        datasets['y_values'] = info_blob['y_values']
    if info_blob.get('ys') is not None:
        y_true = info_blob['ys']
        for out_layer_name in y_true:
            datasets['label_' + out_layer_name] = y_true[out_layer_name]
    y_pred = info_blob['y_pred']
    for out_layer_name in y_pred:
        datasets['pred_' + out_layer_name] = y_pred[out_layer_name]
    return datasets
