import re


def parse_url(url):
    """Tokenize the url to get username and repository name

    It parses the url and returns following properties

    - username
    - name (refers to repository name)

    Args:
        url: A repository URL

    Returns:
        A tuple of username and name if successful

    Raises:
        ValueError: An error occured parsing invalid github repository URL
    """
    check_valid_github_repository = re.match(r'^github.com/[\w-]+/[\w-]+/?$', url)
    if check_valid_github_repository is None:
        raise ValueError('The given repository URL is not valid')
    username, name = url.split('/')[-2:]
    return username, name