def __init__(self, root): tk.Frame.__init__(self) self.root = root self.grid() # tk layout manager grid self.grid_cells = [] # GUI grid self.init_grid() self.board = model.start() # init model (& add 2 values) self.update_grid_cells() # redraw grid
eq_market_cap = driver.find_element_by_xpath("//*[@id='directoryFilter']/a[2]") actions = ActionChains(driver) actions.move_to_element(eq_market_cap).perform() eq_market_cap.click() # select exchange exchange = driver.find_element_by_xpath("//*[@id='exchange']") exchange.click() nse = driver.find_element_by_xpath("//*[@id='exchangesUL']/li[3]") nse.click() time.sleep(5) name=[] table = driver.find_element_by_id("resultsTable") tr = table.find_elements_by_tag_name("tr") i=1 TRADE = "Strong Buy" for each in tr: name = each.find_element_by_xpath("//*[@id='resultsTable']/tbody/tr["+str(i)+"]/td[2]").text fifteen_min = each.find_element_by_xpath("//*[@id='resultsTable']/tbody/tr["+str(i)+"]/td[19]").text hour = each.find_element_by_xpath("//*[@id='resultsTable']/tbody/tr["+str(i)+"]/td[20]").text daily = each.find_element_by_xpath("//*[@id='resultsTable']/tbody/tr["+str(i)+"]/td[21]").text weekly = each.find_element_by_xpath("//*[@id='resultsTable']/tbody/tr["+str(i)+"]/td[22]").text monthly = each.find_element_by_xpath("//*[@id='resultsTable']/tbody/tr["+str(i)+"]/td[23]").text i = i+1 if(fifteen_min == hour == daily == weekly == monthly == TRADE): print(name) model.start(name) if(i == 50): break
print('model file:', model_file) print('=' * 60) sys.stdout.write(open(model_file).read()) print('=' * 60) test_file = os.path.join(test_dir, 'test.py') print('test file:', test_file) print('=' * 60) sys.stdout.write(open(test_file).read()) print('=' * 60) import model # import and run the current model # adapt model to test, e.g. to set output directory name if hasattr(model, 'start'): model.start(test_name) # create a checkpoint file for this specific (model, test) combination if ('GAP_TESTER_CHECKPOINT' in os.environ and os.environ['GAP_TESTER_CHECKPOINT'] != "") or not hasattr( model, 'no_checkpoint') or not model.no_checkpoint: checkpoint_file = run_root + '.db' print('Using checkpoint file', checkpoint_file) model.calculator = CheckpointCalculator(model.calculator, db=checkpoint_file) import test # import and run the current test print('=' * 60) print('Property calculation output:') print('')
def start(players_db, tournaments_db): model.start(players_db, tournaments_db) view.start(controller)
dimension = 3 # 创建比例, 用于分割训练集和验证集, 80%的数据用于模型训练, 20%的数据用于模型验证 ratio = 0.8 # 训练集类型数 class_size = 9 # batch_size代表使用梯度下降训练模型时候, 即每次使用batch_size个数据来更新参数 batch_size = 64 # 样本训练次数, 一个epoch代表用所有的数据训练一次 n_epoch = 20 train = True # 模型保存路径 model_path = 'D:/cuisine_rec/model/' # train() model.start(path=path, weight=weight, height=height, dimension=dimension, ratio=ratio, class_size=class_size, batch_size=batch_size, n_epoch=n_epoch, train=train, model_path=model_path)
print 'model file:', model_file print '=' * 60 sys.stdout.write(open(model_file).read()) print '=' * 60 test_file = os.path.join(test_dir, 'test.py') print 'test file:', test_file print '=' * 60 sys.stdout.write(open(test_file).read()) print '=' * 60 import model # import and run the current model # adapt model to test, e.g. to set output directory name if hasattr(model, 'start'): model.start(args.test_name) # create a checkpoint file for this specific (model, test) combination if ('SI_GAP_TEST_CHECKPOINT' in os.environ and os.environ['SI_GAP_TEST_CHECKPOINT'] != "") or not hasattr( model, 'no_checkpoint') or not model.no_checkpoint: checkpoint_file = 'model-{0}-test-{1}.db'.format(args.model_name, args.test_name) model.calculator = CheckpointCalculator(model.calculator, db=checkpoint_file) import test # import and run the current test print '=' * 60 print 'Property calculation output:' print
def initialize(): """The initial start screen""" model.start() model.display_all()
from sqlalchemy import Column, ForeignKey, Integer, String from sqlalchemy.orm import relationship from model import start, User, Base engine, session = start() class Product(Base): __tablename__ = 'product' id = Column(Integer, primary_key=True) name = Column(String) user_id = Column(Integer, ForeignKey('user.id')) user = relationship(User) def __repr__(self): # optional return f'Product {self.name} - User {self.user_id}' @classmethod def find_by_name(cls, session, name): return session.query(cls).filter_by(name='wolf').first() User.products = relationship(Product, backref='users') Product.__table__.create(engine) user = User(name='John') product = Product(name='wolf', user=user) session.add(user)