def validate(policy):
for param, value in policy.items():<EOL><INDENT>if param not in ACCEPTED_SECURITY_TYPES.keys():<EOL><INDENT>raise SecurityError('<STR_LIT>'.format(param))<EOL><DEDENT>if type(value) != ACCEPTED_SECURITY_TYPES[param]:<EOL><INDENT>raise SecurityError('<STR_LIT>'<EOL>'<STR_LIT>'.format(<EOL>param, ACCEPTED_SECURITY_TYPES[param],<EOL>type(value)))<EOL><DEDENT><DEDENT>
Validates a policy and its parameters and raises an error if invalid