<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def nice(self, work_spec_name, nice):
        '''Change the priority of an existing work spec.'''
        with self.registry.lock(identifier=self.worker_id) as session:
            session.update(NICE_LEVELS, dict(work_spec_name=nice))