networkx/networkx — pull request #994 by thenovices (2013-10-28 02:52:13+00:00)
Title: Specify a distribution for dangling node out-edges in PageRank

The primary motivation is that in the previous code, if you wanted to specify a personalization distribution, a uniform distribution would still be assigned to dangling nodes (weighted with probability 1 - alpha). People may want to use the same personalization distribution to patch up dangling nodes, or they may even want to do something entirely separate (who knows...). This pull request allows you to specify that distribution for dangling edges.

This addresses #978 and #960.

(1) First fixed files to conform to PEP8 standards (these are in separate commits)
(2) Patched `pagerank`, `google_matrix`, `pagerank_numpy`, and `pagerank_scipy` to allow for the dangling node distribution as a parameter. Right now it defaults to a uniform distribution if not specified.
(3) Also added a few new tests to cover the new code.

**Question**: We may actually want the default to be the personalization vector, rather than the uniform distribution. (Note that when the personalization vector is not specified, it will still be uniform). What do you guys think? I think this might be a preferred behavior.