Documentation for deg_sampler in generation.random_graph
The documentation for deg_sampler function from random_graph says:
A degree sampler function which is called without arguments, and returns a tuple of ints representing the in and out-degree of a given vertex (or a single int for undirected graphs, representing the out-degree). This function is called once per vertex, but may be called more times, if the degree sequence cannot be used to build a graph.
Optionally, you can also pass a function which receives one or two arguments. If block_membership is None, the single argument passed will be the index of the vertex which will receive the degree. If block_membership is not None, the first value passed will be the vertex index, and the second will be the block value of the vertex.
We have already discussed this issue in the past and then you had replied saying that "The function random_graph() will look at how many parameters the deg_sampler takes, and this will trigger different behaviors. Although it is in fact documented, I agree this is confusing and unexpected. Please open an issue in the website, and this will be improved in the future."
I request you to kindly make the necessary improvements whenever it would be possible for you.