<commit_before>import re
import sys


#To run program:

# ./formatFile.py file course_number m(midterm)/f(final)
#
# [REQUIRED] midterm/final (m/f) argument for CS 162 input files
# [OPTIONAL] midterm/final (m/f) argument for CS 163, CS 202 input files
#
#
# Example run:
#   ./formatFile.py input1.txt 162 m
#   ./formatFile.py input2.txt 163
#   ./formatFile.py input3.txt 202 f


print('some change')


#Constant values for command line argument length as well as
#filename, exam, course argument indicies
MAX_ARG_COUNT = 4
MIN_ARG_COUNT = 3
COURSE = 2
FILENAME = 1
EXAM = 3



#Regex for detecting questions, additional instructions, and function prototypes
INSTRUC_REGX = r'[a-zA-Z-_0-9\s!@#$%^&*()+=|\{}[]'""'.,/?><~`]+[^;]'  #all characters expect for semi colon
PROTOTYPE_REGX = r'([a-zA-Z-_0-9\s()*&]+[;])'   #function characters ending in semi colon
#Two variations of question format
QUESTION = 'Write a C++'
QUESTION2 = 'Write a'
PROTOTYPE_KEYWORD = 'Prototype'
PUBLIC_KEYWORD = 'Public Prototype'
PRIVATE_KEYWORD = 'Private Prototype'



#Function to parse CS202 midterm/final questions to required format
#with the specified exam as optional:
def format202(filename, exam, lines):
    print('some to come')


#Function to parse CS163 midterm/final and CS162 final questions to required format
    # REQUIRED: exam for CS 162 Final Files
    # OPTIONAL: exam for CS 163 Midterm/Final Files
def format163(filename, exam, lines):
    question_array = []
    question = False
    prototype = False

    question_text = ''
    prototype_text = ''

    for line in lines:
       # print(line)
        if QUESTION in line or QUESTION2 in line:
            if (question == True):
                if(prototype == True):
                    question_array.append(question_text + '\n' + prototype_text + '\n')
                    question = False
                    question_text = ''<commit_msg>Added print statements Under format202 function<commit_after>import re
import sys


#To run program:

# ./formatFile.py file course_number m(midterm)/f(final)
#
# [REQUIRED] midterm/final (m/f) argument for CS 162 input files
# [OPTIONAL] midterm/final (m/f) argument for CS 163, CS 202 input files
#
#
# Example run:
#   ./formatFile.py input1.txt 162 m
#   ./formatFile.py input2.txt 163
#   ./formatFile.py input3.txt 202 f


print('some change')


#Constant values for command line argument length as well as
#filename, exam, course argument indicies
MAX_ARG_COUNT = 4
MIN_ARG_COUNT = 3
COURSE = 2
FILENAME = 1
EXAM = 3



#Regex for detecting questions, additional instructions, and function prototypes
INSTRUC_REGX = r'[a-zA-Z-_0-9\s!@#$%^&*()+=|\{}[]'""'.,/?><~`]+[^;]'  #all characters expect for semi colon
PROTOTYPE_REGX = r'([a-zA-Z-_0-9\s()*&]+[;])'   #function characters ending in semi colon
#Two variations of question format
QUESTION = 'Write a C++'
QUESTION2 = 'Write a'
PROTOTYPE_KEYWORD = 'Prototype'
PUBLIC_KEYWORD = 'Public Prototype'
PRIVATE_KEYWORD = 'Private Prototype'



#Function to parse CS202 midterm/final questions to required format
#with the specified exam as optional:
def format202(filename, exam, lines):
    print('some to come')
    print('added something to print for CS202')


#Function to parse CS163 midterm/final and CS162 final questions to required format
    # REQUIRED: exam for CS 162 Final Files
    # OPTIONAL: exam for CS 163 Midterm/Final Files
def format163(filename, exam, lines):
    question_array = []
    question = False
    prototype = False

    question_text = ''
    prototype_text = ''

    for line in lines:
       # print(line)
        if QUESTION in line or QUESTION2 in line:
            if (question == True):
                if(prototype == True):
                    question_array.append(question_text + '\n' + prototype_text + '\n')
                    question = False
                    question_text = ''
{'fraction_non_alphanumeric': 0.11282843894899536, 'fraction_numerical': 0.028851107676455434, 'mean_word_length': 3.295353982300885, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3043652', 'n_tokens_mistral': 1331, 'n_tokens_neox': 1198, 'n_words': 411}