# Path: controlcenter/utils.py
# def deepmerge(*dicts):
#     merged = {}
#     for dct in dicts:
#         for key, value in dct.items():
#             if not isinstance(value, dict):
#                 merged[key] = value
#             else:
#                 origin = merged.get(key, {})
#                 merged[key] = deepmerge(origin, value)
#     return merged
# 
# Path: controlcenter/widgets/core.py
# class Widget(BaseWidget):
#     limit_to = 10  # It's always a good reason to limit queryset
#     width = MEDIUM
#     template_name_prefix = 'controlcenter/widgets'
# 
# class WidgetMeta(ABCMeta):
#     # Makes certain methods cached
#     CACHED_ATTRS = (
#         # values for charts and itemlists
#         'values',
#     )
# 
#     def __new__(mcs, name, bases, attrs):
#         # We can't use it on __init__ because
#         # cached_property fires on property's __get__
#         for attr in mcs.CACHED_ATTRS:
#             if attr in attrs:
#                 attrs[attr] = cached_property(attrs[attr])
#         return super(WidgetMeta, mcs).__new__(mcs, name, bases, attrs)


from ..utils import deepmerge
from .core import Widget, WidgetMeta

__all__ = ['LineChart', 'TimeSeriesChart', 'BarChart', 'PieChart',
           'SingleLineChart', 'SingleBarChart', 'SinglePieChart',
           'LINE', 'BAR', 'PIE']

# Chart types
PIE, BAR, LINE = 'Pie', 'Bar', 'Line'


class Chartist(object):
    def __init__(self):
        self.options = {}

    def update(self, obj):
        for key in dir(obj):
            value = getattr(obj, key)
            if key == 'options':
                self.options = deepmerge(self.options, value)
            elif not key.startswith('__') and not callable(value):
                setattr(self, key, value)


class ChartMeta(WidgetMeta):

# Path: controlcenter/utils.py
# def deepmerge(*dicts):
#     merged = {}
#     for dct in dicts:
#         for key, value in dct.items():
#             if not isinstance(value, dict):
#                 merged[key] = value
#             else:
#                 origin = merged.get(key, {})
#                 merged[key] = deepmerge(origin, value)
#     return merged
# 
# Path: controlcenter/widgets/core.py
# class Widget(BaseWidget):
#     limit_to = 10  # It's always a good reason to limit queryset
#     width = MEDIUM
#     template_name_prefix = 'controlcenter/widgets'
# 
# class WidgetMeta(ABCMeta):
#     # Makes certain methods cached
#     CACHED_ATTRS = (
#         # values for charts and itemlists
#         'values',
#     )
# 
#     def __new__(mcs, name, bases, attrs):
#         # We can't use it on __init__ because
#         # cached_property fires on property's __get__
#         for attr in mcs.CACHED_ATTRS:
#             if attr in attrs:
#                 attrs[attr] = cached_property(attrs[attr])
#         return super(WidgetMeta, mcs).__new__(mcs, name, bases, attrs)


# Path: controlcenter/widgets/charts.py
from ..utils import deepmerge
from .core import Widget, WidgetMeta


__all__ = ['LineChart', 'TimeSeriesChart', 'BarChart', 'PieChart',
           'SingleLineChart', 'SingleBarChart', 'SinglePieChart',
           'LINE', 'BAR', 'PIE']

# Chart types
PIE, BAR, LINE = 'Pie', 'Bar', 'Line'


class Chartist(object):
    def __init__(self):
        self.options = {}

    def update(self, obj):
        for key in dir(obj):
            value = getattr(obj, key)
            if key == 'options':
                self.options = deepmerge(self.options, value)
            elif not key.startswith('__') and not callable(value):
                setattr(self, key, value)


class ChartMeta(WidgetMeta):

    CACHED_ATTRS = WidgetMeta.CACHED_ATTRS + (