code: def test_sample_requires_positive_n_frac(self, obj):
      with pytest.raises(
          ValueError,
          match="A negative number of rows requested. Please provide `n` >= 0",
      ):
          obj.sample(n=-3)
      with pytest.raises(
          ValueError,
          match="A negative number of rows requested. Please provide `frac` >= 0",
      ):
          obj.sample(frac=-0.3)
  
imports: import numpy
  import pytest
  from pandas import DataFrame, Index, Series
  import pandas._testing
  import pandas.core.common
label_desc: Use image node_id 6 for calling the TestSample obj's underlying member method code with example usage: obj.test_sample_requires_positive_n_frac(obj) without return types