code: def ExponentialTwoGraph(size: int) -> nx.DiGraph:
      """Generate graph topology such that each points only
      connected to a point such that the index difference is the power of 2.
  
      Example: A ExponentialTwoGraph with 12 nodes:
  
      .. plot::
          :context: close-figs
  
          >>> import networkx as nx
          >>> from bluefog.common import topology_util
          >>> G = topology_util.ExponentialTwoGraph(12)
          >>> nx.draw_circular(G)
      """
      assert size > 0
      x = np.array(
          [1.0 if i & (i - 1) == 0 else 0 for i in range(size)]
      )
      x /= x.sum()
      topo = np.empty((size, size))
      for i in range(size):
          topo[i] = np.roll(x, i)
      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 4 for calling a global function with example usage: ExponentialTwoGraph(size) and returns: G