code: def _is_initialized(self, bucket: Bucket) -> bool:
      if self.initialized_entities_partitions is None:
          # No initialization is needed
          return True
      if len(self.initialized_entities_partitions) == 0:
          # Initialization is needed but nothing has been initialized yet:
          # it's up to us to inizialize something, and we can choose anything.
          return True
      # Initialization is needed: each embedding table (i.e., an (entity type,
      # partition) pair) must either have already been initialized or be
      # connected to an already-initialized one by a relation type. This is to
      # ensure that the embedding spaces of different partitions are aligned.
      # As here we don't have access to relation types we use an approximation
      # which should work well in all but the most pathological scenarios.
      return all(
          (entity, bucket.lhs) in self.initialized_entities_partitions
          for entity in self.entities_lhs
      ) or all(
          (entity, bucket.rhs) in self.initialized_entities_partitions
          for entity in self.entities_rhs
      )
  
imports: import logging
  import random
  from abc import ABC, abstractmethod
  from collections import defaultdict
  from statistics import mean
  from typing import Dict, List, NamedTuple, Optional, Set, Tuple
  from torchbiggraph.config import BucketOrder
  from torchbiggraph.distributed import Startable
  from torchbiggraph.rpc import Client, Server
  from torchbiggraph.stats import Stats, StatsHandler
  from torchbiggraph.types import Bucket, EntityName, Partition, Rank, Side
label_desc: Use image node_id 4 for calling the LockServer obj's underlying member method code with example usage: obj._is_initialized(bucket) and returns: unknown, True, True