code: def get_kernel_value(scalar, repeated, idx, default=None):
      if scalar:
          return scalar
      if repeated:
          if isinstance(repeated, numbers.Number):
              return repeated
          if len(repeated) == 1:
              # Same value applies to all spatial dimensions
              return int(repeated[0])
          assert idx < len(repeated)
          # Extract the value for the given spatial dimension
          return repeated[idx]
      if default is None:
          raise ValueError("Unable to determine kernel parameter!")
      return default
  
imports: from collections import namedtuple
  from functools import reduce
  from google.protobuf import text_format
  from copy import deepcopy
  import numbers
  import os
  import tempfile
  from mmdnn.conversion.caffe.mapper import get_handler_name
  from mmdnn.conversion.caffe.resolver import get_caffe_resolver, has_pycaffe
  from mmdnn.conversion.caffe.shape import *
  from mmdnn.conversion.caffe.errors import print_stderr, ConversionError
label_desc: Use image node_id 5 for calling the CaffeNode obj's underlying member method code with example usage: obj.get_kernel_value(scalar, repeated, idx, default) and returns: default, scalar, repeated, repeated, int