MCPcopy
hub / github.com/networkx/networkx / randrange

Method randrange

networkx/utils/misc.py:382–393  ·  view source on GitHub ↗
(self, a, b=None)

Source from the content-addressed store, hash-verified

380 return a + (b - a) * self._rng.random()
381
382 def randrange(self, a, b=None):
383 import numpy as np
384
385 if b is None:
386 a, b = 0, a
387 if b > 9223372036854775807: # from np.iinfo(np.int64).max
388 tmp_rng = PythonRandomViaNumpyBits(self._rng)
389 return tmp_rng.randrange(a, b)
390
391 if isinstance(self._rng, np.random.Generator):
392 return self._rng.integers(a, b)
393 return self._rng.randint(a, b)
394
395 # NOTE: the numpy implementations of `choice` don't support strings, so
396 # this cannot be replaced with self._rng.choice

Callers 8

joint_degree_graphFunction · 0.80
dense_gnm_random_graphFunction · 0.80
gnr_graphFunction · 0.80
gnc_graphFunction · 0.80
test_one_exchange_basicFunction · 0.80

Calls 2

randintMethod · 0.80