code: def get_char_weights(lang: str) -> list[tuple[str, int]]:
      """
      Get lang-specific character weights for use in certain data augmentation transforms,
      based on texts in :class:`textacy.datasets.UDHR`.
  
      Args:
          lang: Standard two-letter language code.
  
      Returns:
          Collection of (character, weight) pairs, based on the distribution of characters
          found in the source text.
      """
      try:
          char_weights = list(
              collections.Counter(
                  char
                  for text in udhr.texts(lang=lang)
                  for char in text
                  if char.isalnum()
              ).items()
          )
      except ValueError:
          char_weights = list(
              zip(
                  string.ascii_lowercase + string.digits,
                  itertools.repeat(1),
              )
          )
      return char_weights
  
file_path: textacy/src/textacy/augmentation/utils.py
imports: from __future__ import annotations
  import collections
  import functools
  import itertools
  import string
  from typing import Iterable
  from cachetools import cached
  from cachetools.keys import hashkey
  from spacy.tokens import Doc, Span
  from ..None import cache, datasets, errors, resources, types
label_desc: Use image node_id 2 for calling a global function with example usage: get_char_weights(lang) and returns: char_weights