code: def from_input_dataset(
      data_pipelines: Iterator["DataPipeline"],
      codec_construction_params: CodecConstructionParams,
      progress_bar=False,
  ):
      chars = codec_construction_params.resolved_include_chars
  
      for pipeline in data_pipelines:
          pipeline = pipeline.to_mode(PipelineMode.TARGETS)
          pipeline = pipeline.as_preloaded(progress_bar=progress_bar)
          data_gen = pipeline.create_data_generator()
          for sample in tqdm_wrapper(
              data_gen.generate(),
              total=len(data_gen),
              desc="Computing codec",
              progress_bar=progress_bar,
          ):
              # assert(sample.inputs is None)  # Inputs shall not be generated here
              for c in sample.targets:
                  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 1 for calling the Codec obj's underlying member method code with example usage: obj.from_input_dataset(data_pipelines, codec_construction_params, progress_bar) and returns: Codec