code: def test_devanagari_script():
      """
      Attempt to test the measurement width of Devanagari script.
  
      I believe this 'phrase' should be length 3.
  
      This is a difficult problem, and this library does not yet get it right,
      because we interpret the unicode data files programmatically, but they do
      not correctly describe how their terminal width is measured.
  
      There are very few Terminals that do!
  
      As of 2023,
  
      - iTerm2: correct length but individual characters are out of order and
                horizaontally misplaced as to be unreadable in its language when
                using 'Noto Sans' font.
      - mlterm: mixed results, it offers several options in the configuration
                dialog, "Xft", "Cario", and "Variable Column Width" have some
                effect, but with neither 'Noto Sans' or 'unifont', it is not
                recognizable as the Devanagari script it is meant to display.
  
      Previous testing with Devanagari documented at address https://benizi.com/vim/devanagari/
  
      See also, https://askubuntu.com/questions/8437/is-there-a-good-mono-spaced-font-for-devanagari-script-in-the-terminal
      """
      # This test adapted from https://www.unicode.org/L2/L2023/23107-terminal-suppt.pdf
      # please note that document correctly points out that the final width cannot be determined
      # as a sum of each individual width, as this library currently performs with exception of
      # ZWJ, but I think it incorrectly gestures what a stateless call to wcwidth.wcwidth of
      # each codepoint *should* return.
      phrase = (
          "\u0915"  # Akhand, Category 'Lo', East Asian Width property 'N' -- DEVANAGARI LETTER KA
          "\u094D"  # Joiner, Category 'Mn', East Asian Width property 'N' -- DEVANAGARI SIGN VIRAMA
          "\u0937"  # Fused, Category 'Lo', East Asian Width property 'N' -- DEVANAGARI LETTER SSA
          "\u093F"
      )  # MatraL, Category 'Mc', East Asian Width property 'N' -- DEVANAGARI VOWEL SIGN I
      # 23107-terminal-suppt.pdf suggests wcwidth.wcwidth should return (2, 0, 0, 1)
      expect_length_each = (1, 0, 1, 0)
      # I believe the final width *should* be 3.
      expect_length_phrase = 2
  
      # exercise,
      length_each = tuple(map(wcwidth.wcwidth, phrase))
      length_phrase = wcwidth.wcswidth(phrase)
  
      # verify.
      assert length_each == expect_length_each
      assert length_phrase == expect_length_phrase
  
file_path: catboost/contrib/python/wcwidth/py2/tests/test_core.py
imports: import wcwidth
label_desc: Use image node_id 13 for calling a global function with example usage: test_devanagari_script() without return types