code: def test_sample_return_bag():
      seq = range(20)
      sut = db.from_sequence(seq, npartitions=3)
      assert isinstance(random.sample(sut, k=2), db.Bag)
  
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 15 for calling a global function with example usage: test_sample_return_bag() without return types