class_docstr: CLTK's wrapper for the Stanza project.
class_docstr_tok: ["CLTK","'s","wrapper","for","the","Stanza","project","."]
docstr: Using known-supported language, use the CLTK's
  internal code to look up the code used by Stanza.
  
  >>> stanza_wrapper = StanzaWrapper(language='grc', stanza_debug_level="INFO", interactive=False, silent=True)
  >>> stanza_wrapper._get_stanza_code()
  'grc'
  >>> stanza_wrapper.language = "xxx"
  >>> stanza_wrapper._get_stanza_code()
  Traceback (most recent call last):
    ...
  KeyError: 'Somehow ``StanzaWrapper.language`` got renamed to something invalid. This should never happen.'
docstr_tok: ["Using","known-supported","language",",","use","the","CLTK's","internal","code","to","look","up","the","code","used","by","Stanza",".",">",">",">","stanza_wrapper","=","StanzaWrapper","(","language='grc","'",",","stanza_debug_level=","''","INFO","''",",","interactive=False",",","silent=True",")",">",">",">","stanza_wrapper._get_stanza_code","(",")","'grc'",">",">",">","stanza_wrapper.language","=","``","xxx","''",">",">",">","stanza_wrapper._get_stanza_code","(",")","Traceback","(","most","recent","call","last",")",":","...","KeyError",":","'Somehow","``","StanzaWrapper.language","``","got","renamed","to","something","invalid",".","This","should","never","happen",".","'"]
code: def _get_stanza_code(self) -> str:
      """Using known-supported language, use the CLTK's
      internal code to look up the code used by Stanza.
  
      >>> stanza_wrapper = StanzaWrapper(language='grc', stanza_debug_level="INFO", interactive=False, silent=True)
      >>> stanza_wrapper._get_stanza_code()
      'grc'
      >>> stanza_wrapper.language = "xxx"
      >>> stanza_wrapper._get_stanza_code()
      Traceback (most recent call last):
        ...
      KeyError: 'Somehow ``StanzaWrapper.language`` got renamed to something invalid. This should never happen.'
      """
      try:
          stanza_lang_name = MAP_LANGS_CLTK_STANZA[self.language]
      except KeyError:
          raise KeyError(
              "Somehow ``StanzaWrapper.language`` got renamed to something invalid. This should never happen."
          )
      # {'Afrikaans': 'af', 'Ancient_Greek': 'grc', ...}
      stanza_lang_code: Dict[str, str] = lang2lcode
      try:
          return stanza_lang_code[stanza_lang_name]
      except KeyError:
          raise KeyError(
              "The CLTK's map of ISO-to-Stanza is out of sync."
          )
  
file_path: cltk/src/cltk/dependency/stanza_wrapper.py
imports: import logging
  import os
  from typing import Dict, Optional
  import stanza
  from stanza.models.common.constant import lang2lcode
  from stanza.resources.prepare_resources import default_treebanks
  from cltk.core.exceptions import CLTKException, UnimplementedAlgorithmError, UnknownLanguageError
  from cltk.utils import file_exists, query_yes_no, suppress_stdout
label_desc: Use image node_id 9 for calling the StanzaWrapper obj's underlying member method code with example usage: obj._get_stanza_code() and returns: stanza_lang_code