def parse_gav(gav, defaults=(None, None, None)):
    """Parses the given GAV as a tuple.

    gav
        the GAV to parse. It must be a string with two colons separating the
        GAV parts.
    defaults
        a triple of default coordinates to return if a part from the input is
        missing

    Returns:
        a triple with the parsed GAV
    """
    parts = gav.split(':')
    if len(parts) != 3:
        raise ValueError(f"Not a valid GAV pattern: {gav}")

    for index, value in enumerate(parts):
        if len(value) == 0:
            parts[index] = defaults[index]

    return tuple(parts)