#-*-coding:utf-8-*-
#hfjimenez@utp.edu.con
#coded using droidedit.
#solve point 2,exam1 Computer Programming IV,utp
import  itertools 
from timeit import  timeit  #replace currentTimemillis 

class Task:
    def __init__(self,stringmatch):
        self.algorithmm=stringmatch
    def execute(self):
        timeperstatement=timeit(stmt=self.algorithmm, unit=msec,number=100)
    return list(timeperstatement,self.algorithmm)

class Scheduller:
    def __init__(self):
        self.tasklist=[] # list of entries arranged in a heap
        self.entry_finder = {} # mapping of tasks to entries 
        self.REMOVED = '<removed-task>'
        self.counter = itertools.count() # unique sequence counter

    def addtask(self,task, priority=0):
    """Register a new task
    Add a new task or update the priority of an existing task
    """ 
        if task in self.entry_finder:
            removetask(task) count = next(self.counter)
        self.entry = [priority, count, task]
        self.entry_finder[task] = entry 
        heappush(self.tasklist,self.entry)
    
    def removetask(self,task): 
    """Delete a task
    Mark an existing task as REMOVED.      Raise KeyError if not found.
    """
        self.entry =self.entry_finder.pop(task)
        self.entry[-1] = self.REMOVED 

    def poptask(self): 
    """to 
    Remove and return the lowest priority task. Raise KeyError if empty.
    """
    while self.tasklist:
        priority, count, task = heappop(self.t asklist) 
        if task is not self.REMOVED: 
            del entry_finder[task]
        return task 
     raise KeyError('pop from an empty priority queue')

    def start(self):
        r=[x.execute() for x un self.taslist]

#-*-coding:utf-8-*-
#hfjimenez@utp.edu.con
#coded using droidedit.
#solve point 2,exam1 Computer Programming IV,utp
import  itertools 
from timeit import  timeit  #replace currentTimemillis 

class Task:
    def __init__(self,stringmatch):
        self.algorithmm=stringmatch
    def execute(self):
        timeperstatement=timeit(stmt=self.algorithmm, unit=msec,number=100)
    return list(timeperstatement,self.algorithmm)

class Scheduller:
    def __init__(self):
        self.tasklist=[] # list of entries arranged in a heap
        self.entry_finder = {} # mapping of tasks to entries 
        self.REMOVED = '<removed-task>'
        self.counter = itertools.count() # unique sequence counter

    def addtask(self,task, priority=0):
    """Register a new task
    Add a new task or update the priority of an existing task
    """ 
        if task in self.entry_finder:
            removetask(task) count = next(self.counter)
        self.entry = [priority, count, task]
        self.entry_finder[task] = entry 
        heappush(self.tasklist,self.entry)
    
    def removetask(self,task): 
    """Delete a task
    Mark an existing task as REMOVED.      Raise KeyError if not found.
    """
        self.entry =self.entry_finder.pop(task)
        self.entry[-1] = self.REMOVED 

    def poptask(self): 
    """to 
    Remove and return the lowest priority task. Raise KeyError if empty.
    """
    while self.tasklist:
        priority, count, task = heappop(self.t asklist) 
        if task is not self.REMOVED: 
            del entry_finder[task]
        return task 
     raise KeyError('pop from an empty priority queue')

    def start(self):
        r=[x.execute() for x in self.taslist]

Update solveparcialb.py