'Determine the URL for a given github repository.
Args:
repository [string]: The upstream SourceRepository.
owner [string]: The explicit owner for the repository we want.
If not provided then use the github_user in the bound options.'

def get_github_repository_url(self, repository, owner=None):

    user = (owner or self.__options.github_user)
    if (not user):
        raise ValueError('No    --github_user    specified.')
    if ((user == 'default') or (user == 'upstream')):
        user = repository.owner
    url_pattern = ('https://github.com/{user}/{name}.git' if self.__options.use_https else 'git@github.com:{user}/{name}.git')
    return url_pattern.format(user=user, name=repository.name)
