コード例 #1
0
 def __init__(self):
     settings.init_settings()
     time.sleep(5)
     self.drivers = settings.get_drivers()
     self.case_list = settings.get_case_list()
     self.drivers_users = generate_users(self.drivers)
     self.lock = Lock()
コード例 #2
0
ファイル: env.py プロジェクト: dorogusha/travelPTS
def run_migrations_offline():
    """Run migrations in 'offline' mode.

    This configures the context with just a URL
    and not an Engine, though an Engine is acceptable
    here as well.  By skipping the Engine creation
    we don't even need a DBAPI to be available.

    Calls to context.execute() here emit the given string to the
    script output.

    """

    # postgresql://postgres:postgres@localhost/oracles_vision
    # url = context_config.get_main_option("sqlalchemy.url")

    init_settings()
    url = 'postgresql://%s:%s@%s/%s' % (config.get(
        'DB', 'user'), config.get('DB', 'password'), config.get(
            'DB', 'host'), config.get('DB', 'database'))

    context.configure(url=url,
                      target_metadata=target_metadata,
                      literal_binds=True)

    with context.begin_transaction():
        context.run_migrations()
コード例 #3
0
ファイル: __init__.py プロジェクト: lvaz/gedit2-custom-indent
    def __init__(self):
        gedit.Plugin.__init__(self)

        self._instances = {}
        self._data_dir = self.get_data_dir()

        settings.init_settings(self._data_dir)
コード例 #4
0
 def __init__(self):
     settings.init_settings()
     time.sleep(5)
     self.drivers = settings.get_drivers()
     self.case_list = settings.get_case_list()
     self.login_users = settings.get_user_table()
     self.sign_users = settings.get_email_sign_table()
     #         self.lock = Lock()
     self.driver_queue = Queue()
     self.thread_pool = ThreadPoolExecutor(max_workers=len(self.drivers))
コード例 #5
0
# Train the Style Transfer Net

from __future__ import print_function

import numpy as np
import tensorflow as tf
import os
import settings

data_set = "imagenet"  #"imagenet"
data_set_name = "imagenet_shallowest"
settings.init_settings(data_set_name, suffix="_attack")
logger = settings.logger

from imagenetmod.interface import build_imagenet_model, imagenet, restore_parameter
from style_transfer_net import StyleTransferNet, StyleTransferNet_adv
from utils import get_train_images
from cifar10_class import Model
import cifar10_input
from PIL import Image
from adaptive_instance_norm import normalize

STYLE_LAYERS = settings.config["STYLE_LAYERS"]

# (height, width, color_channels)
TRAINING_IMAGE_SHAPE = settings.config["IMAGE_SHAPE"]

EPOCHS = 4
EPSILON = 1e-5
BATCH_SIZE = settings.config["BATCH_SIZE"]
if data_set == "cifar10":
コード例 #6
0
import os, sys, torch
import numpy as np
from torch.autograd import Variable
from dataset import *
import settings, log
import torch.nn as nn, torch.utils.data as data
import torch.optim as optim
from utils import *
from tqdm import tqdm
from model import resnet6

force_new_model = True
pretrained_model = None
# init the settings
settings.init_settings(force_new_model, pretrained_model)
# init the log
log.init_logger(tensorboard=False)


def show_images(img):
    show_image(img[:, :, 0])
    show_image(img[:, :, 1])


def train(model, train_data, criterion, optimizer, epoch):
    total_train_images = len(train_data)
    # print(total_train_images)

    if opt["useGPU"]:
        model = model.cuda()
コード例 #7
0
from settings import Settings, init_settings
from word import *

app_ver = 'wordman test 1.0.1'




###### 프로그램 초기화 및 설정 시작 ######


setup.init()
logging.info(app_ver)

config = load_config()
settings = init_settings(config['db'])
words = init_words(config['db'])
examples = init_examples(config['db'])
synonyms = init_synonyms(config['db'])
antonyms = init_antonyms(config['db'])

my_key = settings.get_or_input('secret_key', 'your secret key')
logging.debug('secret key = ' + my_key)

my_port = settings.get_or_input('http_port', 'your http port', type(0))
logging.debug('http port = ' + my_port)


# Start HTTP Server
app = Flask(__name__, template_folder = './themes')
Reggie(app)
コード例 #8
0
# Train the Style Transfer Net
from __future__ import print_function

import numpy as np
import tensorflow as tf
import os

import settings

data_set = "imagenet"  #cifar10"  # "imagenet"
settings.init_settings("imagenet_shallow")

from adaptive_instance_norm import normalize
from PIL import Image
import cifar10_input
from cifar10_class import Model
from utils import get_train_images
from style_transfer_net import StyleTransferNet, StyleTransferNet_adv
from imagenetmod.interface import build_imagenet_model, imagenet, restore_parameter

STYLE_LAYERS = settings.config["STYLE_LAYERS"]

# (height, width, color_channels)
TRAINING_IMAGE_SHAPE = settings.config["IMAGE_SHAPE"]

EPOCHS = 4
EPSILON = 1e-5
BATCH_SIZE = settings.config["BATCH_SIZE"]
if data_set == "cifar10":
    LEARNING_RATE = 1e-1
    LR_DECAY_RATE = 1e-4  # 5e-5
コード例 #9
0
import os, sys, torch
import numpy as np
from torch.autograd import Variable
from dataset import *
import settings, log
import torch.nn as nn, torch.utils.data as data
import torch.optim as optim
from utils import *
from tqdm import tqdm
from model import resnet6
import scipy.io as sio

pretrained_model = "../scratch/sysu_mm01/deepzeropadding-14May2019-125214_deep-zero-padding/deep_zero_model#156.pth"
# init the settings

settings.init_settings(False, pretrained_model)
# init the log
log.init_logger(tensorboard=False, prepend_text="test_")


def get_max_test_id(test_ids):
    int_test_ids = [int(ID) for ID in test_ids]
    return np.max(int_test_ids)


def prepare_empty_matfile_config(max_test_id):
    cam_features = np.empty(max_test_id, dtype=object)
    for i in range(len(cam_features)):
        cam_features[i] = []
    return cam_features
コード例 #10
0
'''
Created on 2018年7月20日

@author: cloud
'''
from helper import elements
import time, logging
import settings
import unittest
import cases
from cases import match
from concurrent.futures import ThreadPoolExecutor, wait
from threading import Thread

logger = logging.getLogger()
settings.init_settings()
drivers = settings.get_drivers()
time.sleep(3)
driver = drivers[0]
data = {}
# elements.GenderFilterMatchButton(driver).click()
# time.sleep(2)
# driver.find_elements_by_android_uiautomator("new UiSelector().text(\"Purchase\")")
# a=driver.find_element_by_id("com.videochat.livu:id/view_title").find_element_by_xpath("android.widget.TextView[@text='Purchase']")
# print(a)
# print(elements.RechargeButton(driver).element.text)
# elements.RechargeButton(driver).click()
# driver.back()
# driver.back()
# driver.back()
# elements.MatchHistoryButton(driver).click()