def blockmodel(G, partition, multigraph=False):
 if multigraph:
  return nx.quotient_graph(G, partition, create_using=nx.MultiGraph(), relabel=True)
 else:
  return nx.quotient_graph(G, partition, relabel=True)

def blockmodel ( G , partition , multigraph = False ) : if multigraph : return nx . quotient_graph ( G , partition , create_using = nx . MultiGraph ( ) , relabel = True ) else : return nx . quotient_graph ( G , partition , relabel = True )
returns a reduced graph constructed using the generalized block modeling technique .