Package up the public attributes as a dict.
778269
def as_dict(self):
        """"""
        attrs = vars(self)
        return {key: attrs[key] for key in attrs if not key.startswith('_')}
1298086
def to_dict(self):
        
        d = dict(individual_doses=self.individual_doses, responses=self.responses)
        d.update(self.kwargs)
        return d
289504
def public_attributes(instance)
      definitions.values.each_with_object({}) do |item, obj|
        key = item.target
        next unless instance.respond_to? key
        val = instance.send(key)
        obj[key] = val unless null == val
      end
    end
593988
def attributes(atts = {}, for_definition = false)
      wrapped_attributes atts, for_definition
      attributes_assignments atts, false, for_definition
      atts
    end
340728
def to_dict(cls, obj):
        '''
        '''
        return {
            k: getattr(obj, k)
            for k in dir(obj)
            if cls.serialisable(k, obj)
        }
205136
def format_attributes_json(self):
        """"""
        attributes_json = {}

        for key, value in self.attributes.items():
            key = utils.check_str_length(key)[0]
            value = _format_attribute_value(value)

            if value is not None:
                attributes_json[key] = value

        result = {
            'attributeMap': attributes_json
        }

        return result
1032609
def update_dict(obj, dict, attributes):
    
    for attribute in attributes:
        if hasattr(obj, attribute) and getattr(obj, attribute) is not None:
            dict[attribute] = getattr(obj, attribute)
285735
def _repack_pkgs(pkgs, normalize=True):
    '''
    
    '''
    if normalize and 'pkg.normalize_name' in __salt__:
        _normalize_name = __salt__['pkg.normalize_name']
    else:
        _normalize_name = lambda pkgname: pkgname
    return dict(
        [
            (_normalize_name(six.text_type(x)), six.text_type(y) if y is not None else y)
            for x, y in six.iteritems(salt.utils.data.repack_dictlist(pkgs))
        ]
    )
228121
def to_dict(self):
        """"""
        config = {}
        for attr in dir(self):
            if not attr.startswith('_'):
                value = getattr(self, attr)
                if not hasattr(value, '__call__'):
                    config[attr] = value
        return config
312791
def _include_public_methods(self, connection):
        
        for attr in dir(connection):
            value = getattr(connection, attr)
            if attr.startswith('_') or not callable(value):
                continue
            self.__dict__[attr] = self._wrap_public_method(attr)
997540
def populate_obj(obj, attrs):
    
    for k, v in attrs.iteritems():
        setattr(obj, k, v)
1126744
def as_dict(self, ordered=False):
        """"""
        items = zip(self.keys(), self.values())

        return OrderedDict(items) if ordered else dict(items)
1142719
def dict_from_object(obj: object):
    """"""

    # If object is a dict instance, no need to convert.
    return (obj if isinstance(obj, dict)
            else {attr: getattr(obj, attr)
                  for attr in dir(obj) if not attr.startswith('_')})
1043271
def dict_to_cognito(attributes, attr_map=None):
    
    if attr_map is None:
        attr_map = {}
    for k,v in attr_map.items():
        if v in attributes.keys():
            attributes[k] = attributes.pop(v)

    return [{'Name': key, 'Value': value} for key, value in attributes.items()]
913145
def as_dict(self):
        """"""

        d = {}
        for key, value in self:
            d.setdefault(key, []).append(value)
        return d
983977
def to_dict(self):
        """"""
        d = {}
        for k, v in self.__dict__["data"].iteritems():
            if isinstance(v, RecursiveAttribute):
                d[k] = v.to_dict()
            else:
                d[k] = v
        return d
293735
def as_dict(self):
        """"""
        d = {"comment": self.comment, "nkpoints": self.num_kpts,
             "generation_style": self.style.name, "kpoints": self.kpts,
             "usershift": self.kpts_shift,
             "kpts_weights": self.kpts_weights, "coord_type": self.coord_type,
             "labels": self.labels, "tet_number": self.tet_number,
             "tet_weight": self.tet_weight,
             "tet_connections": self.tet_connections}

        optional_paras = ["genvec1", "genvec2", "genvec3", "shift"]
        for para in optional_paras:
            if para in self.__dict__:
                d[para] = self.__dict__[para]
        d["@module"] = self.__class__.__module__
        d["@class"] = self.__class__.__name__
        return d