code: def StarGraph(size: int, center_rank: int = 0) -> nx.DiGraph:
      """Generate star structure of graph.
  
      All other ranks are connected to the center_rank. The connection is
      bidirection, i.e. if the weight from node i to node j is non-zero, so
      is the weight from node j to node i.
  
      Example: A StarGraph with 16 nodes:
  
      .. plot::
  
          >>> import networkx as nx
          >>> from bluefog.common import topology_util
          >>> G = topology_util.StarGraph(16)
          >>> nx.draw_spring(G)
      """
      assert size > 0
      topo = np.zeros((size, size))
      for i in range(size):
          topo[i, i] = 1 - 1 / size
          topo[center_rank, i] = 1 / size
          topo[i, center_rank] = 1 / size
      G = nx.from_numpy_array(topo, create_using=nx.DiGraph)
      return G
  
imports: from typing import List, Tuple, Dict, Iterator, Optional
  import math
  import numpy
  import networkx
label_desc: Use image node_id 9 for calling a global function with example usage: StarGraph(size, center_rank) and returns: G