def __get_argparse_configuration__(): parser = ArgumentParser(description="Log argument parser", usage=argparse.SUPPRESS) parser.add_argument("--level", "-l", dest="level", default="Debug", required=False, choices=['Warn', 'Info', 'Debug', 'Error']) parser.add_argument("--message", "-m", nargs='+', dest="message", required=True) return parser
def init_parser(self): parser = ArgumentParser() admin_branch, help_branch, course_branch = \ parser.add_argument('branch', branching=[('admin', lambda x: x == 'admin'), ('help', lambda x: x == 'help'), ('course', lambda x: True)], help='select course, admin, or help') course_branch.help = 'Enter your course to submit files to it.' course_branch.add_argument( 'assignment', help='specify which assignment you are submitting') course_branch.add_argument( 'files', multiple=0, help='specify the files which you are submitting') admin_branch.add_argument( 'admin-select', help= "choose one of: add-admin, remove-admin, create-course, delete-course, display-admins, display-courses" ) admin_branch.add_argument('names', optional=True, multiple=0) ''' branching=[('add-admin', lambda x: x == 'add-admin'), ('remove-admin', lambda x: x == 'remove-admin'), ('create-course', lambda x: x == 'create-course'), ('delete-course', lambda x: x == 'delete-course'), ('display-admins', lambda x: x == 'display-admins'), ('display-courses', lambda x: x == 'display-courses')], ''' return parser
def __get_argparse_configuration__(): parser = ArgumentParser(description="Graphics argument parser", usage=argparse.SUPPRESS) parser.add_argument("--shape", "-s", dest="shape", choices=["Circle", "Rectangle"], required=True) parser.add_argument("--color", "-c", type=check_color_variable, nargs=3, dest="color") parser.add_argument("--area", "-a", type=int, nargs=4, dest="area", required=True) return parser
def __get_argparse_configuration__(): parser = ArgumentParser(description="Save argument parser", usage=argparse.SUPPRESS) parser.add_argument("--file","-f", type=str, dest="file", required=False) return parser
# limitations under the License. # # ============================================================================== import gc import os from tqdm import tqdm import torch from chembl import Chembl from graphgen import GraphGen from saver import Saver from visdom_helper import Plot2D, Image from argument_parser import ArgumentParser parser = ArgumentParser(description='Process some integers.') parser.add_argument("-lr", type=float, default=3e-4) parser.add_argument("-wd", type=float, default=0) parser.add_argument("-optimizer", default="adam") parser.add_argument("-batch_size", type=int, default=128) parser.add_argument("-save_dir", type=str) parser.add_argument("-force", type=bool, default=0, save=False) parser.add_argument("-gpu", type=str, default="") parser.add_argument("-lr_milestones", default="none", parser=ArgumentParser.int_list_parser) parser.add_argument("-lr_gamma", default=0.3) parser.add_argument("-dropout", default=0.0) parser.add_argument("-state_size", default=128) parser.add_argument("-early_stop", type=bool, default=1) parser.add_argument("-kekulize", type=bool, default=0) parser.add_argument("-random_order", type=bool, default=0)