code: def _assign_work_unit(self, node):
          
          assert self.workqueue
  
          # Grab a unit of work
          scope, work_unit = self.workqueue.popitem(last=False)
  
          # Keep track of the assigned work
          assigned_to_node = self.assigned_work.setdefault(node, default=OrderedDict())
          assigned_to_node[scope] = work_unit
  
          # Ask the node to execute the workload
          worker_collection = self.registered_collections[node]
          nodeids_indexes = [
              worker_collection.index(nodeid)
              for nodeid, completed in work_unit.items()
              if not completed
          ]
  
          node.send_runtest_some(nodeids_indexes)
docs: Assign a work unit to a node.