code: def weighted_sample_without_replacement(
      population, weights, k, rng=random
  ):
      if k > len(population):
          raise ValueError(
              "Cannot take a larger sample than population when without replacement"
          )
      v = [rng.random() ** (1 / w) for w in weights]
      order = sorted(range(len(population)), key=lambda i: v[i])
      return [population[i] for i in order[-k:]]
  
imports: import math
  import random
  from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import torch
  import torchaudio
label_desc: Use image node_id 1 for calling a global function with example usage: weighted_sample_without_replacement(population, weights, k, rng) and returns: unknown