<commit_before>
import numpy as np
import re
import os


ms_active = raw_input("MS? : ")
field_str = raw_input("Field? : ")
spw_str = raw_input("SPW? : ")


tb.open(ms_active+"/FIELD")
names = tb.getcol('NAME')
matches = [string for string in names if re.match(field_str, string)]
posn_matches = \
    [i for i, string in enumerate(names) if re.match(field_str, string)]
numFields = tb.nrows()
tb.close()

if len(matches) == 0:
    raise TypeError("No matches found for the given field string")

tb.open(ms_active)
scanNums = sorted(np.unique(tb.getcol('SCAN_NUMBER')))<commit_msg>Feed in arguments<commit_after>
import numpy as np
import re
import os
import sys

if len(sys.argv) > 3:
    ms_active = sys.argv[-3]
    field_str = sys.argv[-2]
    spw_str = sys.argv[-1]
else:
    ms_active = raw_input("MS? : ")
    field_str = raw_input("Field? : ")
    spw_str = raw_input("SPW? : ")


tb.open(ms_active+"/FIELD")
names = tb.getcol('NAME')
matches = [string for string in names if re.match(field_str, string)]
posn_matches = \
    [i for i, string in enumerate(names) if re.match(field_str, string)]
numFields = tb.nrows()
tb.close()

if len(matches) == 0:
    raise TypeError("No matches found for the given field string")

tb.open(ms_active)
scanNums = sorted(np.unique(tb.getcol('SCAN_NUMBER')))
{'fraction_non_alphanumeric': 0.14681014604150652, 'fraction_numerical': 0.004611837048424289, 'mean_word_length': 4.447698744769874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '3190818', 'n_tokens_mistral': 478, 'n_tokens_neox': 471, 'n_words': 123}