<s> """<STR_LIT>""" <EOL> import sys <EOL> import os <EOL> import subprocess <EOL> def perform_testing ( config ) : <EOL> requirements = { <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" , <EOL> "<STR_LIT>" : "<STR_LIT>" <EOL> } <EOL> print "<STR_LIT>" <EOL> print canwrite ( config [ '<STR_LIT>' ] [ '<STR_LIT>' ] ) , "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> print "<STR_LIT>" <EOL> for req in requirements : <EOL> print checkcommand ( requirements [ req ] ) , req <EOL> sys . exit ( <NUM_LIT:0> ) <EOL> def canwrite ( path ) : <EOL> try : <EOL> ret = booltostatus ( os . access ( path , os . W_OK | os . X_OK ) ) <EOL> except : <EOL> ret = False <EOL> finally : <EOL> return ret <EOL> def booltostatus ( inbool ) : <EOL> if inbool : <EOL> return "<STR_LIT>" <EOL> else : <EOL> return "<STR_LIT>" <EOL> def checkcommand ( com ) : <EOL> proc = subprocess . Popen ( <EOL> [ <EOL> '<STR_LIT>' , <EOL> str ( com ) <EOL> ] , <EOL> stderr = subprocess . PIPE , <EOL> stdout = subprocess . PIPE <EOL> ) <EOL> return booltostatus ( len ( proc . stdout . read ( ) ) > <NUM_LIT:0> ) </s>
