content
stringlengths
5
1.05M
from click import ClickException, echo class ProfileBuilderException(ClickException): """Base exceptions for all Profile Builder Exceptions""" class Abort(ProfileBuilderException): """Abort the build""" def show(self, **kwargs): echo(self.format_message()) class ConfigurationError(ProfileBuild...
# -*- coding:utf-8 -*- """ 目标:能够使用多线程实现同时接收多个客户端的多条信息 1.TCP服务器端 (1) 实现指定端口监听 (2) 实现服务器端地址重用,避免"Address in use"错误。 (3) 能够支持多个客户端连接. (4) 能够支持支持不同的客户端同时收发消息(开启子线程) (5) 服务器端主动关闭服务器,子线程随之结束. """ # 1. 该程序可以支持多客户端连接. # 2. 该程序可以支持多客户端同时发送消息. # 1. 导入模块 import socket import threading def recv_msg(new_client_socket,ip_port):...
from __future__ import unicode_literals import datetime import itertools from django.test import TestCase from django.db import IntegrityError from django.db.models import Prefetch from modelcluster.models import get_all_child_relations from modelcluster.queryset import FakeQuerySet from tests.models import Band, B...
import functools import tornado.options def define_options(option_parser): # Debugging option_parser.define( 'debug', default=False, type=bool, help="Turn on autoreload and log to stderr", callback=functools.partial(enable_debug, option_parser), group='Debugging') def conf...
from django.urls import path from . import books_views urlpatterns = [ path('books/', books_views.index, name='books'), ]
""" Game API for Pacman """ import random from collections import defaultdict from abc import ABC, abstractmethod import math import mcts import copy import torch as tr import pacman_net as pn import pacman_data as pd import numpy as np class Node(ABC): directionsDic = [[1,0], [0,1], [-1,0], [0,-1]] @abstrac...
import streamlit as st import pandas as pd from tfidf import get_vocab_idf st.title('Binary Classification') st.write("This app shows the featurization created from delta tf-idf for binary classification.") # Sidebar with st.sidebar.header('1. Upload your CSV data'): uploaded_file = st.sidebar.file_uploader("Up...
from country_assignment import assign_countries_by_priority from data_processing.player_data import PlayerData from flask import (Flask, redirect, render_template, request, url_for, flash) import os from pathlib import Path import argparse import uuid app = Flask(__name__) app.secret_key = os.urandom(24) unique_coun...
from pynterviews.mutants import mutants def test_positive(): dna = ["CTGAGA", "CTGAGC", "TATTGT", "AGAGAG", "CCCCTA", "TCACTG"] result = mutants(dna) assert result def test_negative(): dna = ["CTGAGA", "CTGAGC", "TATTGT", ...
def Bisection_Method(equation, a, b, given_error): # function, boundaries, Es li_a = deque() # a li_b = deque() # b li_c = deque() # x root -> c li_fc = deque() # f(xr) li_fa = deque() # f(a) li_fb = deque() # f(b) li_Ea = deque() # estimated error data = { 'Xl': li_...
from django.urls import path app_name = 'profiles' urlpatterns = []
import os if os.getenv('HEROKU') is not None: from .prod import * elif os.getenv('TRAVIS') is not None: from test import * else: from base import *
""" 1. Верхняя одежда 1.1. #куртки 1.2. #кофты 1.3. #майки 1.4. #футболки 1.5. #рубашки 1.6. #шапки 1.7. #кепки 2. Нижняя одежда 2.1. #брюки 2.2. #шорты 2.3. #ремни 2.4. #болье 2.5. #носки 3. Костюмы 3.1. #спортивные 3.2. #класические 4. Обувь 4.1. #красовки 4.2. #кеды 4.3. #ботинки 4.4. #туфли 5.Аксесуары 5.1. #рю...
# Copyright 2014 CloudFounders NV # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
import os import pandas as pd os.chdir('/Users/forrestbadgley/Documents/DataScience/git/NUCHI201801DATA4-Class-Repository-DATA/MWS/Homework/03-Python/Instructions/PyPoll/raw_data') csv_path = "election_data_1.csv" csv_path2 = "election_data_2.csv" elect1_df = pd.read_csv(csv_path) elect2_df = pd.read_csv(csv_path2)...
import re from pyhanlp import * # def Tokenizer(sent, stopwords=None): # pat = re.compile(r'[0-9!"#$%&\'()*+,-./:;<=>?@—,。:★、¥…【】()《》?“”‘’!\[\\\]^_`{|}~\u3000]+') # tokens = [t.word for t in HanLP.segment(sent)] # tokens = [re.sub(pat, r'', t).strip() for t in tokens] # tokens = [t for t in tokens if...
import numpy as np from seisflows.tools.array import uniquerows from seisflows.tools.code import Struct from seisflows.tools.io import BinaryReader, mychar, mysize from seisflows.seistools.shared import SeisStruct from seisflows.seistools.segy.headers import \ SEGY_TAPE_LABEL, SEGY_BINARY_HEADER, SEGY_TRACE_HEADE...
import sys import torch import numpy as np sys.path.append('../') from models import networks import argparse parser = argparse.ArgumentParser() parser.add_argument('--model-in-file',help='file path to generator model to export (.pth file)',required=True) parser.add_argument('--model-out-file',help='file path to expor...
def parse_line(line, extraction_map): print("---------parsing line------") key = get_key_for_line(line) extraction_guide = extraction_map[key] obj = get_blank_line_object() flag = special_line_case(key) answer_flag = special_answer_case(key) if (flag == True): line = escape_undersco...
from matplotlib.offsetbox import AnchoredText import numpy as np import matplotlib.pyplot as plt from iminuit import Minuit, describe from iminuit.util import make_func_code class Chi2Reg: # This class is like Chi2Regression but takes into account dx # this part defines the variables the class will use ...
import socket HOST, PORT = "localhost", 9999 msg = b'\x16\x04\x04\x01\xfd 94193A04010020B8' s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.bind(("localhost", 33000)) s.sendto(msg, (HOST, PORT))
from ..model_tests_utils import ( status_codes, DELETE, PUT, POST, GET, ERROR, random_model_dict, check_status_code, compare_data ) from core.models import ( Inventory, Actor, Status ) inventory_test_data = {} inventory_tests = [ ##----TEST 0----## # creates 6 actors # ...
from utils import utils day = 18 tD = """ 2 * 3 + (4 * 5) 5 + (8 * 3 + 9 + 3 * 4 * 3) 5 * 9 * (7 * 3 * 3 + 9 * 3 + (8 + 6 * 4)) ((2 + 4 * 9) * (6 + 9 * 8 + 6) + 6) + 2 + 4 * 2 """ tA1 = 26 + 437 + 12240 + 13632 tA2 = 46 + 1445 + 669060 + 23340 class Calculator: def __init__(self, pattern): self.pattern ...
# Definition for singly-linked list. class ListNode(object): def __init__(self, x): self.val = x self.next = None # 核心思路 # 这题是 add_two_numbers_II_q445.py 的特例版本,做法更简单 # 另,这题没说不能修改原链表,所以可以先reverse,变成低位在前 # 处理之后再 reverse 回去 class Solution(object): def plusOne(self, head): """ :type...
# Copyright (C) 2015-2021 Regents of the University of California # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
#! /bin/false import weblogic import javax.xml import java.io.FileInputStream as fis import java.io.FileOutputStream as fos import os import shutil import java.io.BufferedReader as BR import java.lang.System.in as Sin import java.io.InputStreamReader as isr import java.lang.System.out.print as jprint import weblogi...
from niaaml.classifiers.classifier import Classifier from niaaml.utilities import MinMax from niaaml.utilities import ParameterDefinition from sklearn.tree import DecisionTreeClassifier as DTC import numpy as np import warnings from sklearn.exceptions import ChangedBehaviorWarning, ConvergenceWarning, DataConversionWa...
#!/usr/bin/python # # Script implementing the multiplicative rules from the following # article: # # J.-L. Durrieu, G. Richard, B. David and C. Fevotte # Source/Filter Model for Unsupervised Main Melody # Extraction From Polyphonic Audio Signals # IEEE Transactions on Audio, Speech and Language Processing # Vol. 18, ...
import sys import os import torch from helen.modules.python.TextColor import TextColor from helen.modules.python.models.predict_cpu import predict_cpu from helen.modules.python.models.predict_gpu import predict_gpu from helen.modules.python.FileManager import FileManager from os.path import isfile, join from os import ...
from dpconverge.data_set import DataSet import numpy as np n_features = 2 points_per_feature = 100 centers = [[2, 2], [4, 4]] ds = DataSet(parameter_count=2) n_samples = 500 outer_circ_x = 1.0 + np.cos(np.linspace(0, np.pi, n_samples)) / 2 outer_circ_y = 0.5 + np.sin(np.linspace(0, np.pi, n_samples)) X = np.vstack...
# Generated by Django 3.1.1 on 2020-09-16 15:33 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('erp', '0091_auto_20200914_1720'), ('erp', '0091_auto_20200914_1638'), ] operations = [ ]
"""Montrer dans le widget Revision ID: 8b4768bb1336 Revises: dc85620e95c3 Create Date: 2021-04-12 17:24:31.906506 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '8b4768bb1336' down_revision = 'dc85620e95c3' branch_labels = None depends_on = None def upgrade(...
def helper(s, k, maxstr, ctr): # print("YES") if k == 0 or ctr == len(s): return n = len(s) maxx = s[ctr] for i in range(ctr+1, n): if int(maxx) < int(s[i]): maxx = s[i] if maxx != s[ctr]: k -= 1 for j in range(n-1, ctr, -1): if int(...
# # -*- coding: utf-8 -*- # import scrapy # # import re # # class A55Spider(scrapy.Spider): # name = '55' # allowed_domains = ['fsx.sxxz.gov.cn'] # start_urls = ['http://fsx.sxxz.gov.cn/fsxzw/zwgk/xxgkzn/'] # # def parse(self, response): # navi_list = response.xpath('//ul[@class="item-nav"]//@hr...
# Pop() -> Remove um elemento do endereço especifícado. lista_4 = [10,9,8,7,5,6,4,2,3,1,2,3] print(lista_4) lista_4.pop(2) print(lista_4) lista_4.pop(-1) print(lista_4)
from typing import List, Union import numpy as np def get_test_function_method_min(n: int, a: List[List[float]], c: List[List[float]], p: List[List[float]], b: List[float]): """ Функция-замыкание, генерирует и возвращает тестовую функцию, применяя метод Фельдбаума, т. е....
from typing import cast, Mapping, Any, List, Tuple from .models import PortExpenses, Port def parse_port_expenses(json: Mapping[str, Any]) -> PortExpenses: return PortExpenses( cast(int, json.get("PortId")), cast(int, json.get("PortCanal")), cast(int, json.get("Towage")), ...
from typing import Callable from rx import operators as ops from rx.core import Observable, pipe from rx.core.typing import Predicate def _all(predicate: Predicate) -> Callable[[Observable], Observable]: filtering = ops.filter(lambda v: not predicate(v)) mapping = ops.map(lambda b: not b) some = ops.som...
import uuid from datetime import datetime from os import path from sqlalchemy.orm.scoping import scoped_session import factory import factory.fuzzy from app.extensions import db from tests.status_code_gen import * from app.api.applications.models.application import Application from app.api.document_manager.models.doc...
import tensorflow as tf from tensorflow.keras.models import Model from tensorflow.keras.layers import Conv2D, BatchNormalization, ReLU class Decoder(Model): def __init__(self, channels): super().__init__() self.conv1 = Conv2D(channels[0], 3, padding='SAME', use_bias=False) self.bn1 = Batch...
import os from typing import List, Tuple from urllib.request import urlopen from discord.ext import commands from blurpo.func import database, send_embed, wrap def basename(path: str) -> Tuple[str, str]: # Get file's basename from url # eg. https://website.com/index.html -> (index.html, index) return (b...
#!/usr/bin/env python # Copyright (C) 2017 Udacity Inc. # # This file is part of Robotic Arm: Pick and Place project for Udacity # Robotics nano-degree program # # All Rights Reserved. # Author: Harsh Pandya # import modules import rospy import tf from kuka_arm.srv import * from trajectory_msgs.msg import JointTraje...
import codecs import os from hacktools import common import constants import game def run(data, copybin=False, analyze=False): infile = data + "extract/arm9.bin" outfile = data + "repack/arm9.bin" fontdata = data + "font_data.bin" dictionarydata = data + "dictionary.asm" binfile = data + "bin_inpu...
import time import random currentBot = 1 from threadly import Threadly def worker(**kwargs): botID = kwargs["botID"] resultsQ = kwargs["resultsQ"] time.sleep(random.randint(1,15)) resultsQ.put({"botID":botID, "time":time.time()}) def workerKwargs(): global currentBot tosend = {"botID":"bot {}...
""" Searching for optimal parameters. """ from section1_video5_data import get_data from sklearn import model_selection from xgboost import XGBClassifier seed=123 # Load prepared data X, Y = get_data('../data/video1_diabetes.csv') # Build our single model c = XGBClassifier(random_state=seed) #n_trees = range(500, 1...
import numpy as np from pytest import mark from numpy.testing import assert_allclose @mark.plots def test_transition_map(init_plots): axes_data = init_plots.plot_transition_map(cagr=False, full_frontier=False).lines[0].get_data() values = np.genfromtxt('data/test_transition_map.csv', delimiter=',') assert...
import time from membase.api.rest_client import RestConnection, Bucket from membase.helper.rebalance_helper import RebalanceHelper from memcached.helper.data_helper import MemcachedClientHelper from basetestcase import BaseTestCase from mc_bin_client import MemcachedError from couchbase_helper.documentgenerator import ...
# -*- coding: utf-8 -*- { 'name': "Odoo Cogito Move Mutual", 'summary': "", 'author': "CogitoWEB", 'description': "Odoo Cogito move mutual", # Categories can be used to filter modules in modules listing # Check https://github.com/odoo/odoo/blob/master/openerp/addons/base/module/module_data.xml # for the full l...
# Generated by Django 2.0.3 on 2018-04-13 22:35 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('catalog', '0006_auto_201...
import numpy as np from gym.spaces import Box, Dict, Discrete from database_env.foop import DataBaseEnv_FOOP from database_env.query_encoding import DataBaseEnv_QueryEncoding class DataBaseEnv_FOOP_QueryEncoding(DataBaseEnv_FOOP, DataBaseEnv_QueryEncoding): """ Database environment with states and actions as...
def intercala(nomeA, nomeB, nomeS): fileA = open(nomeA, 'rt') fileB = open(nomeB, 'rt') fileS = open(nomeS, 'wt') nA = int(fileA.readline()) nB = int(fileB.readline()) while def main(): nomeA = input('Nome do primeiro arquivo: ') nomeB = input('Nome do segundo arquivo: ') nomeS = input('Nome para o arquiv...
import RPi.GPIO as GPIO import time class Motion: def __init__(self, ui, pin, timeout=30): self._ui = ui self._pin = int(pin) self._timeout = int(timeout) self._last_motion = time.time() GPIO.setmode(GPIO.BCM) # choose BCM or BOARD GPIO.setup(self._pin, GPIO.IN) ...
# # PySNMP MIB module H3C-DOMAIN-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/H3C-DOMAIN-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:08:30 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2...
import sys import numpy as np from matplotlib import pyplot as plt from tensorflow import keras from tensorflow.keras import layers def preprocess(array: np.array): """ Normalizes the supplied array and reshapes it into the appropriate format """ array = array.astype("float32")/255.0 array = np.reshape(ar...
import math from time import sleep from timeit import default_timer as timer LMS8001_C1_STEP=1.2e-12 LMS8001_C2_STEP=10.0e-12 LMS8001_C3_STEP=1.2e-12 LMS8001_C2_FIX=150.0e-12 LMS8001_C3_FIX=5.0e-12 LMS8001_R2_0=24.6e3 LMS8001_R3_0=14.9e3 class PLL_METHODS(object): def __init__(self, chip, fRef): self...
# Generated by Django 2.1.14 on 2019-12-02 11:19 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('djautotask', '0030_task_phase'), ('djautotask', '0028_task_secondary_resources'), ] operations = [ ]
# -*- coding: utf-8 -*- import dataiku from dataiku.customrecipe import * import pandas as pd import networkx as nx from networkx.algorithms import bipartite # Read recipe config input_name = get_input_names_for_role('Input Dataset')[0] output_name = get_output_names_for_role('Output Dataset')[0] needs_eig = get_re...
import json import gmplot import os import random import collections # FIX FOR MISSING MARKERS # 1. Open gmplot.py in Lib/site-packages/gmplot # 2. Replace line 29 (self.coloricon.....) with the following two lines: # self.coloricon = os.path.join(os.path.dirname(__file__), 'markers/%s.png') # self.col...
import pytest from cx_const import Number, StepperDir from cx_core.stepper import MinMax, Stepper, StepperOutput class FakeStepper(Stepper): def __init__(self) -> None: super().__init__(MinMax(0, 1), 1) def step(self, value: Number, direction: str) -> StepperOutput: return StepperOutput(next_...
# Generated by Django 2.1.5 on 2019-01-25 19:11 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0008_shoppingcart'), ] operations = [ migrations.AddField( model_name='shoppingcart', name='total_price'...
import numpy as np def Adam_Opt(X_0, function, gradient_function, learning_rate=0.001, beta_1=0.9, beta_2=0.999, epsilon=1e-8, max_iter=500, disp=False, tolerance=1e-5, store_steps=False): """ To be passed into Scipy Minimize method https://docs.scipy.org/doc/scipy/reference/generated/scipy....
from __future__ import absolute_import from rest_framework.response import Response from sentry import options from sentry.api.bases.project import ProjectEndpoint from sentry.models import ProjectKey class ProjectDocsEndpoint(ProjectEndpoint): def get(self, request, project): data = options.get('sentry...
import tensorflow as tf from groupy.gconv.make_gconv_indices import make_c4_z2_indices, make_c4_p4_indices,\ make_d4_z2_indices, make_d4_p4m_indices, flatten_indices from groupy.gconv.tensorflow_gconv.transform_filter import transform_filter_2d_nchw, transform_filter_2d_nhwc def gconv2d(input, filter, strides, ...
# Generated by Django 2.0.9 on 2019-12-05 20:27 import datetime from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import utc class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( ...
class SeedsNotFound(Exception): pass class ZoneNotFound(Exception): pass class TooManyZones(Exception): pass
""" @author: acfromspace """ """ Notes: Find the most common word from a paragraph that can't be a banned word. """ from collections import Counter class Solution: def most_common_word(self, paragraph: str, banned: [str]) -> str: unbanned = [] for character in "!?',;.": paragraph =...
import itertools import os import random import pytest from polyswarmd.utils.bloom import BloomFilter @pytest.fixture def log_entries(): def _mk_address(): return os.urandom(20) def _mk_topic(): return os.urandom(32) return [(_mk_address(), [_mk_topic() fo...
# -*- coding: utf-8 -*- """Unit test package for fv3config."""
from SimPy.SimulationRT import Simulation, Process, hold import numpy as np import scipy as sp import scipy.io as spio import networkx as nx import matplotlib.pyplot as plt import ConfigParser from pylayers.util.project import * import pylayers.util.pyutil as pyu from pylayers.network.network import Network, Node, PNe...
# Import libraries from bs4 import BeautifulSoup import requests import psycopg2 import dateutil.parser as p from colorama import Fore, Back, Style # Insert the results to the database def insert_datatable(numberOfLinks, selected_ticker, filtered_links_with_dates, conn, cur): if filtered_links_with_dates: ...
import random import torch.nn as nn import torch.nn.functional as F from torch import LongTensor from torch import from_numpy, ones, zeros from torch.utils import data from . import modified_linear PATH_TO_SAVE_WEIGHTS = 'saved_weights/' def get_layer_dims(dataname): res_ = [1,2,2,4] if dataname in ['dsads'] els...
from core.advbase import * def module(): return Pia class Pia(Adv): conf = {} conf['slots.a'] = [ 'Dragon_and_Tamer', 'Flash_of_Genius', 'Astounding_Trick', 'The_Plaguebringer', 'Dueling_Dancers' ] conf['slots.d'] = 'Vayu' conf['acl'] = """ `dragon(c3-s-end), not en...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Benjamin Vial # License: MIT """ The :mod:`pytheas.homogenization.twoscale2D` module implements tools for the two scale convergence homogenization of 2D metamaterials for TM polarization """ from .femmodel import TwoScale2D
import os.path as osp import numpy as np import numpy.linalg as LA import random import open3d as o3 import torch import common3Dfunc as c3D from asm_pcd import asm from ASM_Net import pointnet """ Path setter """ def set_paths( dataset_root, category ): paths = {} paths["trainset_path"] = osp.join(...
import gym import gym_maze import copy #env = gym.make("maze-random-10x10-plus-v0") #env = gym.make("maze-sample-100x100-v0") #env = gym.make("maze-random-30x30-plus-v0") env_name= "maze-sample-10x10-v0" env = gym.make(env_name) state_size = env.observation_space.shape[0] action_size = env.action_space.n max_steps = e...
# program that asks user for number and prompts user to guess number untill the user guess the right number # helen o'shea # 20210211 import random number = random.randint(0,100) guess = int(input("Please guess the number between 0 and 100: ")) attempt = 1 while guess!=number: if guess<number: attempt +=1 ...
# -*- coding: utf-8 -*- """ Script to retrieve regobs data relevant for forecast analysis at NVE. """ __author__ = 'kmu' import datetime as dt import pandas as pd from varsomdata import getobservations as go def get_snow_obs(from_date, to_date): all_data_snow = go.get_all_observations(from_date, to_date, geohaza...
def f(*a<caret>rgs): """ """
#!/usr/bin/python # This creates the level1 fsf's and the script to run the feats on condor import os import glob studydir ='/mnt/40TB-raid6/Experiments/FCTM_S/FCTM_S_Data/Analyses' fsfdir="%s/group/lvl2_B_hab_feats_v1"%(studydir) subdirs=glob.glob("%s/1[0-9][0-9][0-9][0-9]"%(studydir)) #subdirs=glob.glob("%s/1830...
import tempfile import mdtraj import pandas as pd from kmbio import PDB from kmtools import sequence_tools, structure_tools from .distances_and_orientations import ( construct_residue_df, construct_residue_pairs_df, residue_df_to_row, residue_pairs_df_to_row, validate_residue_df, validate_resi...
# -*- coding: UTF-8 -*- # Copyright (c) 2010 - 2014, Pascal Volk # See COPYING for distribution information. """ vmm.password ~~~~~~~~~~~~~~~~~~~~~~~~~~~ vmm's password module to generate password hashes from passwords or random passwords. This module provides following functions: hashed_p...
from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User from django.contrib.auth.forms import UserChangeForm, UserCreationForm from django.utils.translation import gettext as _ from .models import * class MyUserCreationForm(UserCreationForm): d...
from memoria import * class Filas(): def __init__(self, dic_process_id): self.filas = [[],[],[],[]] self.dic_process_id = dic_process_id self.memoria = Memoria() self.ultimo_executado = None self.qtd_processos = len(dic_process_id) # qtd de processos. se...
def assert_keys_exist(obj, keys): assert set(keys) <= set(obj.keys())
#!/usr/bin/env python3 import requests from datetime import datetime, timedelta import time import numpy as np import pandas as pd import psycopg2 from psycopg2.extras import execute_values import config as cfg def connect_to_rds(): conn = psycopg2.connect( host=cfg.HOST, database=cfg.DATABASE, ...
import numpy as np import matplotlib.pyplot as plt import matplotlib.cm as cm from itertools import product, count from matplotlib.colors import LinearSegmentedColormap # it produce more vectors pointing diagonally than vectors pointing along # an axis # # generate uniform unit vectors # def generate_unit_vectors(n)...
from aiogram import Dispatcher from bulletin_board_bot.misc.user_data import UserDataStorage from bulletin_board_bot.dependencies import DIContainer from bulletin_board_bot.middlewares.di import DIContainerMiddleware from bulletin_board_bot.middlewares.userdata import UserDataMiddleware def setup_middlewares(dp: Dis...
from django.contrib import admin from core.models import Profile, BraFitting, Suggestion, Resource # Register your models here. @admin.register(BraFitting) class BraFittingAdmin(admin.ModelAdmin): pass @admin.register(Profile) class ProfileAdmin(admin.ModelAdmin): pass @admin.register(Suggestion) class Sugge...
"""Tests for _get_tablename_schema_names association schemas function.""" import pytest from open_alchemy.schemas import association class TestGetTablenameSchemaNames: """Tests for _get_tablename_schema_names.""" # pylint: disable=protected-access TESTS = [ pytest.param({}, set(), {}, id="empt...
from django.template import Library from ..classes import Menu, SourceColumn register = Library() def _navigation_resolve_menu(context, name, source=None, sort_results=None): result = [] menu = Menu.get(name) link_groups = menu.resolve( context=context, source=source, sort_results=sort_results ...
from esipy.client import EsiClient from waitlist.utility.swagger.eve import get_esi_client from waitlist.utility.swagger import get_api from waitlist.utility.swagger.eve.universe.responses import ResolveIdsResponse,\ CategoriesResponse, CategoryResponse, GroupResponse, GroupsResponse,\ TypesResponse, TypeRespon...
titulo = str(input('qual o titulo: ')) autor = str(input('escritor: ')) comando = ['/give @p written_book{pages:[', "'", '"','] ,title:', ',author:', '}', titulo, autor] #estrutura do comando l = str(input('cole aqui: ')) #livro em si. tl = len(l) #total de caracteres do livro print(tl) qcn = (tl/256) #quantidade...
r""" Super Partitions AUTHORS: - Mike Zabrocki A super partition of size `n` and fermionic sector `m` is a pair consisting of a strict partition of some integer `r` of length `m` (that may end in a `0`) and an integer partition of `n - r`. This module provides tools for manipulating super partitions. Super partiti...
from ..job.job_context import JobContext from ..task.task_context import TaskContext from ..tc.tc_context import TcContext class VerticalContext: def __init__(self, sys_conf_dict, task_context: TaskContext = None, job_context: JobContext = None, ...
import numpy as np import random import heapq from itertools import count def time_fun(x, slope, shift): return 1/(1+np.exp((slope*x - shift))) class eligibility_trace(): def __init__(self, lambda_v, r, slope=3, shift=5): self.E = 0 self.lambda_v = lambda_v self.r = r self.sl...
''' true_env = ["../../../../../../Downloads/data_timeoutsAndtransitions_acrobot/acrobot/online_learning/esarsa/step50k/gridsearch_realenv/"] k1_notimeout = ["../../../../../../Downloads/data_timeoutsAndtransitions_acrobot/acrobot/offline_learning/knn-ensemble/k1_notimeout/esarsa/step10k/optimalfixed_eps0/"] k1_timeout...
# Copyright 2021 Universidade da Coruña # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
""" Code for the paper "Mesh Classification with Dilated Mesh Convolutions." published in 2021 IEEE International Conference on Image Processing. Code Author: Vinit Veerendraveer Singh. Copyright (c) VIMS Lab and its affiliates. We adapt MeshNet to perform dilated convolutions by replacing the Stacked Dilated Mesh Conv...
from collections import namedtuple import hexbytes from eth_utils import is_checksum_address from relay.signing import eth_sign, eth_validate, keccak256 EcSignature = namedtuple("EcSignature", "v r s") class Order(object): def __init__( self, exchange_address: str, maker_address: str, ...