class_docstr: A language translator and detector.
  
  Usage:
  ::
      >>> from textblob.translate import Translator
      >>> t = Translator()
      >>> t.translate('hello', from_lang='en', to_lang='fr')
      u'bonjour'
      >>> t.detect("hola")
      u'es'
class_docstr_tok: ["A","language","translator","and","detector",".","Usage",":",":",":",">",">",">","from","textblob.translate","import","Translator",">",">",">","t","=","Translator","(",")",">",">",">","t.translate","(","'hello","'",",","from_lang='en","'",",","to_lang='fr","'",")","u'bonjour'",">",">",">","t.detect","(","``","hola","''",")","u'es","'"]
docstr: Detect the source text's language.
docstr_tok: ["Detect","the","source","text","'s","language","."]
code: def detect(self, source, host=None, type_=None):
      """Detect the source text's language."""
      if PY2:
          source = source.encode("utf-8")
      if len(source) < 3:
          raise TranslatorError(
              "Must provide a string with at least 3 characters."
          )
      data = {"q": source}
      url = "{url}&sl=auto&tk={tk}&client={client}".format(
          url=self.url,
          tk=_calculate_tk(source),
          client="te",
      )
      response = self._request(url, host=host, type_=type_, data=data)
      result, language = json.loads(response)
      return language
  
file_path: TextBlob/textblob/translate.py
imports: from __future__ import absolute_import
  import codecs
  import json
  import re
  from textblob.compat import PY2, request, urlencode
  from textblob.exceptions import TranslatorError, NotTranslated
label_desc: Use image node_id 2 for calling the Translator obj's underlying member method code with example usage: obj.detect(source, host, type_) and returns: language