code: def _weighted_sampling_without_replacement(population, weights, k):
      """
      Source:
          Weighted random sampling with a reservoir, Pavlos S. Efraimidis, Paul G. Spirakis
      """
      elt = [
          (math.log(rnd.random()) / weights[i], i)
          for i in range(len(weights))
      ]
      return [population[x[1]] for x in heapq.nlargest(k, elt)]
  
file_path: dask/dask/bag/random.py
imports: from __future__ import annotations
  import heapq
  import math
  import random
  from functools import partial
  from itertools import islice
  from dask.bag.core import Bag
label_desc: Use image node_id 4 for calling a global function with example usage: _weighted_sampling_without_replacement(population, weights, k) and returns: unknown