class_docstr: Simple socket server with length-prefixed pickle messages.
  
  Args:
    :count: expected number of nodes in the cluster.
docstr: Block until all reservations are received.
docstr_tok: ["Block","until","all","reservations","are","received","."]
code: def await_reservations(self, sc, status={}, timeout=600):
      """Block until all reservations are received."""
      timespent = 0
      while not self.reservations.done():
          logger.info(
              "waiting for {0} reservations".format(
                  self.reservations.remaining()
              )
          )
          # check status flags for any errors
          if "error" in status:
              sc.cancelAllJobs()
              sc.stop()
              sys.exit(1)
          time.sleep(1)
          timespent += 1
          if timespent > timeout:
              raise Exception(
                  "timed out waiting for reservations to complete"
              )
      logger.info("all reservations completed")
      return self.reservations.get()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import nested_scopes
  from __future__ import print_function
  import logging
  import os
  import pickle
  import select
  import socket
  import struct
  import sys
  import threading
  import time
  from .None import util
label_desc: Use image node_id 2 for calling the Server obj's underlying member method code with example usage: obj.await_reservations(sc, status, timeout) and returns: self