def assert_clean(data):
 def _ensure_clean(value):
  if (value != bleach.clean(value)):
   raise ValueError
 return escape_html(data)

def assert_clean ( data ) : def _ensure_clean ( value ) : if ( value != bleach . clean ( value ) ) : raise ValueError return escape_html ( data )
ensure that data is cleaned :raise: assertionerror .