def __new__(meta_cls, class_name, bases, class_dict):
        names = set()
        names_with_refs = set()
        container_names = set()

        # Now handle all the Override
        overridden_defaults = {}
        for name, prop in class_dict.items():
            if not isinstance(prop, Override):
                continue
            if prop.default_overridden:
                overridden_defaults[name] = prop.default

        for name, default in overridden_defaults.items():
            del class_dict[name]

        generators = dict()
        for name, generator in class_dict.items():
            if isinstance(generator, PropertyFactory):
                generators[name] = generator
            elif isinstance(generator, type) and issubclass(generator, PropertyFactory):
                # Support the user adding a property without using parens,
                # i.e. using just the Property subclass instead of an
                # instance of the subclass
                generators[name] = generator.autocreate()

        dataspecs = {}
        new_class_attrs = {}

        def add_prop(prop):
            name = prop.name
            if name in new_class_attrs:
                raise RuntimeError("Two property generators both created %s.%s" % (class_name, name))
            new_class_attrs[name] = prop
            names.add(name)

            if prop.has_ref:
                names_with_refs.add(name)

            if isinstance(prop, BasicProperty):
                if isinstance(prop.descriptor, ContainerProperty):
                    container_names.add(name)

                if isinstance(prop.descriptor, DataSpec):
                    dataspecs[name] = prop

        for name, generator in generators.items():
            props = generator.make_properties(name)
            replaced_self = False
            for prop in props:
                if prop.name in generators:
                    if generators[prop.name] is generator:
                        # a generator can replace itself, this is the
                        # standard case like `foo = Int()`
                        replaced_self = True
                        add_prop(prop)
                    else:
                        # if a generator tries to overwrite another
                        # generator that's been explicitly provided,
                        # use the prop that was manually provided
                        # and ignore this one.
                        pass
                else:
                    add_prop(prop)
            # if we won't overwrite ourselves anyway, delete the generator
            if not replaced_self:
                del class_dict[name]

        class_dict.update(new_class_attrs)

        class_dict["__properties__"] = names
        class_dict["__properties_with_refs__"] = names_with_refs
        class_dict["__container_props__"] = container_names
        if len(overridden_defaults) > 0:
            class_dict["__overridden_defaults__"] = overridden_defaults
        if dataspecs:
            class_dict["__dataspecs__"] = dataspecs

        if "__example__" in class_dict:
            path = class_dict["__example__"]
            class_dict["__doc__"] += _EXAMPLE_TEMPLATE % dict(path=path)

        return super(MetaHasProps, meta_cls).__new__(meta_cls, class_name, bases, class_dict)
dataset/ETHPy150Open bokeh/bokeh/bokeh/core/properties.py/MetaHasProps.__new__/original