docstr: extend the codec by the given characters
  
  If a character is already present it will be skipped.
  The new characters will be added at the end of the codec (highest label numbers)
  
  Parameters
  ----------
  codec : list of str
      the characters to add
  Returns
  -------
  list of int
      the positions/labels of added characters
  See Also
  --------
      shrink
docstr_tok: ["extend","the","codec","by","the","given","characters","If","a","character","is","already","present","it","will","be","skipped",".","The","new","characters","will","be","added","at","the","end","of","the","codec","(","highest","label","numbers",")","Parameters","--","--","--","--","--","codec",":","list","of","str","the","characters","to","add","Returns","--","--","--","-","list","of","int","the","positions\/labels","of","added","characters","See","Also","--","--","--","--","shrink"]
code: def extend(self, codec):
      """extend the codec by the given characters
  
      If a character is already present it will be skipped.
      The new characters will be added at the end of the codec (highest label numbers)
  
      Parameters
      ----------
      codec : list of str
          the characters to add
      Returns
      -------
      list of int
          the positions/labels of added characters
      See Also
      --------
          shrink
      """
      size = self.size()
      added = []
      for c in codec.code2char.values():
          if (
              c not in self.charset
          ):  # append chars that don't appear in the codec
              self.code2char[size] = c
              self.char2code[c] = size
              self.charset.append(c)
              added.append(size)
              size += 1
  
      return added
  
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 8 for calling the Codec obj's underlying member method code with example usage: obj.extend(codec) and returns: added