code: def _sample_with_replacement(population, k, split_every):
      return population.reduction(
          partial(_sample_with_replacement_map_partitions, k=k),
          partial(_sample_reduce, k=k, replace=True),
          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 8 for calling a global function with example usage: _sample_with_replacement(population, k, split_every) and returns: population