def METHOD_NAME(g, delim=', ', x='energy', y='norm'):
    label = get_label(g)
    _x = getattr(g, x)
    _y = getattr(g, y)
    _n = len(_x)
    labels = [x, label]
    outarr = np.array([_x, _y])
    buff = [f"#saved {time.ctime()}",
            f"#saving x array={x}, y array={y}",
            f"#{label}: {g.filename}",
            "#------------------------------------------",
            "# %s" % delim.join(labels)]
    for i in range(_n):
        buff.append(delim.join([gformat(_x[i]), gformat(_y[i])]))
    buff.append('')
    fnout = f"{label}.csv"
    with open(fnout, 'w', encoding=sys.getdefaultencoding()) as fh:
        fh.write("\n".join(buff))
    print(f"Wrote group to {fnout}")