Given a list of bounding boxes representing detected objects, write a function to calculate Intersection over Union (IoU) for tracking in Motional perception pipelines.
Implement calculate_iou(box_a, box_b), where each box is [x_min, y_min, x_max, y_max]. Return a floating-point IoU between 0.0 and 1.0. Treat boxes with zero or negative area, and boxes that do not overlap, as having an IoU of 0.0.
The function receives two lists of four numbers and returns a float. Use the standard definition: intersection_area / union_area, where union_area = area_a + area_b - intersection_area.
def calculate_iou(box_a, box_b):