def _get_branch(repo, name):
 try:
  return [x for x in _all_branches(repo) if (x[0] == name)][0]
 except IndexError:
  return False

def _get_branch ( repo , name ) : try : return [ x for x in _all_branches ( repo ) if ( x [ 0 ] == name ) ] [ 0 ] except IndexError : return False
find the requested branch in the specified repo .