def rst_invalid(text):
 invalid_rst = False
 try:
  rst_to_html(text)
 except Exception as e:
  invalid_rst = str(e)
 return invalid_rst

def rst_invalid ( text ) : invalid_rst = False try : rst_to_html ( text ) except Exception as e : invalid_rst = str ( e ) return invalid_rst
predicate to determine if text is invalid restructuredtext .