def _extract_allocations(body, schema):
 try:
  data = jsonutils.loads(body)
 except ValueError as exc:
  raise webob.exc.HTTPBadRequest((_('Malformed JSON: %(error)s') % {'error': exc}), json_formatter=util.json_error_formatter)
 try:
  jsonschema.validate(data, schema, format_checker=jsonschema.FormatChecker())
 except jsonschema.ValidationError as exc:
  raise webob.exc.HTTPBadRequest((_('JSON does not validate: %(error)s') % {'error': exc}), json_formatter=util.json_error_formatter)
 return data

def _extract_allocations ( body , schema ) : try : data = jsonutils . loads ( body ) except ValueError as exc : raise webob . exc . HTTPBadRequest ( ( _ ( 'Malformed JSON: %(error)s' ) % { 'error' : exc } ) , json_formatter = util . json_error_formatter ) try : jsonschema . validate ( data , schema , format_checker = jsonschema . FormatChecker ( ) ) except jsonschema . ValidationError as exc : raise webob . exc . HTTPBadRequest ( ( _ ( 'JSON does not validate: %(error)s' ) % { 'error' : exc } ) , json_formatter = util . json_error_formatter ) return data
extract allocation data from a json body .