class_docstr: This class tests all member functions of crypten package
class_docstr_tok: ["This","class","tests","all","member","functions","of","crypten","package"]
docstr: Tests that the is_initialized flag is set properly
code: def test_is_initialized(self) -> None:
      """Tests that the is_initialized flag is set properly"""
      comm = crypten.communicator
  
      self.assertTrue(crypten.is_initialized())
      self.assertTrue(comm.is_initialized())
  
      crypten.uninit()
      self.assertFalse(crypten.is_initialized())
      self.assertFalse(comm.is_initialized())
  
      # note that uninit() kills the TTP process, so we need to restart it:
      if (
          self.rank == self.MAIN_PROCESS_RANK
          and crypten.mpc.ttp_required()
      ):
          self.processes += [self._spawn_ttp()]
  
      crypten.init()
      self.assertTrue(crypten.is_initialized())
      self.assertTrue(comm.is_initialized())
  
imports: import itertools
  import logging
  import math
  import random
  import unittest
  from collections import defaultdict
  import crypten
  import crypten.communicator
  import torch
  import torch.nn.functional
  from crypten.common import serial
  from crypten.common.tensor_types import is_float_tensor
  from crypten.config import cfg
  from test.multiprocess_test_case import get_random_test_tensor, MultiProcessTestCase
  from torch import nn
label_desc: Use image node_id 16 for calling the TestCrypten obj's underlying member method code with example usage: obj.test_is_initialized() without return types