def __init__(self): self.url_for_test_proxy = cfg.url_for_test_proxy self.headers = cfg.random_headers() self.thread_pool = ThreadPoolExecutor( max_workers=cfg.thread_pool_workers) self.proxy_options = {} self.proxies = [] self.my_log = my_log.get_logger(__name__)
def __init__(self, config): # Logging LOG_FILE = "my_app.log" self.my_logger = my_log.get_logger("PDF_Log", LOG_FILE) # App logic self.input_dir = Path(config['Paths']["input folder"]) self.output_dir = Path(config['Paths']["output folder"]) self.changes_dir = Path(config['Paths']["changes folder"]) self.error_file = Path(config['Paths']["error file"]) self.changes = self.analize_changes()
from db_classes.saver import Saver from proxy_manager import ProxyManager import config as cfg import my_log main_logger = my_log.get_logger(__name__) main_logger.info('program started') saver = Saver() proxy_manager = ProxyManager()
from abc import ABC, abstractmethod from typing import List import numpy as np import tensorflow as tf import jsonpickle import my_log from batch_builder import InputProcessor, EndOfDatasetException # logging options np.set_printoptions(suppress=True) tf.logging.set_verbosity(tf.logging.DEBUG) logger = my_log.get_logger('root') # constants definition FORM_ONLY = 'form_only' CONTEXT_ONLY = 'context_only' SINGLE_PARAMETER = 'single_parameter' GATED = 'gated' DEFAULT = 'default' CLUSTERING = 'clustering' COMBINATORS = [FORM_ONLY, CONTEXT_ONLY, SINGLE_PARAMETER, GATED] CONTEXT_WEIGHTS = [DEFAULT, CLUSTERING] class RareWordVectorizer(ABC): @abstractmethod def train(self, num_epochs: int, batch_size: int,
import time import matplotlib.pyplot as plt import numpy as np from my_log import get_logger from analyse import solver, nsga as sm, nsga_platypus as nsagii from mongo import mongo as db LOG = get_logger('compare-solver') #iterations = [1000, 2000, 3000, 5000, 10000]#, 20000, 30000, 50000] iterations = [50000] # for ordered in db.get_portfolio_by_id('598dc26208ed83001321a939'): for ordered in db.get_portfolio_by_id('60a1507fdb94780001237585'): sharpes_sm = list() sharpes_nsga = list() sharpes_nsgaiii = list() wgmean_sm = list() wgmean_nsga = list() wgmean_nsgaiii = list() time_sm = list() time_nsga = list() time_nsgaiii = list() trade_codes = list() for stock in ordered.max_item.stocks: trade_codes.append(stock.trade_code) stocks = list() for trade_code in trade_codes:
def __init__(self): self.log = my_log.get_logger(__name__) self.log.debug('Saver was created') engine = create_engine("sqlite:///" + cfg.dbconfig['database'] + ".db") self.conn = engine.connect()