def Run(self):
    server_exits = []
    server_ports = []
    exception_info = (None, None, None)
    try:
      for initializer, init_args, init_kwargs in self.initializers:
        server = initializer(*init_args, **init_kwargs)
        if server:
          server_exits.insert(0, server.__exit__)
          server.__enter__()
          if hasattr(server, 'server_port'):
            server_ports.append(server.server_port)
      for initializer, init_args, init_kwargs in self.traffic_shapers:
        init_kwargs['ports'] = server_ports
        shaper = initializer(*init_args, **init_kwargs)
        if server:
          server_exits.insert(0, shaper.__exit__)
          shaper.__enter__()
      while True:
        time.sleep(1)
        if self.should_exit:
          break
    except Exception:
      exception_info = sys.exc_info()
    finally:
      for server_exit in server_exits:
        try:
          if server_exit(*exception_info):
            exception_info = (None, None, None)
        except Exception:
          exception_info = sys.exc_info()
      if exception_info != (None, None, None):
        # pylint: disable=raising-bad-type
        raise exception_info[0], exception_info[1], exception_info[2]
Create the servers and loop.
dataset/ETHPy150Open chromium/web-page-replay/servermanager.py/ServerManager.Run