code: def test_after_scale_mapping():
      data = pd.DataFrame({"x": [1, 2, 2, 3, 3, 3, 4, 4, 4, 4]})
      data2 = pd.DataFrame(
          {
              # Same as above, but add 2 of each unique element
              "x": [1, 2, 2, 3, 3, 3, 4, 4, 4, 4]
              + [1, 2, 3, 4] * 2
          }
      )
  
      p = ggplot(data) + geom_bar(
          aes(x="x", ymax=after_scale("ymax + 2"))
      )
      p2 = ggplot(data2) + geom_bar(aes(x="x"))
  
      assert p + lims(y=(0, 7)) == "after_scale_mapping"
      assert p2 + lims(y=(0, 7)) == "after_scale_mapping"
  
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 11 for calling a global function with example usage: test_after_scale_mapping() without return types