565bfe890fa85b433bf1be04189212000b3cd327,ggplot/geoms/geom.py,geom,_make_stat,#geom#,216

Before Change


        
        kwargs = self._cache["kwargs"]
        with suppress(KeyError):
            if isinstance(kwargs["stat"], stat):
                return kwargs["stat"]

        name = "stat_{}".format(
            kwargs.get("stat", self.DEFAULT_PARAMS["stat"]))
        stat_klass = gg_import(name)
        recognized = ((stat_klass.aesthetics() |

After Change



        // More stable when reloading modules than
        // using issubclass
        if (not isinstance(stat_klass, type) and
                hasattr(stat_klass, "compute_layer")):
            return stat_klass

        if isinstance(stat_klass, six.string_types):
            if not stat_klass.startswith("stat_"):
                stat_klass = "stat_{}".format(stat_klass)
            stat_klass = gg_import(stat_klass)

        try:
            recognized = (
                (stat_klass.aesthetics() |
                 six.viewkeys(stat_klass.DEFAULT_PARAMS)) &
                six.viewkeys(kwargs))
        except AttributeError:
            msg = "{} is not a stat".format(stat_klass)
            raise GgplotError(msg)

        stat_params = {}
        for p in recognized:
            stat_params[p] = kwargs[p]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: has2k1/plotnine
Commit Name: 565bfe890fa85b433bf1be04189212000b3cd327
Time: 2016-04-13
Author: has2k1@gmail.com
File Name: ggplot/geoms/geom.py
Class Name: geom
Method Name: _make_stat


Project Name: has2k1/plotnine
Commit Name: 2ab701201f810049aafb68d280280cea0251fd5e
Time: 2015-05-18
Author: has2k1@gmail.com
File Name: ggplot/panel.py
Class Name: Panel
Method Name: train_ranges


Project Name: has2k1/plotnine
Commit Name: ac68200e19e621c9c46428b921157d904c71ed34
Time: 2015-09-18
Author: has2k1@gmail.com
File Name: ggplot/themes/theme.py
Class Name: theme
Method Name: __add__