#NEWLINE# def fuzzy_match_branch( branch ) : #NEWLINE# #INDENT# if ( not all_branches ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# all_branches = get_branch_names ( ) #NEWLINE# if ( branch in all_branches ) : #NEWLINE# #INDENT# return branch #NEWLINE# #UNINDENT# def branch_fuzzy_match( b ) : #NEWLINE# #INDENT# return b . startswith ( branch ) #NEWLINE# #UNINDENT# possible_branches = filter ( branch_fuzzy_match , all_branches ) #NEWLINE# if ( len ( possible_branches ) == 1 ) : #NEWLINE# #INDENT# return possible_branches [ 0 ] #NEWLINE# #UNINDENT# return branch