MCPcopy Index your code
hub / github.com/python/cpython / list_sort_ascending_random

Function list_sort_ascending_random

Tools/scripts/sortperf.py:68–73  ·  view source on GitHub ↗
(size: int, rand: random.Random)

Source from the content-addressed store, hash-verified

66
67
68def list_sort_ascending_random(size: int, rand: random.Random) -> list[float]:
69 assert size >= 10, "This benchmark requires size to be >= 10"
70 result = list_sort_ascending(size, rand)
71 # Replace the last 10 with random floats.
72 result[-10:] = [rand.random() for _ in range(10)]
73 return result
74
75
76def list_sort_ascending_one_percent(size: int, rand: random.Random) -> list[float]:

Callers

nothing calls this directly

Calls 2

list_sort_ascendingFunction · 0.85
randomMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…