Return item data as dict
337531
def __item_data(self, model, index):
        """"""
        item = model.items[index]

        data = {
            "name": item.name,
            "data": item.data,
            "doc": getattr(item, "doc", None),
            "path": getattr(item, "path", None),
        }

        return data
1183029
def get_data(self):
        
        return {key: "".join(chr(byte) for byte in data)
                for key, data in six.iteritems(self.data)}
602662
def to_json(self) -> Mapping:
        
        return {str(x): str(y) for x, y in self.items()}
567208
def data(self):
        
        d = {}
        for name in self.key_names:
            d[name] = self.__dict__.get(name, None)
        return d
590931
def get_item_data(self, item):
        """"""
        filename, line_number_str = get_item_user_text(item).split(self.SEP)
        return filename, int(line_number_str)
627859
def convert_dict(obj, ids, parent, attr_type, item_func, cdata):
    """"""
    LOG.info('Inside convert_dict(): obj type is: "%s", obj="%s"' % (
        type(obj).__name__, unicode_me(obj))
    )
    output = []
    addline = output.append
    
    item_name = item_func(parent)
    
    for key, val in obj.items():
        LOG.info('Looping inside convert_dict(): key="%s", val="%s", type(val)="%s"' % (
            unicode_me(key), unicode_me(val), type(val).__name__)
        )

        attr = {} if not ids else {'id': '%s' % (get_unique_id(parent)) }

        key, attr = make_valid_xml_name(key, attr)

        if isinstance(val, numbers.Number) or type(val) in (str, unicode):
            addline(convert_kv(key, val, attr_type, attr, cdata))

        elif hasattr(val, 'isoformat'): # datetime
            addline(convert_kv(key, val.isoformat(), attr_type, attr, cdata))

        elif type(val) == bool:
            addline(convert_bool(key, val, attr_type, attr, cdata))

        elif isinstance(val, dict):
            if attr_type:
                attr['type'] = get_xml_type(val)
            addline('<%s%s>%s</%s>' % (
                key, make_attrstring(attr), 
                convert_dict(val, ids, key, attr_type, item_func, cdata), 
                key
                )
            )

        elif isinstance(val, collections.Iterable):
            if attr_type:
                attr['type'] = get_xml_type(val)
            addline('<%s%s>%s</%s>' % (
                key, 
                make_attrstring(attr), 
                convert_list(val, ids, key, attr_type, item_func, cdata), 
                key
                )
            )

        elif val is None:
            addline(convert_none(key, val, attr_type, attr, cdata))

        else:
            raise TypeError('Unsupported data type: %s (%s)' % (
                val, type(val).__name__)
            )

    return ''.join(output)
925080
def json_data(self):
        
        def stringify_keys(d):
            if not isinstance(d, dict):
                return d
            return dict((str(k), stringify_keys(v)) for k, v in d.items())
        data = self.make_data()
        json_data = json.dumps(stringify_keys(data))
        return json_data
763258
def items(self):
        ''''''
        return [(self.keys[x], self.values[x]) for x in range(len(self.keys))]
167370
def as_dictlist(self):
        
        data = []
        for row_i, row in enumerate(self.row_index):
            for col_i, col in enumerate(self.col_index):
                value = self.values_by_row[row_i][col_i]
                data.append({
                    "row": row,
                    "col": col,
                    "value": value,
                    })
        return data
885132
def group_dict(items, keyfunc):
    
    result = collections.defaultdict(list)
    for i in items:
        key = keyfunc(i)
        result[key].append(i)
    return result
527443
def export_dict(self):
        ""
        return {k: v.export_dict() if isinstance(v, self.__class__) else v
                for k, v in self.items()}
1065944
def _process_json(self, item, parent=None):
        
        if "data" in item:
            return [self._process_json(i, parent) for i in item["data"]]

        result = {}
        for key, value in item.items():
            if isinstance(value, dict) and ("type" in value or "data" in value):
                value = self._process_json(value, parent)
            result[key] = value
        if parent is not None and hasattr(parent, "type"):
            result[parent.type] = parent

        if "type" in result:
            object_class = self.objects_types.get(result["type"], Resource)
        else:
            object_class = self.objects_types.get(parent, Resource)
        return object_class(self, result)
213356
def visit_Dict(self, node: AST, dfltChaining: bool = True) -> str:
        """"""
        items = (': '.join((self.visit(key), self.visit(value)))
                 for key, value in zip(node.keys, node.values))
        return f"{{{', '.join(items)}}}"
1215282
def _transform_to_dict(result):
        
        result_dict = {}
        property_list = result.item
        for item in property_list:
            result_dict[item.key[0]] = item.value[0]
        return result_dict
417532
def as_dict(self):
        """"""
        dicts = [x.as_dict for x in self.children]
        return {'{0} {1}'.format(self.name, self.value): dicts}
994994
def get_values(self):
        
        return_dict = {}
        for i,ctrl in enumerate(self.list_ctrls):
            if hasattr(self.parse_funcs,'__getitem__') and len(self.parse_funcs)>i and hasattr(self.parse_funcs[i],'__call__'):
                try: return_dict[self.inputs[i]] = self.parse_funcs[i](ctrl.GetValue())
                except: return_dict[self.inputs[i]] = ctrl.GetValue()
            else:
                return_dict[self.inputs[i]] = ctrl.GetValue()
        return ('' not in list(return_dict.values()), return_dict)
651153
def convert_items(self, items):
        """"""
        return ((key, self.convert(value, self)) for key, value in items)