code: def get_value_range(value, target_type):
      if isinstance(value, str):
          r = target_type(0)
          parts = value.split("~")
          if len(parts) == 2:
              value = parts[0]
              r = target_type(parts[1])
          elif len(parts) > 2:
              raise ValueError("Cannot parse value range")
          parts = value.split(":")
          if len(parts) == 1:
              parts.append(parts[0])
          elif len(parts) > 2:
              raise ValueError("Cannot parse value range")
          return ValueRange(
              target_type(parts[0]), target_type(parts[1]), r
          )
      if isinstance(value, tuple):
          if len(value) == 2:
              return ValueRange(
                  target_type(value[0]), target_type(value[1]), 0
              )
          if len(value) == 3:
              return ValueRange(
                  target_type(value[0]),
                  target_type(value[1]),
                  target_type(value[2]),
              )
          raise ValueError(
              "Cannot convert to ValueRange: Wrong tuple size"
          )
      return ValueRange(target_type(value), target_type(value), 0)
  
imports: import os
  import sys
  import time
  import heapq
  import semver
  import random
  from multiprocessing import Pool
  from collections import namedtuple
label_desc: Use image node_id 6 for calling a global function with example usage: get_value_range(value, target_type) and returns: ValueRange, ValueRange, ValueRange, ValueRange