<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def urljoin(base_url, url, allow_fragments=True):
    '''Join URLs like ``urllib.parse.urljoin`` but allow scheme-relative URL.'''
    if url.startswith('//') and len(url) > 2:
        scheme = base_url.partition(':')[0]
        if scheme:
            return urllib.parse.urljoin(
                base_url,
                '{0}:{1}'.format(scheme, url),
                allow_fragments=allow_fragments
            )

    return urllib.parse.urljoin(
        base_url, url, allow_fragments=allow_fragments)