code: def test_log():
      s = pd.Series([0, 1, 2, 3, -1])
  
      with pytest.raises(RuntimeError):
          s.log(error="raise")
  
      with pytest.warns(RuntimeWarning):
          out = s.log(error="warn")
  
      assert out[s <= 0].isna().all()
      assert (out.index == s.index).all()
      assert (out[s > 0] == np.log(np.array([1, 2, 3]))).all()
  
      out = s.log(error="ignore")
  
      assert out[s <= 0].isna().all()
      assert (out.index == s.index).all()
      assert (out[s > 0] == np.log(np.array([1, 2, 3]))).all()
  
imports: import numpy
  import pandas
  import pytest
label_desc: Use image node_id 1 for calling a global function with example usage: test_log() without return types