code: def test_exceptions():
      # no mapping, no limits
      p = ggplot(data) + stat_function(fun=np.sin)
      p.draw_test()
  
      # fun not callable
      with pytest.raises(PlotnineError):
          p = ggplot(data, aes("x"))
          print(p + stat_function(fun=1))
  
imports: import numpy
  import pandas
  import pytest
  from plotnine import aes, arrow, ggplot, stat_function
  from plotnine.exceptions import PlotnineError
label_desc: Use image node_id 3 for calling a global function with example usage: test_exceptions() without return types