docstr: Tests samples have expected length.
docstr_tok: ["Tests","samples","have","expected","length","."]
code: def test_reservoir_sample_length(self):
      """Tests samples have expected length."""
      first_ten_ints = range(10)
      # Test sampling with k > len(iterable).
      self.assertEqual(
          len(utils.reservoir_sample(first_ten_ints, 11)), 10
      )
      # Test sampling with k == len(iterable).
      self.assertEqual(
          len(utils.reservoir_sample(first_ten_ints, 10)), 10
      )
      # Test sampling with k < len(iterable).
      self.assertEqual(
          len(utils.reservoir_sample(first_ten_ints, 9)), 9
      )
      # Test sampling with k == 0.
      self.assertEqual(
          len(utils.reservoir_sample(first_ten_ints, 0)), 0
      )
      # Test sampling with k < 0 (bad args).
      with self.assertRaises(ValueError):
          utils.reservoir_sample(first_ten_ints, -1)
  
file_path: deepvariant/third_party/nucleus/util/utils_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import numpy.testing
  from third_party.nucleus.testing import test_utils
  from third_party.nucleus.util import ranges
  from third_party.nucleus.util import utils
label_desc: Use image node_id 3 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_reservoir_sample_length() without return types