code: def convert_layer(layer: dict):
      mapping = {
          "CONVOLUTIONAL": "convolutional",
          "MAX_POOLING": "max_pooling",
          "LSTM": "lstm",
          "TRANSPOSED_CONVOLUTIONAL": "transposed_conv",
          "DILATED_BLOCK": "dilated_block",
          "CONCAT": "concat",
      }
      return {
          "type": mapping[layer.get("type", "CONVOLUTIONAL")],
          "filters": layer.get("filters", 0),
          "kernel_size": layer.get("kernelSize", {"x": 0, "y": 0}),
          "stride": layer.get("stride", {"x": 0, "y": 0}),
          "dilated_depth": layer.get("dilatedDepth", 0),
          "concat_indices": layer.get("concatIndices", []),
          "hidden_nodes": layer.get("hiddenNodes", 0),
          "peepholes": layer.get("peepholes", False),
          "lstm_direction": "bidirectional",
      }
  
imports: import inspect
  import os
  from typing import Optional
  import logging
  import h5py
  from tensorflow import keras
  from tensorflow.python.keras.saving.hdf5_format import load_weights_from_hdf5_group
  from tfaip.util.tfaipargparse import post_init
  from calamari_ocr.ocr.savedmodel.migrations.version3_4to5 import migrate3to5
  from calamari_ocr.ocr.scenario import CalamariScenario
  from calamari_ocr.ocr.training.params import TrainerParams
label_desc: Use image node_id 7 for calling a global function with example usage: convert_layer(layer) and returns: dict