code: def _sample(population, k, split_every):
      if k < 0:
          raise ValueError("Cannot take a negative number of samples")
      return population.reduction(
          partial(_sample_map_partitions, k=k),
          partial(_sample_reduce, k=k, replace=False),
          out_type=Bag,
          split_every=split_every,
      )
  
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 5 for calling a global function with example usage: _sample(population, k, split_every) and returns: population