<s> import argparse <EOL> import json <EOL> from api_client import APIClient <EOL> class Scheduler ( APIClient ) : <EOL> def schedule ( self , job ) : <EOL> """<STR_LIT>""" <EOL> if isinstance ( job , basestring ) : <EOL> with open ( job ) as f : <EOL> job = f . read ( ) <EOL> else : <EOL> job = json . dumps ( job ) <EOL> print self . post ( "<STR_LIT>" , data = job ) <EOL> def main ( ) : <EOL> parser = argparse . ArgumentParser ( description = '<STR_LIT>' , formatter_class = argparse . ArgumentDefaultsHelpFormatter ) <EOL> parser . add_argument ( '<STR_LIT>' , '<STR_LIT>' , default = '<STR_LIT>' , <EOL> help = '<STR_LIT>' , dest = '<STR_LIT>' ) <EOL> parser . add_argument ( <EOL> '<STR_LIT>' , help = '<STR_LIT>' , nargs = '<STR_LIT:+>' ) <EOL> args = parser . parse_args ( ) <EOL> scheduler = Scheduler ( args . server ) <EOL> for job in args . job : <EOL> scheduler . schedule ( job ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
