code: def test_weight():
      # The boxes of the two plots should differ slightly due to the
      # method used to calculate weighted percentiles. There is no
      # standard method for calculating weighted percentiles.
      data = pd.DataFrame(
          {
              "x": list("a" * 11 + "b" * 5),
              "y": np.hstack(
                  [[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 15], [1, 2, 3, 4, 15]]
              ),
              "weight": np.hstack([np.ones(11), [1, 2, 3, 4, 1]]),
          }
      )
      p = (
          ggplot(data, aes(x="x", y="y", weight="weight"))
          + geom_boxplot()
      )
      assert p == "weight"
  
file_path: plotnine/tests/test_geom_boxplot.py
imports: import numpy
  import pandas
  from plotnine import aes, coord_flip, geom_boxplot, ggplot, position_nudge
label_desc: Use image node_id 3 for calling a global function with example usage: test_weight() without return types