<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_github_hostname_user_repo_from_url(url):
 """Return hostname, user and repository to fork from. :param url: The URL to parse :return: hostname, user, repository """

    parsed = parse.urlparse(url)
    if parsed.netloc == '':
        # Probably ssh
        host, sep, path = parsed.path.partition(":")
        if "@" in host:
            username, sep, host = host.partition("@")
    else:
        path = parsed.path[1:].rstrip('/')
        host = parsed.netloc
    user, repo = path.split("/", 1)
    return host, user, repo[:-4] if repo.endswith('.git') else repo