code: def subarray_with_max_product(arr):
      """arr is list of positive/negative numbers"""
      length = len(arr)
      product_so_far = max_product_end = 1
      max_start_i = 0
      so_far_start_i = so_far_end_i = 0
      all_negative_flag = True
  
      for i in range(length):
          max_product_end *= arr[i]
          if arr[i] > 0:
              all_negative_flag = False
  
          if max_product_end <= 0:
              max_product_end = arr[i]
              max_start_i = i
  
          if product_so_far <= max_product_end:
              product_so_far = max_product_end
              so_far_end_i = i
              so_far_start_i = max_start_i
  
      if all_negative_flag:
          print(
              f"max_product_so_far: {reduce(lambda x, y: x * y, arr)}, {arr}"
          )
  
      else:
          print(
              f"max_product_so_far: {product_so_far},{arr[so_far_start_i:so_far_end_i + 1]}"
          )
  
label_desc: Use image node_id 2 for calling a global function with example usage: subarray_with_max_product(arr) without return types