Dicts of native values <- Dicts of primitive datatypes.
176251
def to_internal_value(self, data):
        

        if html.is_html_input(data):
            data = html.parse_html_dict(data)
        if not isinstance(data, dict):
            self.fail('not_a_dict', input_type=type(data).__name__)
        if not self.allow_empty and len(data.keys()) == 0:
            message = self.error_messages['empty']
            raise ValidationError({
                api_settings.NON_FIELD_ERRORS_KEY: [message]
            })
        return {
            six.text_type(key): self.child.run_validation(value)
            for key, value in data.items()
        }
1248373
def _dict_native_ok(d):
    
    if len(d) >= 256:
        return False

    # All keys must be strings
    for k in d:
        if not isinstance(k, six.string_types):
            return False

    return True
1183481
def iflatten_dict_values(node, depth=0):
    
    if isinstance(node, dict):
        _iter = (iflatten_dict_values(value) for value in six.itervalues(node))
        return util_iter.iflatten(_iter)
    else:
        return node
572265
def valuesToDict(key):
    """"""
    d = {}
    size = _winreg.QueryInfoKey(key)[1]
    for i in xrange(size):
        d[_winreg.EnumValue(key, i)[0]] = _winreg.EnumValue(key, i)[1]
    return d
750757
def build_native_type_dictionary(fields, respect_required=False, wrap_field=True, name=''):
    
    # a place to start when building the input field attributes
    input_fields = {}
    # go over every input in the summary
    for field in fields:
        field_name = name + field['name']
        field_type = field['type']

        # if the type field is a string
        if isinstance(field_type, str):
            # compute the native api type for the field
            field_type = convert_typestring_to_api_native(field_type)(
                # required=respect_required and field['required']
            )
            # add an entry in the attributes
            input_fields[field['name']] = field_type

        # we could also be looking at a dictionary
        elif isinstance(field_type, dict):

            object_fields = field_type['fields']

            # add the dictionary to the parent as a graphql object type
            input_fields[field['name']] = graphql_type_from_summary(
                summary={
                    'name': field_name+"ArgType",
                    'fields': object_fields
                }
            )

            # if we are supposed to wrap the object in a field
            if wrap_field:
                # then wrap the value we just added
                input_fields[field['name']] = graphene.Field(input_fields[field['name']])


    # we're done
    return input_fields
835468
def _resolve_dtype(data_type):
    """"""
    if isinstance(data_type, _FIXED_ATOMIC):
        out = _get_atomic_dtype(data_type)
    elif isinstance(data_type, _FLEXIBLE_ATOMIC):
        out = (_get_atomic_dtype(data_type), data_type.length)
    elif isinstance(data_type, Array):
        shape = data_type.shape
        if isinstance(shape, _SEQUENCE_TYPES) and len(shape) == 1:
            # Workaround the exception `ValueError: invalid itemsize in
            # generic type tuple` when an `Array` of shape 0 or (0,) is nested
            # within another `Array`.
            shape = shape[0]

        out = (_resolve_dtype(data_type.element_type), shape)
    elif isinstance(data_type, Structure):
        out = [(field.name, _resolve_dtype(field.type))
               for field in data_type.fields]

    return out
1055320
def asDict(self, returnIntegers=True):
        
        d = {}
        for k, v in self.items():
            d[k] = v if not returnIntegers else normalizers.normalizeRounding(v)
        return d
385046
def _keys_via_value_nonrecur(d,v):
    '''
        
    '''
    rslt = []
    for key in d:
        if(d[key] == v):
            rslt.append(key)
    return(rslt)
776625
def dict_map(f, primitive, dic):
    """"""

    if primitive(dic):
        return f(dic)
    if isinstance(dic, Mapping):
        return {dict_map(f, primitive, key): dict_map(f, primitive, value)
                for key, value in dic.items()}
    if isinstance(dic, str):
        return dic
    if isinstance(dic, Sequence):
        return [dict_map(f, primitive, value) for value in dic]
    return dic
1358292
def flag_values_dict(self):
    """"""
    return {name: flag.value for name, flag in six.iteritems(self._flags())}
532673
def native(self, value, context=None):
		""""""
		
		value = super().native(value, context)
		
		if self.none and (value is None):
			return None
		
		try:
			value = value.lower()
		except AttributeError:
			return bool(value)
		
		if value in self.truthy:
			return True
		
		if value in self.falsy:
			return False
		
		raise Concern("Unable to convert {0!r} to a boolean value.", value)
1010314
def _determine_keys(dictionary):
    """"""
    optional = {}
    defaults = {}
    mandatory = {}
    types = {}
    for key, value in dictionary.items():
        if isinstance(key, Optional):
            optional[key.value] = parse_schema(value)
            if isinstance(value, BaseSchema) and\
                    value.default is not UNSPECIFIED:
                defaults[key.value] = (value.default, value.null_values)
            continue  # pragma: nocover

        if type(key) is type:
            types[key] = parse_schema(value)
            continue

        mandatory[key] = parse_schema(value)
    return mandatory, optional, types, defaults
1242968
def values(self):
        ""
        return (list(self._pb.IntMap.values()) + list(self._pb.StringMap.values()) +
                list(self._pb.FloatMap.values()) + list(self._pb.BoolMap.values()))
1285954
def cast_dicts(self, to=DEFAULT, d=DEFAULT):
        """"""
        if to is DEFAULT:
            to = type(self)
        if d is DEFAULT:
            d = self
        if isinstance(d, list):
            return [v for v in (self.cast_dicts(to, v) for v in d)]
        elif isinstance(d, dict):
            return to({k: v for k, v in ((k, self.cast_dicts(to, v)) for k, v in d.items())})
        return d
883336
def to_native_types(self, slicer=None, na_rep='', float_format=None,
                        decimal='.', quoting=None, **kwargs):
        

        values = self.values
        if slicer is not None:
            values = values[:, slicer]

        # see gh-13418: no special formatting is desired at the
        # output (important for appropriate 'quoting' behaviour),
        # so do not pass it through the FloatArrayFormatter
        if float_format is None and decimal == '.':
            mask = isna(values)

            if not quoting:
                values = values.astype(str)
            else:
                values = np.array(values, dtype='object')

            values[mask] = na_rep
            return values

        from pandas.io.formats.format import FloatArrayFormatter
        formatter = FloatArrayFormatter(values, na_rep=na_rep,
                                        float_format=float_format,
                                        decimal=decimal, quoting=quoting,
                                        fixed_width=False)
        return formatter.get_result_as_array()
195800
def to_native(self, obj, name, value):
		""""""
		
		if isinstance(value, self.List):
			return value
		
		result = self.List(super(Array, self).to_native(obj, name, i) for i in value)
		obj.__data__[self.__name__] = result
		
		return result
262107
def _GetNestedDict(self, value):
    """"""
    row = {}
    for type_info in value.__class__.type_infos:
      # We only expect the metadata proto to be included as ProtoEmbedded.
      if type_info.__class__.__name__ == "ProtoEmbedded":
        row[type_info.name] = self._GetNestedDict(value.Get(type_info.name))
      else:
        row[type_info.name] = utils.SmartStr(value.Get(type_info.name))

    return row