code: def _check_out_channels(config: dict, layer_name: str) -> int:
      enc_ch_l: dict = config.get(layer_name, None)
      if enc_ch_l is None or not enc_ch_l:
          logger.error(
              "Encoder does not define input-output mapping for {}: Got: {}".format(
                  layer_name, config
              )
          )
  
      enc_ch_l_out = enc_ch_l.get("out", None)
      if enc_ch_l_out is None or not enc_ch_l_out:
          logger.error(
              "Output channels are not defined in {} of the encoder. Got: {}".format(
                  layer_name, enc_ch_l
              )
          )
  
      return enc_ch_l_out
  
file_path: ml-cvnets/cvnets/models/segmentation/heads/base_seg_head.py
imports: import argparse
  from typing import Dict, Optional, Tuple
  from torch import Tensor, nn
  from cvnets.layers import ConvLayer2d, Dropout2d, UpSample
  from cvnets.misc.common import parameter_list
  from cvnets.misc.init_utils import initialize_weights
  from cvnets.models import MODEL_REGISTRY, BaseAnyNNModel
  from utils import logger
label_desc: Use image node_id 1 for calling a global function with example usage: _check_out_channels(config, layer_name) and returns: enc_ch_l_out