tasks/release.py
def check_upstream_branch(github, branch):
    """
    Checks if the given branch already exists in the upstream repository
    """
    try:
        github_branch = github.get_branch(branch)
    except APIError as e:
        if e.status_code == 404:
            return False
        raise e

    # Return True if the branch exists
    return github_branch and github_branch.get('name', False)

    Checks if the given branch already exists in the upstream repository
    
Checks if the given branch already exists in the upstream repository
Checks if the given branch already exists in the upstream repository
def check_upstream_branch(github, branch):
    try:
        github_branch = github.get_branch(branch)
    except APIError as e:
        if e.status_code == 404:
            return False
        raise e
    return github_branch and github_branch.get('name', False)
def check_upstream_branch ( github , branch ) : try : github_branch = github . get_branch ( branch ) except APIError as e : if e . status_code == 404 : return False raise e return github_branch and github_branch . get ( 'name' , False )
Checks if the given branch already exists in the upstream repository
Checks if the given branch already exists in the upstream repository
"""
    Checks if the given branch already exists in the upstream repository
    """ # Return True if the branch exists
github
branch