def make_dictValidator(keyvalidator, valuevalidator):
 def v(d):
  newd = util.OrderedDict()
  for (key, value) in d.iteritems():
   newd[keyvalidator(key)] = valuevalidator(value)
  return newd
 v.keyvalidator = keyvalidator
 v.valuevalidator = valuevalidator
 return v

def make_dictValidator ( keyvalidator , valuevalidator ) : def v ( d ) : newd = util . OrderedDict ( ) for ( key , value ) in d . iteritems ( ) : newd [ keyvalidator ( key ) ] = valuevalidator ( value ) return newd v . keyvalidator = keyvalidator v . valuevalidator = valuevalidator return v
compose and return a dict validator -- a validator that validates each key and value in a dictionary .