code: def jsonify_assert(asserted, message, status_code=400):
      
      if asserted:
          return
      try:
          raise AssertionError(message)
      except AssertionError, e:
          stack = traceback.extract_stack()
          stack.pop()
          logging.error('Assertion failed: %s\n%s',
                        str(e), ''.join(traceback.format_list(stack)))
          abort(jsonify_error(e, status_code=status_code))
docs: Asserts something is true, aborts the request if not.