def parse(self, value):
        """
        Convert a dictionary of raw values to a dictionary of processed values.
        """
        result = {}
        rest = {}
        for k, v in value.iteritems():
            if k in self.fields:
                if (isinstance(v, dict)
                        and not self.fields[k].supports_multiple):
                    if len(v) == 1:
                        # We support "foo.1" as "foo" as long as there is only
                        # one "foo.#" parameter provided.... -_-
                        v = v.values()[0]
                    else:
                        raise InvalidParameterCombinationError(k)
                result[k] = self.fields[k].coerce(v)
            else:
                rest[k] = v
        for k, v in self.fields.iteritems():
            if k not in result:
                result[k] = v.coerce(None)
        if rest:
            raise UnknownParametersError(result, rest)
        return result
def parse ( self , value ) : result = { } rest = { } for k , v in value . iteritems ( ) : if k in self . fields : if ( isinstance ( v , dict ) and not self . fields [ k ] . supports_multiple ) : if len ( v ) == 1 : v = v . values ( ) [ 0 ] else : raise InvalidParameterCombinationError ( k ) result [ k ] = self . fields [ k ] . coerce ( v ) else : rest [ k ] = v for k , v in self . fields . iteritems ( ) : if k not in result : result [ k ] = v . coerce ( None ) if rest : raise UnknownParametersError ( result , rest ) return result
Convert a dictionary of raw values to a dictionary of processed values.