Add s:is_virtualenv() function to hold common code