<commit_before>"""
PureMVC Python Demo - wxPython Employee Admin 
By <NAME> <<EMAIL>>
Copyright(c) 2007-08 <NAME>, Some rights reserved.
Addapted for pyjamas: <NAME>
"""

import puremvc.patterns.proxy
import enum, vo, EmployeeAdmin

class UserProxy(puremvc.patterns.proxy.Proxy):
    
    NAME = "UserProxy"
    def __init__(self):
        super(UserProxy, self).__init__(UserProxy.NAME, [])
        self.data = []
        self.addItem(vo.UserVO('lstooge','Larry', 'Stooge', "<EMAIL>", 'ijk456',enum.DEPT_ACCT))
        self.addItem(vo.UserVO('cstooge','Curly', 'Stooge', "<EMAIL>", 'xyz987',enum.DEPT_SALES))
        self.addItem(vo.UserVO('mstooge','Moe', 'Stooge', "<EMAIL>", 'abc123',enum.DEPT_PLANT))

    def getUsers(self):
        return self.data
   
    def addItem(self, item):
        self.data.append(item)

    def updateItem(self, user):
        for i in range(0,len(self.data)):
            if self.data[i].username == user.username:
                self.data[i] = user

    def deleteItem(self, user):
        for i in range(0,len(self.data)):
            if self.data[i].username == user.username:
                del self.data[i]

class RoleProxy(puremvc.patterns.proxy.Proxy):

    NAME = "RoleProxy"
    def __init__(self):
        super(RoleProxy, self).__init__(RoleProxy.NAME, [])
        self.data = []
        self.addItem(vo.RoleVO('lstooge', [enum.ROLE_PAYROLL,enum.ROLE_EMP_BENEFITS]))
        self.addItem(vo.RoleVO('cstooge', [enum.ROLE_ACCT_PAY,enum.ROLE_ACCT_RCV,enum.ROLE_GEN_LEDGER]))
        self.addItem(vo.RoleVO('mstooge', [enum.ROLE_INVENTORY,enum.ROLE_PRODUCTION,enum.ROLE_SALES,enum.ROLE_SHIPPING]))

    def getRoles(self):<commit_msg>Bugfix EmployeeAdmin example: deleting users<commit_after>"""
PureMVC Python Demo - wxPython Employee Admin 
By <NAME> <<EMAIL>>
Copyright(c) 2007-08 <NAME>, Some rights reserved.
Addapted for pyjamas: <NAME>
"""

import puremvc.patterns.proxy
import enum, vo, EmployeeAdmin

class UserProxy(puremvc.patterns.proxy.Proxy):
    
    NAME = "UserProxy"
    def __init__(self):
        super(UserProxy, self).__init__(UserProxy.NAME, [])
        self.data = []
        self.addItem(vo.UserVO('lstooge','Larry', 'Stooge', "<EMAIL>", 'ijk456',enum.DEPT_ACCT))
        self.addItem(vo.UserVO('cstooge','Curly', 'Stooge', "<EMAIL>", 'xyz987',enum.DEPT_SALES))
        self.addItem(vo.UserVO('mstooge','Moe', 'Stooge', "<EMAIL>", 'abc123',enum.DEPT_PLANT))

    def getUsers(self):
        return self.data
   
    def addItem(self, item):
        self.data.append(item)

    def updateItem(self, user):
        for i in range(0,len(self.data)):
            if self.data[i].username == user.username:
                self.data[i] = user
		break

    def deleteItem(self, user):
        for i in range(0,len(self.data)):
            if self.data[i].username == user.username:
                del self.data[i]
		break

class RoleProxy(puremvc.patterns.proxy.Proxy):

    NAME = "RoleProxy"
    def __init__(self):
        super(RoleProxy, self).__init__(RoleProxy.NAME, [])
        self.data = []
        self.addItem(vo.RoleVO('lstooge', [enum.ROLE_PAYROLL,enum.ROLE_EMP_BENEFITS]))
        self.addItem(vo.RoleVO('cstooge', [enum.ROLE_ACCT_PAY,enum.ROLE_ACCT_RCV,enum.ROLE_GEN_LEDGER]))
        self.addItem(vo.RoleVO('mstooge', [enum.ROLE_INVENTORY,enum.ROLE_PRODUCTION,enum.ROLE_SALES,enum.ROLE_SHIPPING]))

    def getRoles(self):
{'fraction_non_alphanumeric': 0.1542756391419336, 'fraction_numerical': 0.00999118424919189, 'mean_word_length': 3.3697047496790757, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '2466713', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1221, 'n_words': 197}