human
Can you provide a Python program to print results nicely' given the following:
Complete the below
def analyze(test, type, arg1, arg2, configfile):

    ''''Compute averages/p-vales of two samples, print results nicely'
    '''
assistant
#Here is Python program to print results nicely'
.
    config = ConfigParser.ConfigParser()
    config.read(configfile)
    ignore_col = int(config.get(test, 'ignore_col'))
    avg_update = config.get(test, 'avg_update')
    desc = config.get(test, 'desc')
    def get_list(dir):
        result_file_pattern = config.get(test, 'result_file_pattern')
        cmd = ('find    %s|grep    "%s.*/%s"' % (dir, test, result_file_pattern))
        print cmd
        return commands.getoutput(cmd)
    if (type == 'file'):
        arg1 = get_list(arg1)
        arg2 = get_list(arg2)
    commands.getoutput(('rm    -f    %s.*html' % test))
    s1 = Sample(type, arg1)
    avg1 = s1.getAvg(avg_update=avg_update)
    sd1 = s1.getSD()
    s2 = Sample(type, arg2)
    avg2 = s2.getAvg(avg_update=avg_update)
    sd2 = s2.getSD()
    sd1 = s1.getSDRate([avg1, sd1])
    sd2 = s1.getSDRate([avg2, sd2])
    avgs_rate = s1.getAvgPercent([avg1, avg2])
    navg1 = []
    navg2 = []
    allpvalues = []
    tmp1 = []
    tmp2 = []
    for i in range(len(avg1)):
        if (not re.findall('[a-zA-Z]', avg1[i])):
            tmp1.append([avg1[i]])
            tmp2.append([avg2[i]])
        elif (('Category' in avg1[i]) and (i != 0)):
            navg1.append(tmp1)
            navg2.append(tmp2)
            tmp1 = []
            tmp2 = []
    navg1.append(tmp1)
    navg2.append(tmp2)
    for i in range(len(navg1)):
        allpvalues.append(s1.getTtestPvalue(navg1[i], navg2[i], True))
    pvalues = s1.getTtestPvalue(s1.files_dict, s2.files_dict, False)
    rlist = [avgs_rate]
    if pvalues:
        rlist.append(pvalues)
    desc = (desc % s1.len)
    tee((('<pre>####1.    Description    of    setup#1\n' + s1.version) + '</pre>'), (test + '.html'))
    tee((('<pre>####2.    Description    of    setup#2\n' + s2.version) + '</pre>'), (test + '.html'))
    tee((('<pre>' + '\n'.join(desc.split('\\n'))) + '</pre>'), (test + '.html'))
    tee((('<pre>' + s1.desc) + '</pre>'), (test + '.html'))
    display([avg1, sd1, avg2, sd2], rlist, allpvalues, (test + '.html'), ignore_col, sum=('Regression   ...