def _validate(data, schema, context):
 converted_data = augment_data(data, schema)
 full_schema = make_full_schema(data, schema)
 errors = dict(((key, []) for key in full_schema))
 for key in sorted(full_schema, key=flattened_order_key):
  if (key[(-1)] == '__before'):
   for converter in full_schema[key]:
    try:
     convert(converter, key, converted_data, errors, context)
    except StopOnError:
     break
 for key in sorted(full_schema, key=flattened_order_key):
  if (not key[(-1)].startswith('__')):
   for converter in full_schema[key]:
    try:
     convert(converter, key, converted_data, errors, context)
    except StopOnError:
     break
 for key in sorted(full_schema, key=flattened_order_key):
  if (key[(-1)] == '__extras'):
   for converter in full_schema[key]:
    try:
     convert(converter, key, converted_data, errors, context)
    except StopOnError:
     break
 for key in reversed(sorted(full_schema, key=flattened_order_key)):
  if (key[(-1)] == '__after'):
   for converter in full_schema[key]:
    try:
     convert(converter, key, converted_data, errors, context)
    except StopOnError:
     break
 if (('__junk',) in full_schema):
  for converter in full_schema[('__junk',)]:
   try:
    convert(converter, ('__junk',), converted_data, errors, context)
   except StopOnError:
    break
 return (converted_data, errors)

def _validate ( data , schema , context ) : converted_data = augment_data ( data , schema ) full_schema = make_full_schema ( data , schema ) errors = dict ( ( ( key , [ ] ) for key in full_schema ) ) for key in sorted ( full_schema , key = flattened_order_key ) : if ( key [ ( - 1 ) ] == '__before' ) : for converter in full_schema [ key ] : try : convert ( converter , key , converted_data , errors , context ) except StopOnError : break for key in sorted ( full_schema , key = flattened_order_key ) : if ( not key [ ( - 1 ) ] . startswith ( '__' ) ) : for converter in full_schema [ key ] : try : convert ( converter , key , converted_data , errors , context ) except StopOnError : break for key in sorted ( full_schema , key = flattened_order_key ) : if ( key [ ( - 1 ) ] == '__extras' ) : for converter in full_schema [ key ] : try : convert ( converter , key , converted_data , errors , context ) except StopOnError : break for key in reversed ( sorted ( full_schema , key = flattened_order_key ) ) : if ( key [ ( - 1 ) ] == '__after' ) : for converter in full_schema [ key ] : try : convert ( converter , key , converted_data , errors , context ) except StopOnError : break if ( ( '__junk' , ) in full_schema ) : for converter in full_schema [ ( '__junk' , ) ] : try : convert ( converter , ( '__junk' , ) , converted_data , errors , context ) except StopOnError : break return ( converted_data , errors )
decorator for common function argument validation .