code: def num_tasks(self, work_spec_name):
          '''Get the total number of work units for some work spec.'''
          return self.num_finished(work_spec_name) + \
                 self.num_failed(work_spec_name) + \
                 self.registry.len(WORK_UNITS_ + work_spec_namef num_tasks(self, work_spec_name):
          '''Get the total number of work units for some work spec.'''
          return self.num_finished(work_spec_name) + \
                 self.num_failed(work_spec_name) + \
                 self.registry.len(WORK_UNITS_ + work_spec_name)
docs: Get the total number of work units for some work spec.