code: def test_sample_lengths(self, obj):
      # Check lengths are right
      assert len(obj.sample(n=4) == 4)
      assert len(obj.sample(frac=0.34) == 3)
      assert len(obj.sample(frac=0.36) == 4)
  
imports: import numpy
  import pytest
  from pandas import DataFrame, Index, Series
  import pandas._testing
  import pandas.core.common
label_desc: Use image node_id 3 for calling the TestSample obj's underlying member method code with example usage: obj.test_sample_lengths(obj) without return types