code: def detect(self, text, proxies=None, format="plain"):
      
      data = {
        "text": text,
        "format": format,
        "key": self.api_key,
      }
      try:
        response = requests.post(self.url("detect"), data=data, proxies=proxies)
      except ConnectionError:
        raise YandexTranslateException(self.error_codes[503])
      except ValueError:
        raise YandexTranslateException(response)
      else:
        response = response.json()
      language = response.get("lang", None)
      status_code = response.get("code", 200)
      if status_code != 200:
        raise YandexTranslateException(status_code)
      elif not language:
        raise YandexTranslateException(501)
      return language
docs: Specifies language of text
      >>> translate = YandexTranslate("trnsl.1.1.20130421T140201Z.323e508a33e9d84b.f1e0d9ca9bcd0a00b0ef71d82e6cf4158183d09e")
      >>> result = translate.detect(text="Hello world!")
      >>> result == "en"
      True