def _finish(status_int, response_data=None, content_type=u'text', headers=None):
 assert isinstance(status_int, int)
 response_msg = u''
 if (headers is None):
  headers = {}
 if (response_data is not None):
  headers[u'Content-Type'] = CONTENT_TYPES[content_type]
  if (content_type == u'json'):
   response_msg = json.dumps(response_data, for_json=True)
  else:
   response_msg = response_data
  if ((status_int == 200) and (u'callback' in request.args) and (request.method == u'GET')):
   callback = cgi.escape(request.args[u'callback'])
   response_msg = _wrap_jsonp(callback, response_msg)
 return make_response((response_msg, status_int, headers))

def _finish ( status_int , response_data = None , content_type = u'text' , headers = None ) : assert isinstance ( status_int , int ) response_msg = u'' if ( headers is None ) : headers = { } if ( response_data is not None ) : headers [ u'Content-Type' ] = CONTENT_TYPES [ content_type ] if ( content_type == u'json' ) : response_msg = json . dumps ( response_data , for_json = True ) else : response_msg = response_data if ( ( status_int == 200 ) and ( u'callback' in request . args ) and ( request . method == u'GET' ) ) : callback = cgi . escape ( request . args [ u'callback' ] ) response_msg = _wrap_jsonp ( callback , response_msg ) return make_response ( ( response_msg , status_int , headers ) )
when a controller method has completed .