docstr: Compute a codec from given text
  
  First computes a set of all available characters.
  Then, a Codec is created
  
  Parameters
  ----------
  texts : obj:`list` of :obj:`str`
      a list of strings
  whitelist
      a list of characters that are forced to be in the codec
  Returns
  -------
      Codec based on the set of characters + whitelist
docstr_tok: ["Compute","a","codec","from","given","text","First","computes","a","set","of","all","available","characters",".","Then",",","a","Codec","is","created","Parameters","--","--","--","--","--","texts",":","obj",":","`","list","`","of",":","obj",":","`","str","`","a","list","of","strings","whitelist","a","list","of","characters","that","are","forced","to","be","in","the","codec","Returns","--","--","--","-","Codec","based","on","the","set","of","characters","+","whitelist"]
code: def from_texts(
      texts: List[str],
      codec_construction_params: CodecConstructionParams,
  ):
      """Compute a codec from given text
  
      First computes a set of all available characters.
      Then, a Codec is created
  
      Parameters
      ----------
      texts : obj:`list` of :obj:`str`
          a list of strings
      whitelist
          a list of characters that are forced to be in the codec
      Returns
      -------
          Codec based on the set of characters + whitelist
      """
      chars = (
          set()
          if codec_construction_params.include is None
          else set(codec_construction_params.include)
      )
  
      for text in texts:
          for c in text:
              chars.add(c)
  
      return Codec(sorted(list(chars)))
  
file_path: calamari/calamari_ocr/ocr/dataset/codec.py
imports: from dataclasses import dataclass, field
  from typing import List, TYPE_CHECKING, Iterator, Set
  from paiargparse import pai_dataclass, pai_meta
  from tfaip.util.multiprocessing.parallelmap import tqdm_wrapper
  from tfaip.data.pipeline.definitions import PipelineMode
  from calamari_ocr.utils import glob_all
label_desc: Use image node_id 2 for calling the Codec obj's underlying member method code with example usage: obj.from_texts(texts, codec_construction_params) and returns: Codec