code: def test_labels():
      """
      Test invalid arguments to chart components
      """
      gg = ggplot(data, aes(x="x", y="y"))
      gg = gg + geom_point()
      gg = gg + xlab("xlab")
      gg = gg + ylab("ylab")
      gg = gg + ggtitle("title")
  
      assert gg.labels.x == "xlab"
      assert gg.labels.y == "ylab"
      assert gg.labels.title == "title"
  
      gg = gg + labs(
          x="xlab2", y="ylab2", title="title2", caption="caption2"
      )
      assert gg.labels.x == "xlab2"
      assert gg.labels.y == "ylab2"
      assert gg.labels.title == "title2"
      assert gg.labels.caption == "caption2"
  
      with pytest.raises(PlotnineError):
          gg = gg + labs(z="z-axis")
  
      with pytest.raises(PlotnineError):
          gg = gg + xlab(None)
  
      with pytest.raises(PlotnineError):
          gg = gg + ylab(None)
  
      with pytest.raises(PlotnineError):
          gg = gg + ggtitle(None)
  
imports: from copy import deepcopy
  import numpy
  import pandas
  import pytest
  from plotnine import aes, after_scale, after_stat, annotate, coord_trans, facet_null, geom_bar, geom_histogram, geom_line, geom_point, ggplot, ggtitle, guides, labs, lims, scale_x_continuous, stage, stat_identity, theme, theme_gray, xlab, xlim, ylab
  from plotnine.exceptions import PlotnineError, PlotnineWarning
  from plotnine.mapping.aes import is_valid_aesthetic
label_desc: Use image node_id 1 for calling a global function with example usage: test_labels() without return types