def get_data(self, flatten=False):
        d = dict()
        for key, val in list(self.items()):
            if isinstance(val, (PlotlyDict, PlotlyList)):
                sub_data = val.get_data(flatten=flatten)
                if flatten:
                    for sub_key, sub_val in sub_data.items():
                        key_string = "{0}.{1}".format(key, sub_key)
                        d[key_string] = sub_val
                else:
                    d[key] = sub_data
            else:
                if self._get_attribute_role(key, value=val) == 'data':
                    d[key] = val

                # we use the name to help make data frames
                if self._name in graph_reference.TRACE_NAMES and key == 'name':
                    d[key] = val
        keys = list(d.keys())
        for key in keys:
            if isinstance(d[key], (dict, list)):
                if len(d[key]) == 0:
                    del d[key]
        return d
A thumbnail is created from an image file.
dataset/ETHPy150Open plotly/plotly.py/plotly/graph_objs/graph_objs.py/PlotlyDict.get_data--crossover with--dataset/ETHPy150Open mozilla/kitsune/kitsune/upload/tests/test_tasks.py/CreateThumbnailTestCase.test_create_image_thumbnail_default