Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
Index your code
hub
/
github.com/networkx/networkx
/ sample
Method
sample
networkx/utils/misc.py:415–416 ·
view source on GitHub ↗
(self, seq, k)
Source
from the content-addressed store, hash-verified
413
# Commented out versions are not used by NetworkX
414
415
def
sample(self, seq, k):
416
return
self._rng.choice(list(seq), size=(k,), replace=False)
417
418
def
randint(self, a, b):
419
import
numpy
as
np
Callers
15
test_PythonRandomInterface_RandomState
Function · 0.95
test_PythonRandomInterface_Generator
Function · 0.95
test_neighbors_complete_graph
Method · 0.80
test_non_neighbors
Method · 0.80
directed_joint_degree_graph
Function · 0.80
add_node
Method · 0.80
add_cp_peering_link
Method · 0.80
random_labeled_rooted_forest
Function · 0.80
k_random_intersection_graph
Function · 0.80
phase2
Method · 0.80
sample
Function · 0.80
average_clustering
Function · 0.80
Calls
1
choice
Method · 0.80
Tested by
6
test_PythonRandomInterface_RandomState
Function · 0.76
test_PythonRandomInterface_Generator
Function · 0.76
test_neighbors_complete_graph
Method · 0.64
test_non_neighbors
Method · 0.64
test_one_exchange_basic
Function · 0.64
test_negative_weights
Function · 0.64