<s> from os import system <EOL> from os . path import join , abspath <EOL> from pulsar . main import ArgumentParser , PulsarConfigBuilder <EOL> from pulsar . core import DEFAULT_STAGING_DIRECTORY <EOL> DESCRIPTION = "<STR_LIT>" <EOL> FORCE_PRODUCTION = False <EOL> def main ( argv = None ) : <EOL> arg_parser = ArgumentParser ( description = DESCRIPTION ) <EOL> arg_parser . add_argument ( "<STR_LIT>" , required = True ) <EOL> arg_parser . add_argument ( "<STR_LIT>" ) <EOL> arg_parser . add_argument ( "<STR_LIT>" ) <EOL> args = arg_parser . parse_args ( argv ) <EOL> user = args . user <EOL> job_id = args . job_id <EOL> if args . job_id : <EOL> staging_directory = PulsarConfigBuilder ( ) . load ( ) . get ( '<STR_LIT>' , DEFAULT_STAGING_DIRECTORY ) <EOL> job_directory = abspath ( join ( staging_directory , job_id ) ) <EOL> assert job_directory . startswith ( staging_directory ) <EOL> elif FORCE_PRODUCTION : <EOL> raise Exception ( "<STR_LIT>" ) <EOL> else : <EOL> job_directory = abspath ( args . job_directory ) <EOL> assert job_directory <EOL> command = "<STR_LIT>" % ( user , job_directory ) <EOL> system ( command ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
