original_docstring: Execute the Simulator for the given topology
  
      @param machine The machine to simulatr
      @param topo The topology to Simulator
  
      @return The cost of executing an atomic broadcast on that machine.
      
docstring: Execute the Simulator for the given topology
  @param machine The machine to simulatr
  @param topo The topology to Simulator
  
  @return The cost of executing an atomic broadcast on that machine.
docstring_tokens: Execute the Simulator for the given topology @param machine The machine to simulatr @param topo The topology to Simulator @return The cost of executing an atomic broadcast on that machine .
code: def run_sim(machine, topo):
      """Execute the Simulator for the given topology
  
      @param machine The machine to simulatr
      @param topo The topology to Simulator
  
      @return The cost of executing an atomic broadcast on that machine.
      """
      import subprocess
      import re
  
      cmd = [ './simulator.py',  machine, topo ]
      res = None
  
      try:
          print('Executing', ' '.join(cmd))
          for l in subprocess.check_output(cmd, stderr=subprocess.STDOUT, cwd="/home/skaestle/projects/Simulator/").split('\n'):
  
              m = re.match('Cost atomic broadcast for tree is: (\d+) \(\d+\), last node is \d+', l)
              if m:
                  res = int(m.group(1))
  
      except subprocess.CalledProcessError:
          helpers.warn(('Simulator failed for machine %s topo %s ' % (machine, topo)))
          raise
  
      return res
code_tokens: def run_sim ( machine , topo ) : import subprocess import re cmd = [ './simulator.py' , machine , topo ] res = None try : print ( 'Executing' , ' ' . join ( cmd ) ) for l in subprocess . check_output ( cmd , stderr = subprocess . STDOUT , cwd = "/home/skaestle/projects/Simulator/" ) . split ( '\n' ) : m = re . match ( 'Cost atomic broadcast for tree is: (\d+) \(\d+\), last node is \d+' , l ) if m : res = int ( m . group ( 1 ) ) except subprocess . CalledProcessError : helpers . warn ( ( 'Simulator failed for machine %s topo %s ' % ( machine , topo ) ) ) raise return res
short_docstring: Execute the Simulator for the given topology
  @param machine The machine to simulatr
  @param topo The topology to Simulator
short_docstring_tokens: Execute the Simulator for the given topology @param machine The machine to simulatr @param topo The topology to Simulator
comment: """Execute the Simulator for the given topology
  
      @param machine The machine to simulatr
      @param topo The topology to Simulator
  
      @return The cost of executing an atomic broadcast on that machine.
      """