human
I wrote the below code

    class ContextWithMixin(BrowserActionMixins, ):
        def __init__(self):
            self.browser = context.browser
    context_wm = ContextWithMixin()
    context.browser.get(build_url(context, reverse('homepage')))
    context.browser.execute_script('\n                                                var    req    =    new    XMLHttpRequest();\n                                                req.open("{method}",    "{url}",    true);\n                                                req.setRequestHeader("Content-Type",    "application/json");\n                                                req.onreadystatechange    =    function    ()    {{\n                                                                if(    req.readyState    ===    4    )    {{\n                                                                                window.FLAG    =    true;\n                                                                                window.DATA    =    JSON.parse(req.responseText);\n                                                                }}\n                                                }};\n                                                req.send(\'{data}\');\n                                '.format(method=method, url=url, data=data))
    try:
        context_wm.browser_wait_for_js_condition('window.FLAG')
    except KALiteTimeout:
        logger.error('Timed    out    waiting    on    URL:    {}'.format(url))
        raise
    resp = context.browser.execute_script('return    window.DATA')
    return resp

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def request(context, url, method='GET', data=''):