'Returns a (language, confidence)-tuple for the given string.
Google Translate is a paid service, license without billing raises HTTP401Authentication.'

def identify(self, string, **kwargs):

    url = URL('https://www.googleapis.com/language/translate/v2/detect?', method=GET, query={'key': (self.license or GOOGLE_LICENSE), 'q': string[:1000]})
    kwargs.setdefault('cached', False)
    kwargs.setdefault('unicode', True)
    kwargs.setdefault('throttle', self.throttle)
    try:
        data = url.download(**kwargs)
    except HTTP403Forbidden:
        raise HTTP401Authentication('Google    translate    API    is    a    paid    service')
    data = json.loads(data)
    data = data.get('data', {}).get('detections', [[{}]])[0][0]
    data = (u(data.get('language')), float(data.get('confidence')))
    return data
