<commit_before># KL Template Parser

# Default type groups
Floats = ['Float32', 'Float64']
Ints = ['UInt8', 'SInt8', 'UInt16', 'SInt16', 'UInt32', 'SInt32', 'UInt64', 'SInt64']
UInts = ['UInt8', 'UInt16', 'UInt32', 'UInt64']
SInts = ['SInt8', 'SInt16', 'SInt32', 'SInt64']
Num = ['UInt8', 'SInt8', 'UInt16', 'SInt16', 'UInt32', 'SInt32', 'UInt64', 'SInt64', 'Float32', 'Float64']
AllBase = ['UInt8', 'SInt8', 'UInt16', 'SInt16', 'UInt32', 'SInt32', 'UInt64', 'SInt64', 'Float32', 'Float64' , 'Boolean', 'String']

def defaults(sList):
  """replace default group name for list"""
  if 'Floats' in sList[:]:
    sList[sList[:].index('Floats') : sList[:].index('Floats') + 1] = Floats
  if 'Ints' in sList[:]:
    sList[sList[:].index('Ints') : sList[:].index('Ints') + 1] = Ints
  if 'UInts' in sList[:]:
    sList[sList[:].index('UInts') : sList[:].index('UInts') + 1] = UInts
  if 'SInts' in sList[:]:
    sList[sList[:].index('SInts') : sList[:].index('SInts') + 1] = SInts
  if 'Num' in sList[:]:
    sList[sList[:].index('Num') : sList[:].index('Num') + 1] = Num
  if 'AllBase' in sList[:]:
    sList[sList[:].index('AllBase') : sList[:].index('AllBase') + 1] = AllBase

TemplateFileName = 'SampleKLTemplate.klt'
# import tkFileDialog
# TemplateFileName = tkFileDialog.askopenfilename()

TemplateFile = open(TemplateFileName, 'r')
KLFileName = 'ParsedKL.kl'<commit_msg>Bug Fix<commit_after># KL Template Parser

# Default type groups
Floats = ['Float32', 'Float64']
Ints = ['UInt8', 'SInt8', 'UInt16', 'SInt16', 'UInt32', 'SInt32', 'UInt64', 'SInt64']
UInts = ['UInt8', 'UInt16', 'UInt32', 'UInt64']
SInts = ['SInt8', 'SInt16', 'SInt32', 'SInt64']
Num = ['UInt8', 'SInt8', 'UInt16', 'SInt16', 'UInt32', 'SInt32', 'UInt64', 'SInt64', 'Float32', 'Float64']
AllBase = ['UInt8', 'SInt8', 'UInt16', 'SInt16', 'UInt32', 'SInt32', 'UInt64', 'SInt64', 'Float32', 'Float64' , 'Boolean', 'String']

def defaults(sList):
  """replace default group name for list"""
  if 'Floats' in sList[:]:
    sList[sList[:].index('Floats') : sList[:].index('Floats') + 1] = Floats
  if 'Ints' in sList[:]:
    sList[sList[:].index('Ints') : sList[:].index('Ints') + 1] = Ints
  if 'UInts' in sList[:]:
    sList[sList[:].index('UInts') : sList[:].index('UInts') + 1] = UInts
  if 'SInts' in sList[:]:
    sList[sList[:].index('SInts') : sList[:].index('SInts') + 1] = SInts
  if 'Num' in sList[:]:
    sList[sList[:].index('Num') : sList[:].index('Num') + 1] = Num
  if 'AllBase' in sList[:]:
    sList[sList[:].index('AllBase') : sList[:].index('AllBase') + 1] = AllBase

# TemplateFileName = 'SampleKLTemplate.klt'
import tkFileDialog
TemplateFileName = tkFileDialog.askopenfilename()

TemplateFile = open(TemplateFileName, 'r')
KLFileName = 'ParsedKL.kl'
{'fraction_non_alphanumeric': 0.23940058479532164, 'fraction_numerical': 0.054093567251461985, 'mean_word_length': 5.563549160671463, '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': '3783220', 'n_tokens_mistral': 1184, 'n_tokens_neox': 1110, 'n_words': 240}