Beispiel #1
0
def f(count, x):
    init.init()
    #s = randint(1, 5)
    #time.sleep(s)
    #return (__name__, os.getppid(), os.getpid(), "id: "+str(count), "sleep: "+str(s), x)
    try:
        return (count, user_data.do_get_u_id_from_sn("mary"))
    except e:
        print str(e)
Beispiel #2
0
import unittest
from time import sleep
import sys, os

sys.path.append(
    os.path.dirname(
        os.path.dirname(
            os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
from parameterized import parameterized
from lib.init import root_url, driver, sleep_time, init
from case.Learning_Log.method import register, login, logout

data, Page = init(__file__)
page = Page()


class Login(unittest.TestCase):
    """登录"""
    def tearDown(self):
        sleep(sleep_time)

    @classmethod
    def tearDownClass(cls):
        logout()

    def test_1_jump(self):
        """跳转到登录页面"""
        # 验证从导航栏跳转到登录页面
        page.get()
        page.jump.click()
        self.assertEqual(page.url, driver.current_url)
Beispiel #3
0
                        help='which model (default: xception)')
    parser.add_argument('--data_root',
                        default='./',
                        help='data_root (default: ./)')
    parser.add_argument('--nepoch',
                        type=int,
                        default=50,
                        help='epochs (default: 200)')
    parser.add_argument('--seed',
                        type=int,
                        default='10',
                        help='seed (default: 1)')
    parser.add_argument('--pretrain',
                        type=int,
                        default='0',
                        help='pretrain (default: 1)')
    parser.add_argument('--data_name',
                        default='train',
                        help='data_name (default: train)')
    parser.add_argument('--params_name',
                        default='segcaps.pkl',
                        help='params_name (default: segcaps.pkl)')
    parser.add_argument('--load_params_name',
                        default='segcaps.pkl',
                        help='params_name (default: segcaps.pkl)')
    args = parser.parse_args()
    train_loader, model, decreasing_lr = init(args)
    train(args, model, train_loader, decreasing_lr, wd=0.0001, momentum=0.9)
    print('hhh')
    print('Done!')
Beispiel #4
0
import os
import time

from psycopg2.extras import UUID_adapter

import lib.init as init
import lib.db as db
import lib.loc as loc

import data.location_data as location_data
import data.user_data as user_data
"""
this file uses 100 col terminal width
"""

opst = init.init()


def start_processing():
    print "start_processing"

    #remove prior processing results for user
    location_data.do_remove_all_traj(u_id)

    #print "get a complete list of location sessions for a user"
    ssql = """
        select distinct a.sess_id
        from location a, 
              _user_session b, 
              _user c
        where a.sess_id = b.sess_id
Beispiel #5
0
def main():
    init()

    CRUDGroups()
    CRUDComponents()
    CRUDIncidents()
Beispiel #6
0
import os

import lib.init as init
import data.user_data as user_data

def log_result(result):
    print str(result)

def f(count, x):
    init.init()
    #s = randint(1, 5)
    #time.sleep(s)
    #return (__name__, os.getppid(), os.getpid(), "id: "+str(count), "sleep: "+str(s), x)
    try:
        return (count, user_data.do_get_u_id_from_sn("mary"))
    except e:
        print str(e)

if __name__ == '__main__':
    pool = Pool(processes = 50)              # start 4 worker processes
    count = 0
    for x in range(1,100):
        count = count + 1
        print str("count: "+str(count))
        result = pool.apply_async(f, (count, 10),  callback = log_result)
        #print str(result.get(timeout=20))
    pool.close()
    pool.join()

    init.init()
Beispiel #7
0
from lib import init

from lib.service import Service, Service_tree
from lib.stack import Stack
#from lib.tree import Tree
from lib.container import Container
from lib.endpoint import Endpoint
#from lib.stage import Stage
from docker.errors import APIError
import lib.lib_docker as docker

config = cfg.get_config()
logging = cfg.get_logger()
rules = cfg.get_rules_config()

session = init.init()


# Service functions
def create_service(name):
    """Creates a new service
    Arguments:
        name: Name of the new service
    Constraints:
        name: unique
    """
    # HERE NEEDS CHECK OF STATE
    # check if service exists (name)

    if not session.query(Service).filter(Service.name == name).first():
        try:
Beispiel #8
0
def create_db(args):
    """Initiates based on config"""
    init.init(create=True)
Beispiel #9
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# project = https://github.com/fanxs-t/Shadow-Border
# author = Fanxs


from web.web import web_init
from lib.init import init

VERSION = "1.0"
logo = """
         _______   ____ _               _               
       ________  / ____| |             | |        
 _____________  | (___ | |__   __ _  __| | _____      __  
       _______   \___ \| '_ \ / _` |/ _` |/ _ \ \ /\ / /    Version %s.%s  
           ____  ____) | | | | (_| | (_| | (_) \_V _V /__  ___  _______   
      ________  |_____/|_| |_|\__,_|\__,_|/ _ )/ __ \/ _ \/ _ \/ __/ _ \ 
            __________________________   / _  / /_/ / , _/ // / _// , _/ 
                    ________________    /____/\____/_/|_/____/___/_/|_|  
""" % tuple(VERSION.split('.'))

if __name__ == '__main__':
    print(logo)
    init()
    web_init()
Beispiel #10
0
import unittest
from time import sleep
import sys, os
sys.path.append(
    os.path.dirname(
        os.path.dirname(
            os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
from parameterized import parameterized
from lib.init import root_url, driver, sleep_time, init
from case.Learning_Log.method import register, login, logout
data, Page = init(
    __file__
)  # OtherPage, other_data = init("\\module_1_login\\case_2_logout.py") # 如果需要初始化其它页面时
page = Page()


class Register(unittest.TestCase):
    """注册"""
    def tearDown(self):
        sleep(sleep_time)

    @classmethod
    def tearDownClass(cls):
        logout()

    def test_1_jump(self):
        """跳转到注册页面"""
        # print("通过") # 可以通过print()在测试报告中添加描述
        # 验证从导航栏跳转到注册页面
        page.get()
        page.jump_from_nav.click()
Beispiel #11
0
# Copyright 2013 The Moore Collective, LLC, All Rights Reserved

import data.message_data as message_data

import lib.init as init

_OPTS = init.init()

message_data.reset_all_tokens()