Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def validation_boolean(schema, *records):
return validate_many(records, schema, raise_errors=False)
def validation_raise(schema, *records):
return validate_many(records, schema, raise_errors=True)
def validater(schema, records, runs=1):
times = []
valid = []
schema = parse_schema(schema)
for _ in range(runs):
start = time.time()
valid = validate_many(records, schema)
end = time.time()
times.append(end - start)
print('... {0} runs averaged {1} seconds'.format(runs, (sum(times) / runs)))
return valid