code: def test_choices_size_exactly_k():
      seq = range(20)
      sut = db.from_sequence(seq, npartitions=3)
      li = list(random.choices(sut, k=2).compute())
      assert len(li) == 2
      assert all(i in seq for i in li)
  
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 1 for calling a global function with example usage: test_choices_size_exactly_k() without return types