code: def UQ(start, end, lower, upper):
      diameters = []
      function_evaluations = []
      total_func_evals = 0
      total_diameter = 0.0
  
      for i in range(start, end + 1):
          lb = lower[start : end + 1] + [lower[i]]
          ub = upper[start : end + 1] + [upper[i]]
  
          # construct cost function and run optimizer
          cost = costFactory(i)
          subdiameter, func_evals = dakota(
              cost, lb, ub
          )  # XXX: no initial conditions
  
          function_evaluations.append(func_evals)
          diameters.append(subdiameter)
  
          total_func_evals += function_evaluations[-1]
          total_diameter += diameters[-1]
  
      print("subdiameters (squared): %s" % diameters)
      print("diameter (squared): %s" % total_diameter)
      print(
          "func_evals: %s => %s"
          % (function_evaluations, total_func_evals)
      )
  
      return
  
label_desc: Use image node_id 4 for calling a global function with example usage: UQ(start, end, lower, upper) without return types