def save_line(fout, path, y, array):
    """
    Save a line into `fout`. The line contains
        path y array
    
    Parameters:
    -----------
    fout : string
        instance of the output file
    path : string
        path to the image
    y : int
        true label
    array : array_like
        list containing features, softmax or other values
    """
    line = ''
    for el in array:
        line += str(el)+' '
    fout.write('%s %d %s\n' % (path, y, line[:-1]))
    return fout