human
Complete this python program:
def load_wavedata(*fnames):
assistant
#Here is the Python code you requested.

    """dj1, dj2 = load_wavedata("namea", "nameb")
    djx --- (wave, wave_r_entry)
    return:
    ((wave_timestamp, DataFrame(\pre\,\after\)))
    """
    def fnameparse(fname):
        '\n                                return    entry_wave_info    and    wave\n                                '
        home = (os.getcwd() + '/data/')
        return (''.join([home, 'trace/', fname, '_trade_wave.txt']), ''.join([home, 'trace/', fname, '_wave.txt']))
    def process_session(data):
        ''
        index = data[0]
        pre_en_wave = []
        after_en_wave = []
        ispre = True
        for line in data[1:]:
            issep = line.startswith('=')
            if (ispre and (not issep)):
                pre_en_wave.append(line)
            if issep:
                ispre = False
            if ((not ispre) and (not issep)):
                after_en_wave.append(line)
        return [index, pre_en_wave, after_en_wave]
    rst = []
    for fname in fnames:
        (tw_name, w_name) = fnameparse(fname)
        wave_ts = []
        ses = []
        entroinfo = []
        for line in open(w_name):
            wave_ts.append(line.rstrip('\n'))
        for line in open(tw_name):
            line = line.rstrip('\n')
            ses.append(line)
            if line.startswith('-'):
                ses.pop()
                if ses:
                    entroinfo.append(process_session(ses))
                ses = []
        entroinfo.append(process_session(ses))
        d = zip(*entroinfo)
    rst.append((wave_ts, pd.DataFrame({'pre': d[1], 'after': d[2]}, index=d[0])))
    return tuple(rst)