'Returns a user code and the verification URL where to enter it
Returns:
A user code as a string for the user to authorize the application
An URL as a string where the user has to enter the code'

@util.positional(1)
def step1_get_device_and_user_codes(self, http=None):

    if (self.device_uri is None):
        raise ValueError('The    value    of    device_uri    must    not    be    None.')
    body = urllib.parse.urlencode({'client_id': self.client_id, 'scope': self.scope})
    headers = {'content-type': 'application/x-www-form-urlencoded'}
    if (self.user_agent is not None):
        headers['user-agent'] = self.user_agent
    if (http is None):
        http = httplib2.Http()
    (resp, content) = http.request(self.device_uri, method='POST', body=body, headers=headers)
    if (resp.status == 200):
        try:
            flow_info = json.loads(content)
        except ValueError as e:
            raise OAuth2DeviceCodeError(('Could    not    parse    server    response    as    JSON:    "%s",    error:    "%s"' % (content, e)))
        return DeviceFlowInfo.FromResponse(flow_info)
    else:
        error_msg = ('Invalid    response    %s.' % resp.status)
        try:
            d = json.loads(content)
            if ('error' in d):
                error_msg += ('    Error:    %s' % d['error'])
        except ValueError:
            pass
        raise OAuth2DeviceCodeError(error_msg)
