code: def test_stat_bin():
      x = [1, 2, 3]
      y = [1, 2, 3]
      data = pd.DataFrame({"x": x, "y": y})
  
      # About the default bins
      gg = ggplot(aes(x="x"), data) + stat_bin()
  
      with pytest.warns(PlotnineWarning) as record:
          gg.draw_test()
  
      res = ("bins" in str(item.message).lower() for item in record)
      assert any(res)
  
      # About the ignoring the y aesthetic
      gg = ggplot(aes(x="x", y="y"), data) + stat_bin()
      with pytest.raises(PlotnineError):
          gg.draw_test()
  
imports: import numpy
  import pandas
  import pytest
  from plotnine import aes, ggplot, stat_bin, stat_density, xlim
  from plotnine.exceptions import PlotnineError, PlotnineWarning
label_desc: Use image node_id 1 for calling a global function with example usage: test_stat_bin() without return types