def main(callback_inter=None, callback_final=None):
    if (callback_inter and callback_final):        
        request_token, request_token_secret = json.loads(callback_inter)
        verifier = urlparse.parse_qs(callback_final)['oauth_verifier']
        print(json.dumps(access(request_token, request_token_secret, verifier)), end='')
    else:
        print(json.dumps(authorize()), end='')
        exit(4) # indicates to PopClip that a callback will follow
this is called once (with no params) when the user clicks 'log in',
dataset/ETHPy150Open pilotmoon/PopClip-Extensions/source/Trello/auth.py/main