(branch_name)
return min(positions.keys(), key=positions.get)
>>> version_of_branch('tkt_white_this_is_not_a_ee_branch')
    'white'
>>> version_of_branch('tkt_white_this_is_not_a_ee_branch')
    'white'
>>> version_of_branch ( tkt_white_this_is_not_a_ee_branch ) white
def version_of_branch(branch_name):
    """
    >>> version_of_branch('tkt_white_this_is_not_a_ee_branch')
    'white'
    """
    positions = {version: branch_name.find(version)
                 for version in VERSIONS}
    if all((pos < 0) for pos in positions.values()):
        # The branch name doesn't contain white, pink or black
        return
    positions = {version: pos
                 for (version, pos) in positions.items()
                 if pos >= 0}
    return min(positions.keys(), key=positions.get)
def version_of_branch ( branch_name ) : positions = { version : branch_name . find ( version ) for version in VERSIONS } if all ( ( pos < 0 ) for pos in positions . values ( ) ) : # The branch name doesn't contain white, pink or black return positions = { version : pos for ( version , pos ) in positions . items ( ) if pos >= 0 } return min ( positions . keys ( ) , key = positions . get )