Language Features

PyHeapq

Python stdlib module — heapq. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

Other Methods

.heapify()Neutral
#
Signature
heapify(heap)

Transform list into a heap, in-place, in O(len(heap)) time.

.heappop()Neutral
#
Signature
heappop(heap)

Pop the smallest item off the heap, maintaining the heap invariant.

.heappush()Neutral
#
Signature
heappush(heap, item)

Push item onto heap, maintaining the heap invariant.

.heappushpop()Neutral
#
Signature
heappushpop(heap, item)

Push item on the heap, then pop and return the smallest item from the heap.

.heapreplace()Neutral
#
Signature
heapreplace(heap, item)

Pop and return the current smallest value, and add the new item.

.merge()Neutral
#
Signature
merge(iterables, key, reverse)

Merge multiple sorted inputs into a single sorted output.

.nlargest()Neutral
#
Signature
nlargest(n, iterable, key)

Find the n largest elements in a dataset.

.nsmallest()Neutral
#
Signature
nsmallest(n, iterable, key)

Find the n smallest elements in a dataset.

Fully-Qualified Names

FQNField
heapqfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

rule.py
import heapq