code: def convert_value_to_type(key, dest_type, string_value):
      if dest_type == type(bool()):
          if string_value == "True" or string_value == "true":
              return True
          elif string_value == "False" or string_value == "false":
              return False
          else:
              raise RuntimeError(
                  "Invalid configuration value {0}={1} (expected bool)".format(
                      key, string_value
                  )
              )
      elif dest_type == type(int()):
          try:
              return int(string_value)
          except:
              raise RuntimeError(
                  "Invalid configuration value {0}={1} (expected int)".format(
                      key, string_value
                  )
              )
      elif dest_type == type(float()):
          try:
              return float(string_value)
          except:
              raise RuntimeError(
                  "Invalid configuration value {0}={1} (expected int)".format(
                      key, string_value
                  )
              )
      elif dest_type == type(str()):
          return string_value
  
imports: from __future__ import print_function
  from __future__ import division
  import re
  import sys
label_desc: Use image node_id 5 for calling a global function with example usage: convert_value_to_type(key, dest_type, string_value) and returns: True, False, int, float, string_value