<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def range_overlap(a, b, ratio=False):
 """ Returns whether two ranges overlap. Set percentage=True returns overlap ratio over the shorter range of the two. 5 0.2 16 1.0 0 0 0.0 """

    a_chr, a_min, a_max = a
    b_chr, b_min, b_max = b
    a_min, a_max = sorted((a_min, a_max))
    b_min, b_max = sorted((b_min, b_max))
    shorter = min((a_max - a_min), (b_max - b_min)) + 1
    # must be on the same chromosome
    if a_chr != b_chr:
        ov = 0
    else:
        ov = min(shorter, (a_max - b_min + 1), (b_max - a_min + 1))
        ov = max(ov, 0)
    if ratio:
        ov /= float(shorter)
    return ov