code: def test_sample_k_larger_than_partitions():
      bag = db.from_sequence(range(10), partition_size=3)
      bag2 = random.sample(bag, k=8, split_every=2)
      seq = bag2.compute()
      assert len(seq) == 8
  
imports: from __future__ import annotations
  import math
  import random
  import pytest
  import dask.bag
  from dask.bag import random
label_desc: Use image node_id 13 for calling a global function with example usage: test_sample_k_larger_than_partitions() without return types