<s> import os <EOL> def add_virtual_env_segment ( powerline ) : <EOL> env = os . getenv ( '<STR_LIT>' ) or os . getenv ( '<STR_LIT>' ) <EOL> if env is None : <EOL> return <EOL> env_name = os . path . basename ( env ) <EOL> bg = Color . VIRTUAL_ENV_BG <EOL> fg = Color . VIRTUAL_ENV_FG <EOL> powerline . append ( '<STR_LIT>' % env_name , fg , bg ) </s>
