def degree_dist(graph, limits=(0, 0), bin_num=10, mode='out'):
 deg = []
 if (mode == 'inc'):
  get_deg = graph.inc_degree
 else:
  get_deg = graph.out_degree
 for node in graph:
  deg.append(get_deg(node))
 if (not deg):
  return []
 results = _binning(values=deg, limits=limits, bin_num=bin_num)
 return results

def degree_dist ( graph , limits = ( 0 , 0 ) , bin_num = 10 , mode = 'out' ) : deg = [ ] if ( mode == 'inc' ) : get_deg = graph . inc_degree else : get_deg = graph . out_degree for node in graph : deg . append ( get_deg ( node ) ) if ( not deg ) : return [ ] results = _binning ( values = deg , limits = limits , bin_num = bin_num ) return results
computes the degree distribution for a graph .