def gaussian_random_partition_graph(n, s, v, p_in, p_out, directed=False, seed=None):
 if (s > n):
  raise nx.NetworkXError('s must be <= n')
 assigned = 0
 sizes = []
 while True:
  size = int(random.normalvariate(s, ((float(s) / v) + 0.5)))
  if (size < 1):
   continue
  if ((assigned + size) >= n):
   sizes.append((n - assigned))
   break
  assigned += size
  sizes.append(size)
 return random_partition_graph(sizes, p_in, p_out, directed, seed)

def gaussian_random_partition_graph ( n , s , v , p_in , p_out , directed = False , seed = None ) : if ( s > n ) : raise nx . NetworkXError ( 's must be <= n' ) assigned = 0 sizes = [ ] while True : size = int ( random . normalvariate ( s , ( ( float ( s ) / v ) + 0.5 ) ) ) if ( size < 1 ) : continue if ( ( assigned + size ) >= n ) : sizes . append ( ( n - assigned ) ) break assigned += size sizes . append ( size ) return random_partition_graph ( sizes , p_in , p_out , directed , seed )
generate a gaussian random partition graph .