docstr: Initializes a Trusted Third Party server that receives requests
docstr_tok: ["Initializes","a","Trusted","Third","Party","server","that","receives","requests"]
code: def __init__(self):
      """Initializes a Trusted Third Party server that receives requests"""
      # Initialize connection
      crypten.init()
      self.ttp_group = comm.get().ttp_group
      self.comm_group = comm.get().ttp_comm_group
      self.device = "cpu"
      self._setup_generators()
      ttp_rank = comm.get().get_ttp_rank()
  
      logging.info("TTPServer Initialized")
      try:
          while True:
              # Wait for next request from client
              message = comm.get().recv_obj(0, self.ttp_group)
              logging.info("Message received: %s" % message)
  
              if message == "terminate":
                  logging.info("TTPServer shutting down.")
                  return
  
              function = message["function"]
              device = message["device"]
              args = message["args"]
              kwargs = message["kwargs"]
  
              self.device = device
  
              result = getattr(self, function)(*args, **kwargs)
  
              comm.get().send_obj(result.size(), 0, self.ttp_group)
              comm.get().broadcast(result, ttp_rank, self.comm_group)
      except RuntimeError as err:
          logging.info(
              "Encountered Runtime error. TTPServer shutting down:"
          )
          logging.info(f"{err}")
  
imports: import logging
  import crypten
  import crypten.communicator
  import torch
  import torch.distributed
  from crypten.common.rng import generate_kbit_random_tensor, generate_random_ring_element
  from crypten.common.util import count_wraps
  from crypten.mpc.primitives import ArithmeticSharedTensor, BinarySharedTensor
  from .provider import TupleProvider
label_desc: Use image node_id 1 to create a new TTPServer object  with example: obj = TTPServer()