def _setup(out_file, args): import strop in_file = args[0] # open file as specified in uu file and # assign out_file for later use i = in_file.readline() i = strop.strip(i) if 'begin' != i[:5]: raise IOError, 'input file not in UUencoded format' [dummy, mode, filename] = strop.split(i) mode = strop.atoi(mode, 8) out_file = open(filename,'w',mode) _out_file_orig = 0 return (out_file,_out_file_orig)
def _setup(out_file, args): import strop in_file = args[0] # open file as specified in uu file and # assign out_file for later use i = in_file.readline() i = strop.strip(i) if 'begin' != i[:5]: raise IOError, 'input file not in UUencoded format' [dummy, mode, filename] = strop.split(i) mode = strop.atoi(mode, 8) out_file = open(filename, 'w', mode) _out_file_orig = 0 return (out_file, _out_file_orig)
def main(): count=1 model="" if sys.argv.__len__() > 1: count = strop.atoi(sys.argv[1]) if sys.argv.__len__() > 2: model = sys.argv[2] else: checkpoint = tf.train.get_checkpoint_state("saved_networks") if checkpoint and checkpoint.model_checkpoint_path: model = checkpoint.model_checkpoint_path if model == "": print ("please run as: python", sys.argv[0]," repeat_count") else: playGame(model, count)
def test_atoi(self): self.assertTrue(strop.atoi(" 1 ") == 1) self.assertRaises(ValueError, strop.atoi, " 1x") self.assertRaises(ValueError, strop.atoi, " x1 ")
import warnings