<commit_before>#! /usr/bin/env python

import os

# Utility functions
def addnewlines(lines):
    lines=[line+'\n' for line in lines]
    return lines

def makewritelines(lines):
    myline=''
    for line in lines:
        myline+=line
    return myline

# Filename and directory info
current_dir=os.getcwd()+'/'
input='quick.raw'
mypath=current_dir+input
fin=open(mypath,'r')

# Read the input file
in_lines=fin.readlines()
fin.close()

massBWR=0
massPWR=0
fracBWR={}
fracPWR={}
inBWR=False
inPWR=False

for line in in_lines:
    line_arr = line.split()
    test = line_arr[0]
    if test == 'StorageFacilityIniStocks:':
        fac_type = line_arr[1][6:9]
        mass = float(line_arr[2])
        if fac_type == 'BWR':
            massBWR += mass
        if fac_type == 'PWR':
            massPWR += mass
    
    if test == 'Recipe':
        inBWR = False
        inPWR = False
    if inBWR:
        isotope = line_arr[0]
        frac = float(line_arr[2])
        fracBWR[isotope] = frac * massBWR
    elif inPWR:
        isotope = line_arr[0]
        frac = float(line_arr[2])
        fracPWR[isotope] = frac * massPWR

    test = line_arr[1]
    if test == 'nwtrb:spent_BWR_uo2':
        inBWR = True
    elif test == 'nwtrb:spent_PWR_uo2':
        inBWR = False
        inPWR = True
    
    
total_mass = massBWR + massPWR
mU234 = fracBWR['92234'] + fracBWR['92234']
mU235 = fracBWR['92235'] + fracBWR['92235']
mU236 = fracBWR['92236'] + fracBWR['92236']
mU238 = fracBWR['92238'] + fracBWR['92238']
mPu238 = fracBWR['94238'] + fracBWR['94238']
mPu239 = fracBWR['94239'] + fracBWR['94239']
mPu240 = fracBWR['94240'] + fracBWR['94240']
mPu241 = fracBWR['94241'] + fracBWR['94241']<commit_msg>Appended trailing underscores to all member variables.<commit_after>#! /usr/bin/env python

import os

# Utility functions
def addnewlines(lines):
    lines=[line+'\n' for line in lines]
    return lines

def makewritelines(lines):
    myline=''
    for line in lines:
        myline+=line
    return myline

# Filename and directory info
current_dir=os.getcwd()+'/'
input='quick.raw'
mypath=current_dir+input
fin=open(mypath,'r')

# Read the input file
in_lines=fin.readlines()
fin.close()

massBWR=0
massPWR=0
fracBWR={}
fracPWR={}
inBWR=False
inPWR=False
normBWR=0.0
normPWR=0.0

for line in in_lines:
    line_arr = line.split()
    test = line_arr[0]
    if test == 'StorageFacilityIniStocks:':
        fac_type = line_arr[1][6:9]
        mass = float(line_arr[2])
        if fac_type == 'BWR':
            massBWR += mass
        if fac_type == 'PWR':
            massPWR += mass
    
    if test == 'Recipe':
        inBWR = False
        inPWR = False
    if inBWR:
        isotope = line_arr[0]
        frac = float(line_arr[2])
        fracBWR[isotope] = frac
        normBWR += frac
    elif inPWR:
        isotope = line_arr[0]
        frac = float(line_arr[2])
        fracPWR[isotope] = frac
        normPWR += frac

    test = line_arr[1]
    if test == 'nwtrb:spent_BWR_uo2':
        inBWR = True
    elif test == 'nwtrb:spent_PWR_uo2':
        inBWR = False
        inPWR = True

# normalize mass fractions and multiply by total mass
for isotope in iter(fracBWR):
    fracBWR[isotope] *= massBWR / normBWR
for isotope in iter(fracPWR):
    fracPWR[isotope] *= massPWR / normPWR
    
total_mass = massBWR + massPWR
mU234 = fracBWR['92234'] + fracBWR['92234']
mU235 = fracBWR['92235'] + fracBWR['92235']
mU236 = fracBWR['92236'] + fracBWR['92236']
mU238 = fracBWR['92238'] + fracBWR['92238']
mPu238 = fracBWR['94238'] + fracBWR['94238']
mPu239 = fracBWR['94239'] + fracBWR['94239']
mPu240 = fracBWR['94240'] + fracBWR['94240']
mPu241 = fracBWR['94241'] + fracBWR['94241']
{'fraction_non_alphanumeric': 0.13622795115332428, 'fraction_numerical': 0.06512890094979647, 'mean_word_length': 3.0461031833150383, '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': '4422258', 'n_tokens_mistral': 1626, 'n_tokens_neox': 1467, 'n_words': 305}