def GetUserCode(self, callback):
    def _OnGetDeviceCode(response):
      response_dict = www_util.ParseJSONResponse(response)
      self._device_code = response_dict.get('device_code')
      callback(response_dict.get('user_code'), response_dict.get('verification_url'))

    # Get a device code from google's API
    request_args = {'client_id': secrets.GetSecret('google_client_mobile_id'),
                    'scope': _GOOGLE_OAUTH2_SCOPES}
    url = _GOOGLE_OAUTH2_DEVICECODE_URL
    http_client = httpclient.AsyncHTTPClient()
    http_client.fetch(url, method='POST',
                      body=urllib.urlencode(request_args), callback=_OnGetDeviceCode)
Retrieve a user code from google's device login API.  The given callback will
dataset/ETHPy150Open viewfinderco/viewfinder/backend/watchdog/scenario.py/ScenarioDevice.GetUserCode