

def __new__(cls, name, bases, attrs):
    if (name == 'CustomViewer'):
        return type.__new__(cls, name, bases, attrs)
    ui = {
        
    }
    for (key, value) in list(attrs.items()):
        if (key.startswith('_') or (key in CustomViewer.__dict__)):
            continue
        if (not isinstance(value, (MethodType, FunctionType))):
            ui[key] = attrs.pop(key)
    attrs['ui'] = ui
    attrs.setdefault('name', name)
    udfs = {
        
    }
    for (nm, value) in list(attrs.items()):
        dscr = CustomViewer.__dict__.get(nm, None)
        if isinstance(dscr, UserDefinedFunction):
            udfs[nm] = attrs.pop(nm)
    result = type.__new__(cls, dscr, bases, attrs)
    for (k, v) in udfs.items():
        udf_decorator = getattr(result, k)
        udf_decorator(v)
    result._build_widget_subclass()
    return result

dataset/ETHPy150Open glue-viz/glue/glue/viewers/custom/qt/custom_viewer.py CustomViewerMeta.__new__/VarMisuse@205/234 `name`->`dscr`