#NEWLINE# def _required_envs( env_vars ) : #NEWLINE# #INDENT# '\n    Parse environment variables for required values,\n    raising a `BrowserConfig` error if they are not found.\n\n    Returns a `dict` of environment variables.\n    ' #NEWLINE# envs = { key : os . environ . get ( key ) for key in env_vars } #NEWLINE# missing = [ key for ( key , val ) in envs . items ( ) if ( val is None ) ] #NEWLINE# if ( len ( missing ) > 0 ) : #NEWLINE# #INDENT# msg = ( 'These environment variables must be set: ' + ', ' . join ( missing ) ) #NEWLINE# raise BrowserConfigError ( msg ) #NEWLINE# #UNINDENT# if ( envs [ 'SELENIUM_BROWSER' ] not in BROWSERS ) : #NEWLINE# #INDENT# msg = 'Unsuppported browser: {0}' . format ( envs [ 'SELENIUM_BROWSER' ] ) #NEWLINE# raise BrowserConfigError ( msg ) #NEWLINE# #UNINDENT# return envs