code: def set_commands(self, commands, timeout=None):
          
          self.desired_commands = commands
  
          target_commands = list(self.desired_commands)
          for process in list(self.processes):
              found = False
              for i in range(len(target_commands)):
                  if process["command"] == target_commands[i]:
                      target_commands.pop(i)
                      found = True
                      break
  
              if not found:
                  self.stop_process(process, timeout)
  
          # What is left are the commands to add
          # TODO: we should only do this once memory conditions allow
          for command in target_commands:
              self.spawn(command)
docs: Sets the processes' desired commands for this pool and manages diff to reach that state