<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def compare_versions(version_a, version_b, zerofill=False):
 """Return direction of version relative to provided version sections Args: version_a (str):
 First version to compare version_b (str):
 Second version to compare zerofill (bool):
 If True, treat any missing version sections as 0, otherwise ignore section. Defaults to False Returns: int: 0 if equal, -1 if a > b, 1 if a < b Examples: If a is equal to b, return 0 If a is greater than b, return -1 If a is less than b, return 1 If zerofill is False (default), sections not included in both versions are ignored during comparison If zerofill is True, any sections in one version not included in other version are set to 0 """

    a_sections = list((int(match) for match in re.findall(r'\d+', version_a)))
    b_sections = list((int(match) for match in re.findall(r'\d+', version_b)))

    if zerofill:
        max_sections = max([len(a_sections), len(b_sections)])

        a_sections += [0 for _ in range(max(max_sections - len(a_sections), 0))]
        b_sections += [0 for _ in range(max(max_sections - len(b_sections), 0))]

    else:
        min_sections = min([len(a_sections), len(b_sections)])

        a_sections = a_sections[:min_sections]
        b_sections = b_sections[:min_sections]

    return (b_sections > a_sections) - (b_sections < a_sections)