def subarray_with_max_product(arr):
l = len(arr)<EOL>product_so_far = max_product_end = <NUM_LIT:1><EOL>max_start_i = <NUM_LIT:0><EOL>so_far_start_i = so_far_end_i = <NUM_LIT:0><EOL>all_negative_flag = True<EOL>for i in range(l):<EOL><INDENT>max_product_end *= arr[i]<EOL>if arr[i] > <NUM_LIT:0>:<EOL><INDENT>all_negative_flag = False<EOL><DEDENT>if max_product_end <= <NUM_LIT:0>:<EOL><INDENT>max_product_end = arr[i]<EOL>max_start_i = i<EOL><DEDENT>if product_so_far <= max_product_end:<EOL><INDENT>product_so_far = max_product_end<EOL>so_far_end_i = i<EOL>so_far_start_i = max_start_i<EOL><DEDENT><DEDENT>if all_negative_flag:<EOL><INDENT>print("<STR_LIT>" %<EOL>(reduce(lambda x, y: x * y, arr), arr))<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>" %<EOL>(product_so_far, arr[so_far_start_i:so_far_end_i + <NUM_LIT:1>]))<EOL><DEDENT>
arr is list of positive/negative numbers