Returns a list of values from the child FlatterDict instance
        with string based integer keys.

        :param str pk: The parent key
        :param str ck: The child key
        :rtype: list
180156
def _child_as_list(self, pk, ck):
        
        return [self._values[pk][ck][k]
                for k in sorted(self._values[pk][ck].keys(),
                                key=lambda x: int(x))]
50378
def prt_keys(self, prt, pre):
        """"""
        prt.write('{PRE}Relationship to parent: {ABC}\n'.format(
            PRE=pre, ABC=''.join(self.rel2chr.values())))
        for rel, alias in self.rel2chr.items():
            prt.write('{PRE}    {A} {DESC}\n'.format(PRE=pre, A=alias, DESC=rel))
        prt.write('\n{PRE}Relationship to child: {ABC}\n'.format(
            PRE=pre, ABC=''.join(self.rev2chr.values())))
        for rel, alias in self.rev2chr.items():
            prt.write('{PRE}    {A} {DESC}\n'.format(PRE=pre, A=alias, DESC=rel))
892990
def get_keys(self, models, key=None):
        
        return list(set(map(lambda value: value.get_attribute(key) if key else value.get_key(), models)))
22868
def field_pk_from_json(self, data):
        """"""
        model = get_model(data['app'], data['model'])
        return PkOnlyModel(self, model, data['pk'])
1190186
def as_dict(self):
        
        out = dict({})
        for key in self.keys():
            if self._has_delimiter(key):
                pk, ck = key.split(self._delimiter, 1)
                if self._has_delimiter(ck):
                    ck = ck.split(self._delimiter, 1)[0]
                if isinstance(self._values[pk], FlatterDict) and pk not in out:
                    out[pk] = dict()
                if isinstance(self._values[pk][ck], FlatterDict):
                    if self._values[pk][ck].original_type == tuple:
                        out[pk][ck] = tuple(self._child_as_list(pk, ck))
                    elif self._values[pk][ck].original_type == list:
                        out[pk][ck] = self._child_as_list(pk, ck)
                    elif self._values[pk][ck].original_type == set:
                        out[pk][ck] = set(self._child_as_list(pk, ck))
                    elif self._values[pk][ck].original_type == dict:
                        out[pk][ck] = self._values[pk][ck].as_dict()
                else:
                    out[pk][ck] = self._values[pk][ck]
            else:
                out[key] = self._values[key]
        return out
1054096
def get_id_constraints(pkname, pkey):
  
  if isinstance(pkname, str):
    return {pkname: pkey}
  else:
    return dict(zip(pkname, pkey))
356089
def get_flattened_bsp_keys_from_schema(schema):
    
    keys = []

    for key in schema.declared_fields.keys():
        field = schema.declared_fields[key]

        if isinstance(field, mm.fields.Nested) and \
                isinstance(field.schema, BoundSpatialPoint):
            keys.append("{}.{}".format(key, "position"))

    return keys
462718
def keys_in_dict(d, parent_key, keys):
    
    for key, value in d.iteritems():
        if isinstance(value, dict):
            keys_in_dict(value, key, keys)
        else:
            if parent_key:
                prefix = parent_key + "."
            else:
                prefix = ""

            keys.append(prefix + key)

    return keys
52932
def _get_parameter_dictionary(self, base_name, dictionary, sorted_keys, parameter):
        

        # assemble the key for this parameter
        k = base_name + "/" + parameter.name()

        # first add this parameter (if it has a value)
        if not parameter.value()==None:
            sorted_keys.append(k[1:])
            dictionary[sorted_keys[-1]] = parameter.value()

        # now loop over the children
        for p in parameter.children():
            self._get_parameter_dictionary(k, dictionary, sorted_keys, p)
174015
def _get_pk_value(self, instance):
        
        pk_field = instance._meta.pk.name
        pk = getattr(instance, pk_field, None)

        # Check to make sure that we got an pk not a model object.
        if isinstance(pk, models.Model):
            pk = self._get_pk_value(pk)
        return pk
92211
def get_alldictkeys(ddict, parent=None):
    
    parent = [] if parent is None else parent

    if not isinstance(ddict, dict):
        return [tuple(parent)]
    return reduce(
        list.__add__,
        [get_alldictkeys(v, parent + [k]) for k, v in ddict.items()],
        [])
605625
def mk_kwargs(cls, kwargs):
        
        ret = {}
        kws = ['row_factory', 'body', 'parent']
        for k in kws:
            if k in kwargs:
                ret[k] = kwargs.pop(k)

        return ret
222761
def get_pks(self, field_vals):
        """"""
        field_name = self.schema.pk.name
        return self.in_field(field_name, field_vals).get()
1209209
def getparent(d, pth):
        

        c = d
        for key in pth[:-1]:
            if not isinstance(c, dict):
                raise InvalidValueError(c)
            elif key not in c:
                raise UnknownKeyError(pth)
            else:
                c = c.__getitem__(key)
        return c
410469
def flatten_dict(dic, parent_key='', sep='.'):
    
    items = []
    for key, value in dic.items():
        new_key = parent_key + sep + key if parent_key else key
        if isinstance(value, collections.MutableMapping):
            items.extend(flatten_dict(value, new_key, sep=sep).items())
        elif isinstance(value, list):
            for idx, elt in enumerate(value):
                items.extend(
                    flatten_dict(elt, new_key + sep + str(idx), sep=sep).items()
                )
        else:
            items.append((new_key, value))
    return dict(items)
910704
def values_list(self, *fields, **kwargs):
        
        flat = kwargs.pop('flat', False)
        if kwargs:
            raise TypeError('Unexpected keyword arguments to values_list: %s'
                            % (kwargs.keys(),))
        if flat and len(fields) > 1:
            raise TypeError("'flat' is not valid when values_list is called with more than one field.")
        clone = self.only(fields)
        clone._values_list = True
        clone._flat_values_list = flat
        return clone
1007567
def kwargs(self):
    
    return {k: v for k, v in self._kwargs.items() if k not in self._INTERNAL_FIELDS}