code: def test_stat_parameter_sharing():
      # When the stat has a parameter with the same name as
      # the geom aesthetic,they both get their value
  
      # NOTE: This test may need to be modified when the
      # geom & stat internals change
      class stat_abc(stat):
          DEFAULT_PARAMS = {
              "geom": "point",
              "position": "identity",
              "weight": 1,
          }
          REQUIRED_AES = {"x"}
          CREATES = {"y"}
  
          @classmethod
          def compute_panel(cls, data, scales, **params):
              return data
  
      class geom_abc(geom):
          DEFAULT_PARAMS = {"stat": stat_abc, "position": "identity"}
          REQUIRED_AES = {"x", "weight"}
  
          @staticmethod
          def draw(pinfo, panel_params, coord, ax, **kwargs):
              pass
  
      # weight is manually set, it should be a stat parameter and
      # not a geom manual setting
      g = geom_abc(weight=4)
      assert "weight" in g.aes_params
      assert "weight" in g._stat.params
  
      g = geom_abc(aes(weight="mpg"))
      assert "weight" in g.mapping
      assert "weight" in g._stat.params
  
file_path: plotnine/tests/test_stat.py
imports: import numpy
  import pytest
  from plotnine import aes, geom_bar, ggplot
  from plotnine.data import mtcars
  from plotnine.exceptions import PlotnineError, PlotnineWarning
  from plotnine.geoms.geom import geom
  from plotnine.stats.stat import stat
label_desc: Use image node_id 2 for calling a global function with example usage: test_stat_parameter_sharing() and returns: data