@classmethod
def _parse_url(cls, url):
    """Map github url to local directory
        """
    github_url = 'https://github.com/'
    if not url.startswith(github_url):
        raise ValueError("url of the permalink: {0} doesn't start with {1}"
            .format(url, github_url))
    url_dir = url[len(github_url):]
    if '/tree/' not in url_dir:
        raise ValueError(
            "'/tree/' missing in the url {0}. Typical github format " +
            'is github.com/<user>/<repo>/tree/<commit>/<directory>')
    url_dir = url_dir.replace('/tree', '')
    user, repo, commit, model = url_dir.split('/', 3)
    model = model.rstrip('/')
    return user, repo, commit, model
