'If called with a single argument that is a dict or
pandas.DataFrame, treat that implicitly as the "data" attribute.'

def __init__(self, *args, **kw):

    if ((len(args) == 1) and ('data' not in kw)):
        kw['data'] = args[0]
    raw_data = kw.pop('data', {})
    if (not isinstance(raw_data, dict)):
        if (pd and isinstance(raw_data, pd.DataFrame)):
            raw_data = self._data_from_df(raw_data)
        elif (pd and isinstance(raw_data, pd.core.groupby.GroupBy)):
            raw_data = self._data_from_groupby(raw_data)
        else:
            raise ValueError(('expected    a    dict    or    pandas.DataFrame,    got    %s' % raw_data))
    super(ColumnDataSource, self).__init__(**kw)
    self.column_names[:] = list(raw_data.keys())
    self.data.update(raw_data)
