<s> from __future__ import with_statement <EOL> import sys <EOL> from sandbox import Sandbox , SandboxConfig <EOL> from optparse import OptionParser <EOL> def parseOptions ( ) : <EOL> parser = OptionParser ( usage = "<STR_LIT>" ) <EOL> SandboxConfig . createOptparseOptions ( parser ) <EOL> options , argv = parser . parse_args ( ) <EOL> if not argv : <EOL> parser . print_help ( ) <EOL> exit ( <NUM_LIT:1> ) <EOL> config = SandboxConfig . fromOptparseOptions ( options ) <EOL> return config , argv <EOL> def main ( ) : <EOL> config , argv = parseOptions ( ) <EOL> config . allowModule ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> with open ( argv [ <NUM_LIT:0> ] , "<STR_LIT:rb>" ) as fp : <EOL> content = fp . read ( ) <EOL> sys . argv = list ( argv ) <EOL> sandbox = Sandbox ( config ) <EOL> sandbox . execute ( content ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
