<commit_before>#!/usr/bin/python

import optparse

optparser = optparse.OptionParser()

options, arguments = optparser.parse_args()

print arguments

for argument in arguments:
    print argument
    hin = open(argument, 'r')
    DFlist = []
    for line in hin.readlines():
	elements = line.split(' ')
	while '' in elements:
	    elements.remove('')
#	print ' '.join(elements)[:-1]
	DFlist.append(float(elements[4]))
    hin.close()
#    print DFlist
    n = len(DFlist)

    if 'sp' not in argument:
	print 'tweaking DF'
	for i in xrange(n):
	    DFlist[i] = (3*DFlist[i]-1)/(3-DFlist[i])

    DFdifflist = []
    for i in xrange(n):
	DFdifflist.append(abs((DFlist[i] - (DFlist[-1]*i/(n-1) + 
		   DFlist[0]*(n-i-1)/(n-1)))/DFlist[i]))

#    for diff in DFdifflist:
#	print diff
    print max(DFdifflist)<commit_msg>Calculates strain energy at steady-state<commit_after>#!/usr/bin/python

#import optparse
#optparser = optparse.OptionParser()
#options, arguments = optparser.parse_args()
#print arguments
#for argument in arguments:
#    print argument

hinstretches = open('stretches_04000.txt', 'r')
hinshpa = open('shpa0001.txt', 'r')
W = 0.
area = 0.
for line in hinstretches:
    elements = line.split(' ')
    while '' in elements:
        elements.remove('')
    l1 = float(elements[1])
    l2 = float(elements[2][:-1])
    line = hinshpa.readline()
    elements = line.split(' ')
    while '' in elements:
        elements.remove('')
    area_i = float(elements[3])
    area = area + area_i
    W = W + (l1*l1 + l2*l2 + 1/(l1*l1*l2*l2) - 3)*area_i/3
W = W/area
hinstretches.close()
hinshpa.close()
print '%.14e'%W
{'fraction_non_alphanumeric': 0.16574245224892176, 'fraction_numerical': 0.024645717806531114, 'mean_word_length': 3.4493150684931506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6177893', 'n_tokens_mistral': 647, 'n_tokens_neox': 616, 'n_words': 136}