<commit_before>import os
import re

import wx

class SplitPanel(wx.Panel):

    predefined = sorted(["Cardio", "H&P", "Consult", "OP Report", "Discharge", "Clinic", "ED Report"])

    def __init__(self, parent, id):
        # THIS NEEDS TO BE CLEANED!
        wx.Panel.__init__(self, parent, id)

        # category_row, split_entry
        self.outer = wx.BoxSizer(wx.VERTICAL)
        self.outer.Add((0,10))
        # Prefix (Combo box), Path_Entry, Path_Button
        self.category_row = wx.BoxSizer(wx.HORIZONTAL)
        # Split Rules - Label, TextCtrl
        self.rules_row = wx.BoxSizer(wx.HORIZONTAL)

        # category_row contents
        self.cmb_prefix = wx.ComboBox(self, choices=self.predefined)
        self.cmb_prefix.SetValue(self.predefined[0])
        self.out_text = wx.StaticText(self, label=" Output Path: ")
        self.ent_path = wx.TextCtrl(self)
        self.btn_browse = wx.Button(self, label="Browse...")

        # Add items to category_row
        self.category_row.Add(self.cmb_prefix, proportion=0)
        self.category_row.Add(self.out_text, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL)
        self.category_row.Add(self.ent_path, proportion=5)
        self.category_row.Add(self.btn_browse, proportion=0)

        # Split Rules Row contents
        self.lbl_split = wx.StaticText(self, label="  Split Ranges: ")
        self.ent_split_rules = wx.TextCtrl(self)
        self.btn_Clear = wx.Button(self, wx.ID_CLEAR)

        # Add items to rules_row
        self.rules_row.Add(self.lbl_split, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL)
        self.rules_row.Add(self.ent_split_rules, proportion=5)
        self.rules_row.Add(self.btn_Clear, proportion=0)

        # Add items to outer
        self.outer.Add(self.category_row, proportion=0, flag=wx.GROW)
        self.outer.Add(self.rules_row, proportion=0, flag=wx.GROW)

        # Setup bindings
        self.Bind(wx.EVT_BUTTON, self.OnClear, self.btn_Clear)
        self.Bind(wx.EVT_BUTTON, self.OnBrowse, self.btn_browse)
        self.Bind(wx.EVT_TEXT, self.ValidateRange, self.ent_split_rules)
        self.Bind(wx.EVT_TEXT, self.ValidatePath, self.ent_path)

        # Finish up
        self.SetSizer(self.outer)
        self.Show()

    def OnClear(self, event):
        # Reset background color to white and clear the text of
        # the text fields.
        self.ent_path.SetBackgroundColour(wx.NullColour)
        self.ent_path.Clear()
        self.ent_path.Refresh()
        self.ent_split_rules.SetBackgroundColour(wx.NullColour)<commit_msg>Changed the splitpanel to be slightly more appealing.<commit_after>import os
import re

import wx

class SplitPanel(wx.Panel):

    predefined = sorted(["Cardio", "H&P", "Consult", "OP Report", "Discharge", "Clinic", "ED Report"])

    def __init__(self, parent, id):
        # THIS NEEDS TO BE CLEANED!
        wx.Panel.__init__(self, parent, id)

        # category_row, split_entry
        self.outer = wx.BoxSizer(wx.VERTICAL)
        self.outer.Add((0,5))
        # Prefix (Combo box), Path_Entry, Path_Button
        self.category_row = wx.BoxSizer(wx.HORIZONTAL)
        # Split Rules - Label, TextCtrl
        self.rules_row = wx.BoxSizer(wx.HORIZONTAL)

        # category_row contents
        self.cmb_prefix = wx.ComboBox(self, choices=self.predefined)
        self.cmb_prefix.SetValue(self.predefined[0])
        self.out_text = wx.StaticText(self, label=" Output Path: ")
        self.ent_path = wx.TextCtrl(self)
        self.btn_browse = wx.Button(self, label="Browse...")

        # Add items to category_row
        self.category_row.Add(self.cmb_prefix, proportion=0)
        self.category_row.Add(self.out_text, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL)
        self.category_row.Add(self.ent_path, proportion=5)
        self.category_row.Add(self.btn_browse, proportion=0)

        # Split Rules Row contents
        self.lbl_split = wx.StaticText(self, label="  Split Ranges: ")
        self.ent_split_rules = wx.TextCtrl(self)
        self.btn_Clear = wx.Button(self, wx.ID_CLEAR)

        # Add items to rules_row
        self.rules_row.Add(self.lbl_split, proportion=0, flag=wx.ALIGN_CENTER_VERTICAL)
        self.rules_row.Add(self.ent_split_rules, proportion=5)
        self.rules_row.Add(self.btn_Clear, proportion=0)

        # Add items to outer
        self.outer.Add(wx.StaticLine(self), proportion=1, flag=wx.GROW)
        self.outer.Add((0,5))
        self.outer.Add(self.category_row, proportion=0, flag=wx.GROW)
        self.outer.Add(self.rules_row, proportion=0, flag=wx.GROW)

        # Setup bindings
        self.Bind(wx.EVT_BUTTON, self.OnClear, self.btn_Clear)
        self.Bind(wx.EVT_BUTTON, self.OnBrowse, self.btn_browse)
        self.Bind(wx.EVT_TEXT, self.ValidateRange, self.ent_split_rules)
        self.Bind(wx.EVT_TEXT, self.ValidatePath, self.ent_path)

        # Finish up
        self.SetSizer(self.outer)
        self.Show()

    def OnClear(self, event):
        # Reset background color to white and clear the text of
        # the text fields.
        self.ent_path.SetBackgroundColour(wx.NullColour)
        self.ent_path.Clear()
        self.ent_path.Refresh()
        self.ent_split_rules.SetBackgroundColour(wx.NullColour)
{'fraction_non_alphanumeric': 0.11499522445081184, 'fraction_numerical': 0.005348615090735435, 'mean_word_length': 2.8642066420664207, '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': '6560167', 'n_tokens_mistral': 1788, 'n_tokens_neox': 1759, 'n_words': 310}