id
stringlengths
3
8
content
stringlengths
100
981k
436056
import tensorflow as tf import numpy as np import time from tqdm import tqdm from sklearn.model_selection import train_test_split from scipy.stats import kendalltau from contextual_decomposition import ContextualDecompositionExplainerTF from gradients import GradientExplainerTF from neural_interaction_detection impor...
436078
class Solution: def maxArea(self, height): left, right, mx = 0, len(height) - 1, 0 while left < right: mx = max(mx, (right - left) * min(height[left], height[right])) if height[left] < height[right]: left += 1 else: right -= 1 ...
436086
from django.apps import AppConfig class NewsHunterConfig(AppConfig): name = 'apps.news_hunter'
436106
import dash import dash_core_components as dcc import dash_html_components as html import pandas as pd from sqlalchemy import create_engine # Create a simple database engine = create_engine('sqlite:///sample.db') df = pd.DataFrame({ 'a': [1, 2, 3, 4, 5, 6], 'b': ['x', 'y', 'x', 'x', 'z', 'y'] }) df.to_sql('da...
436115
import math from PIL import Image import torch.nn.functional as F import torch def unpadding(image, padding): b, c, h ,w = image.shape image = image[...,padding:h-padding, padding:w-padding] return image def preprocess(image:Image, padding=32, patch_size=1024, transform=None, cuda=True, square=False): ...
436130
import rmc.shared.constants as c import rmc.models as m import rmc.data.evals.conversion as conv import mongoengine as me import sys def import_all_critiques(eng_file): m.CritiqueCourse.objects._collection.drop() conv.import_engineering_critiques(eng_file) if __name__ == '__main__': if (len(sys.argv) < ...
436152
expected_output = { "interfaces": { "Ethernet1/1": { "interface": "Ethernet1/1", "statistics": { "txreq": 0, "rxlogoff": 0, "txtotal": 3, "txreqid": 0, "lastrxsrcmac": "00:00:00:ff:00:00", ...
436164
from setuptools import setup, find_packages setup( name = "appJar", version = "0.93", packages = find_packages() )
436185
import os import re WIKI_PATH = "../../../agk-steam-plugin.wiki/" error_count = 0 """ Page Tag Information: @page The rest of the line is the page name/Steam class for the file. Additional lines are for the page description. Method Tag Information @desc The method description. Can be multiple lines...
436186
from flask import Flask, Response, stream_with_context, render_template, json, url_for from kafka import KafkaConsumer from settings import * # create the flask object app app = Flask(__name__) def stream_template(template_name, **context): print('template name =',template_name) app.update_template_context(c...
436247
import pandas as pd class ssoisPrecovery(): """ This class is designed to use the Solar System Object Image Search (SSOIS) website provided by CADC and accessible at this website: https://www.cadc-ccda.hia-iha.nrc-cnrc.gc.ca/en/ssois/index.html. When using this we should make sure to include...
436281
from rasa.engine.graph import GraphComponent from rasa.engine.recipes.default_recipe import DefaultV1Recipe @DefaultV1Recipe.register( component_types=[DefaultV1Recipe.ComponentType.INTENT_CLASSIFIER], is_trainable=True, model_from="SpacyNLP", ) class MyComponent(GraphComponent): ...
436287
from .time import Timer def train_kfold(model, x_train, y_train, x_test=None, folds=5, metrics=None, predict_type='predict_proba', stratify=None, random_state=1337, skip_checks=False): """Trains a set of sklearn models with chosen parameters on a KFold split dataset, returning full out-of-fold training set pre...
436327
from dataclasses import dataclass from collections import OrderedDict from typing import Dict from typing import List from typing import Iterable @dataclass class Benchmark: name: str values: Dict[str, float] is_nuisance: bool = False is_reference: bool = False @classmethod def from_params(c...
436338
from django.contrib.auth.models import User def get_user(username='testuser', password='<PASSWORD>', email='testuser@<EMAIL>'): user = User.objects.get_or_create(username=username)[0] user.set_password(password) user.email = email user.is_active = True user.save() return user
436357
import time from tkinter import * from tkinter import messagebox # Creating the Tk window root = Tk() # Setting geometry of tk window root.geometry("300x250") # Using title() to display a message in the dialogue box of the message in the title bar. root.title("Timer") # Declaration of variables hour=StringVar() min...
436378
import gtk import gtk.glade import sys sys.path.append("../../pyjs/") # lkcl: quick hack from pyjs import * def clicked(widget=None): code = buf1.get_text(*buf1.get_bounds()) output = cStringIO.StringIO() mod = compiler.parse(code) module = name.get_text() t = Translator(module,mod,output) buf2.set_text(...
436430
from cvtron.modeling.segmentor.ImageSegmentor import ImageSegmentor from cvtron.trainers.segmentor.deeplab_trainer import DeepLabTrainer from cvtron.utils.config_loader import MODEL_ZOO_PATH config = { 'batch_norm_epsilon':1e-5, 'batch_norm_decay':0.9997, 'number_of_classes':21, 'l2_regularizer':0.0001...
436468
from django.db import models from wagtail.core.fields import StreamField from wagtail.core.blocks import StructBlock, PageChooserBlock, TextBlock, ListBlock from wagtail.admin.edit_handlers import FieldPanel, InlinePanel, StreamFieldPanel from wagtail.snippets.edit_handlers import SnippetChooserPanel from wagtail.imag...
436483
from enum import IntEnum, unique import itertools from color import Color32, remap_color from utils import integer_to_bytes @unique class SpecialColor(IntEnum): None_ = 0 Face = 1 # Uses the color of the face (based on a rainbow) ColorWheel = 2 # Uses how hot the die is (based on how much its bei...
436515
import sys import csv from search import search_string, description res = [] def cloze_word(sentense, word, level="1"): return sentense.lower().replace(word, "{{c"+level+"::"+word+"}}") with open(sys.argv[1], 'r') as f: contents = f.read() items = contents.split("\n\n") for item in items: li...
436518
from crypto.identity.public_key import PublicKey def test_private_key_from_passphrase(identity): public_key = PublicKey.from_passphrase(identity['passphrase']) assert public_key == identity['data']['public_key'] def test_private_key_from_hex(identity): public_key = PublicKey.from_hex(identity['data']['p...
436526
from pymop.factory import get_problem, get_uniform_weights # for some problems the pareto front does not need any parameters pf = get_problem("tnk").pareto_front() pf = get_problem("osy").pareto_front() # for other problems the number of non-dominated points can be defined pf = get_problem("zdt1").pareto_front(n_pare...
436530
import sys guards = [] for i, line in enumerate(sys.stdin): if line.startswith("guard_"): guards.append((i, line)) elif line.startswith("# bridge out of Guard"): guardTag = line.split()[5] for lineNo, guard in guards: if guardTag in guard: print "Guard", gua...
436531
import os baseLoc = os.path.dirname(os.path.realpath(__file__)) + '/' from gimpfu import * import sys sys.path.extend([baseLoc + 'gimpenv/lib/python2.7', baseLoc + 'gimpenv/lib/python2.7/site-packages', baseLoc + 'gimpenv/lib/python2.7/site-packages/setuptools', baseLoc + 'MiDaS']) from run import ...
436533
import locale # Convert a number for human consumption # # Divisor can be 1, 1000, 1024 # # If the locale has been set before this # function is called, then numbers appropriate to the # locale will be retured. This is commonly done like: # locale.setlocale(locale.LC_ALL,'') # # A divisor of 1 => the thousands sep...
436560
FILE_TYPE_OPTIONS = {} USAGE_RIGHT_OPTIONS = {} ASPECT_RATIO_OPTIONS = {'tall': 't', 'square': 's', 'wide': 'w', 'panoramic': 'xw'} IMAGE_SIZE_OPTIONS = {'any': '', 'icon': 'i', 'medium': 'm', 'large': 'l', 'exactly': 'ex', '400x300+': 'qsvga', '640x480+': 'vga', ...
436631
import responses import json from .helpers import mock_file, ClientTestCase class TestRefundRequestOrder(ClientTestCase): def setUp(self): super(TestRefundRequestOrder, self).setUp() self.base_url = '{}/v2/refunds/'.format(self.base_url) @responses.activate def test_refund_request_order...
436665
from . import (augmenters, chroma, classify, data, experiment, features, targets, test)
436676
from abc import abstractmethod from ast import literal_eval from collections import namedtuple import contextlib import csv import logging import urllib2 from StringIO import StringIO from fabric.operations import sudo, put, run from cgcloud.core.box import fabric_task from cgcloud.core.init_box import UpstartBox, Sy...
436686
import pytest from tests.functional.ucare_cli.helpers import arg_namespace from pyuploadcare.ucare_cli.commands.delete_files import delete_files def test_delete_parse_wait_arg(): args = arg_namespace("delete --wait 6c5e9526-b0fe-4739-8975-72e8d5ee6342") assert args.wait def test_delete_wait_is_true_by_defa...
436715
from autograder.box_extractor import box_extraction from autograder.character_predictor import predict from autograder.spelling_corrector import fix_spellings from autograder.text_similarity import check_similarity, get_marks from fastapi import FastAPI, File, Form, HTTPException, UploadFile from typing import List im...
436722
import numpy as np import theano from foxhound.transforms import SeqPadded from foxhound.utils import shuffle, iter_data from foxhound.theano_utils import floatX, intX from foxhound.rng import py_rng, np_rng class Linear(object): """ size is the number of examples per minibatch shuffle controls whether or...
436733
from openbiolink.edgeType import EdgeType from openbiolink.graph_creation.metadata_infile.infileMetadata import InfileMetadata from openbiolink.graph_creation.types.infileType import InfileType from openbiolink.namespace import * from openbiolink.nodeType import NodeType class InMetaEdgeTnHpoDis(InfileMetadata): ...
436750
from conans import ConanFile from conans import tools from conans.model.version import Version class CESDKConan(ConanFile): name = "cesdk" settings = "os", "compiler", "arch" description = "Develop 3D applications using the procedural geometry engine of Esri CityEngine." url = "https://github.com/Esri/...
436764
import logging import math import os from pathlib import Path import pandas as pd from PIL import Image from kale.loaddata.videos import VideoFrameDataset, VideoRecord class BasicVideoDataset(VideoFrameDataset): """ Dataset for GTEA, ADL and KITCHEN. Args: root_path (string): The root path in w...
436773
import info from Package.AutoToolsPackageBase import AutoToolsPackageBase class subinfo(info.infoclass): def registerOptions(self): self.parent.package.categoryInfo.platforms = CraftCore.compiler.Platforms.NotMacOS def setTargets(self): """ """ for ver in ['0.2.1', '0.2.6', '0.2.7', '...
436838
import numpy as np import unittest as ut from qfast.pauli import get_norder_paulis class TestGetNorderPaulis ( ut.TestCase ): def in_array( self, needle, haystack ): for elem in haystack: if np.allclose( elem, needle ): return True return False def test_g...
436841
import argparse import json import os import requests from PIL import Image from PIL.ImageDraw import ImageDraw if __name__ == "__main__": parser = argparse.ArgumentParser(description='Performs detection over input image given a trained detector.') parser.add_argument('--input_image', type=str, default='IMSLP...
436844
from torch.optim import Adam from torch import tensor, arange, stack from torch.nn import Module, Linear from torch.nn.functional import softmax, elu from torch.distributions import Categorical from algris import normalize import visdom class Agent(Module): def __init__(self): super(Agent, self).__init_...
436857
import os from django.conf import settings from django.core.wsgi import get_wsgi_application __author__ = "<NAME>" __copyright__ = "Copyright 2019, Helium Edu" __version__ = "1.4.38" os.environ.setdefault("DJANGO_SETTINGS_MODULE", "conf.settings") application = get_wsgi_application() # Only start the monitor if we...
436866
import six from cqparts.params import Parameter, ParametricObject # Types of things... not parts on their own, but utilised in many from .solidtypes import fastener_heads from .solidtypes import screw_drives from .solidtypes import threads # --------- Custom Parameter types --------- class FastenerComponentParam(Pa...
436867
from ckstyle.cmdconsole.ConsoleClass import console def doCombine(name, props): pluginName = camelCase(name) + 'Combiner' pluginClass = NullCombiner try: plugin = __import__('ckstyle.plugins.combiners.' + pluginName, fromlist = [pluginName]) if hasattr(plugin, pluginName): plugi...
436870
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import __version__ = "1.1.3" __url__ = "https://github.com/hysds/hysds" __description__ = "HySDS (Hybrid Cloud Science Data System)"
436872
import base64 from typing import List, Optional from electrum_gui.common.basic.functional.require import require from electrum_gui.common.basic.functional.text import force_text from electrum_gui.common.basic.request.exceptions import RequestException, ResponseException from electrum_gui.common.basic.request.restful i...
436915
import contextlib import os import sys from pathlib import Path @contextlib.contextmanager def working_directory(path: Path): """Change working directory and returns to previous on exit.""" prev_cwd = Path.cwd() os.chdir(str(path)) sys.path.insert(0, str(path)) try: yield finally: ...
436923
import re from ..identifier import Identifier ISSN_RE = re.compile('issn\s?=?\s?([0-9]{4}\-[0-9]{3}([0-9]|X))', re.I) def extract(text): for match in ISSN_RE.finditer(text): yield Identifier( 'issn', match.group(1).replace('-', '').replace(' ', '').strip() )
436945
import sqlite3 import json import os import uuid def get_random_db_path(): return f"/tmp/.{uuid.uuid4()}.db" def dict_factory(cursor, row): d = {} for idx, col in enumerate(cursor.description): d[col[0]] = row[idx] return d class SQLHandler(object): def __init__(self, hide_attributes=T...
437013
import json import re import os import math from samflow.command import ShellCommand, PythonCommand from samflow.workflow import attach_back from pkg_resources import resource_filename from chilin2.modules.config.helpers import JinjaTemplateCommand, template_dump, json_load, json_dump def tex_motif(workflow, conf): ...
437014
from mle_monitor import MLEProtocol, MLEResource, MLEDashboard def test_dashboard(): # Test data collection and layout generation resource = MLEResource(resource_name="local") protocol = MLEProtocol(protocol_fname="mle_protocol.db") dashboard = MLEDashboard(protocol, resource) dashboard.snapshot()...
437045
from __future__ import absolute_import from __future__ import print_function import socket import getpass import sys from cProfile import Profile from pstats import Stats from tempfile import NamedTemporaryFile from functools import wraps from datetime import datetime def profile(hostname=None, to_stdout=False): ...
437067
from django.db import models from django.utils.text import slugify from accounts.models import ServiceProvider from library.models import BaseModel from django.utils.translation import ugettext_lazy as _ from address.models import ServiceAddress, Area import uuid class Service(BaseModel): RESTAURANT = 0 CAFE...
437097
from collections import defaultdict from boto.mturk.connection import MTurkConnection from boto.mturk.price import Price from boto.mturk.connection import MTurkRequestError __author__ = 'anushabala' from argparse import ArgumentParser import csv from datetime import datetime import numpy as np import matplotlib.pyplot...
437105
import os import tensorflow as tf import logging logger = logging.getLogger('hyper_fcn') class TuneReporter(tf.keras.callbacks.Callback): """Tune Callback for Keras.""" def __init__(self, reporter=None, freq="epoch", logs=None): """Initializer. Args: freq (str): Sets the frequen...
437136
from datetime import date as dt import pandas as pd import requests import bandl.common #default periods DEFAULT_DAYS = 250 def is_ind_index(symbol): is_it = symbol in bandl.common.IND_INDICES return is_it def get_formated_date(date=None,format=None,dayfirst=False): """string date to format date "...
437144
from .stop_words import STOP_WORDS from ...language import Language, BaseDefaults class SlovenianDefaults(BaseDefaults): stop_words = STOP_WORDS class Slovenian(Language): lang = "sl" Defaults = SlovenianDefaults __all__ = ["Slovenian"]
437156
import time from time import sleep import client from logic import epoch_logic, validator_logic, shard_logic import config VALIDATOR_LENGTHS = [] MAX_VALIDATOR_LENGTHS = 20 def get_validators_and_bid_if_necessary(bidding_enabled=False): debug_json = {} my_validator = validator_logic.get_my_validator() i...
437190
from panda3d.core import PNMImage, Filename, TextNode from direct.gui.DirectGui import DirectFrame, DGG, DirectButton, DirectLabel, DirectSlider, DirectEntry, DirectScrolledFrame from direct.showbase.ShowBase import ShowBase from direct.showbase.DirectObject import DirectObject from typing import Tuple, Union, Callabl...
437250
import torch import utils ####-----------------------------#### ####----model evaluation----#### ####-----------------------------#### def validate(model, dataset, batch_size=32, test_size=1024, verbose=True, allowed_classes=None, with_exemplars=False, task=None): '''Evaluate precision (= accuracy...
437256
from Properties import VaporPressure, Props from units import conv_unit from utils import f2str from PySide2 import QtCore, QtWidgets, QtGui from compounds import FluidState def tablewidget_vap_liq_reports( pliq: Props, pvap: Props, pvp: VaporPressure, state: FluidState = FluidState.Unknown, isMi...
437282
import tensorflow as tf import math class EmbeddingLayer(tf.keras.layers.Layer): def __init__(self, vocab_size, embedding_size, initializer=None, stddev=0.01, mean=0.0): super(EmbeddingLayer, self).__init__() self.vocab_size = vocab_size self.embedding_size = embedding_size self.s...
437321
import os import re import socket import subprocess from typing import List # noqa: F401 from libqtile import layout, bar, widget, hook from libqtile.config import Click, Drag, Group, Key, Match, Screen, Rule from libqtile.command import lazy from libqtile.widget import Spacer import arcobattery #mod4 or mod = super ...
437451
from pydantic import BaseModel, validator from tracardi.domain.named_entity import NamedEntity class Content(BaseModel): content: str type: str @validator("type") def validate_type(cls, value): if value not in ("text/plain", "text/html"): raise ValueError("Message content type mus...
437475
import bagua.torch_api as bagua import torch import torch.optim as optim import unittest import os from tests.internal.common_utils import find_free_port from tests import skip_if_cuda_available, skip_if_cuda_not_available import logging logging.getLogger().setLevel(logging.INFO) def construct_model_and_optimizer(o...
437480
import unittest from asq.queryables import Queryable from asq.test.test_queryable import TracingGenerator, infinite __author__ = "<NAME>" class TestTakeWhile(unittest.TestCase): def test_take_while(self): a = ['a', 'b', 'c', 'd', 'e', 'f', 'g'] b = Queryable(a).take_while(lambda x: x < 'e').to_l...
437524
import os import tensorflow as tf from badgr.file_manager import FileManager from badgr.datasets.tfrecord_rebalance_dataset import TfrecordRebalanceDataset from badgr.jackal.envs.jackal_env_specs import JackalPositionCollisionEnvSpec from badgr.jackal.models.jackal_position_model import JackalPositionModel from badgr....
437525
import logging import os.path as op from functools import partial from itertools import chain import sublime import sublime_plugin import flower from . import manager from .utils import rootSplit, getBinaryFolder from .compilerutils import getCompiler, COMPILER_KEY from .process import Executor, Callback, Default fro...
437558
import inspect from functools import wraps def doublewrap(f): ''' a decorator decorator, allowing the decorator to be used as: @decorator(with, arguments, and=kwds) or @decorator ''' @wraps(f) def new_dec(*args, **kwds): if len(args) == 1 and len(kwds) == 0 and callable(args[0]...
437633
from setuptools import setup from pipenv.project import Project from pipenv.utils import convert_deps_to_pip def get_packages_from_Pipfile(): pipfile = Project(chdir=False).parsed_pipfile return convert_deps_to_pip(pipfile['packages'], r=False) setup(install_requires=get_packages_from_Pipfile())
437658
import os from collections import defaultdict, Counter from pathlib import Path import csv from NewsSentiment.fxlogger import get_logger from NewsSentiment.diskdict import DiskDict EMOTION2INDEX = { "anger": 0, "anticipation": 1, "disgust": 2, "fear": 3, "joy": 4, "negative": 5, "positive"...
437688
from __future__ import annotations import typing from ctc import binary from ctc import rpc from ctc import spec from ctc.toolbox import backend_utils from .event_backends import filesystem_events from .event_backends import node_events from .. import block_utils from .. import abi_utils def is_event_hash(data: sp...
437692
class Solution: def minEatingSpeed(self, piles: List[int], h: int) -> int: def isok(k): count = 0 for p in piles: count += (p - 1) // k + 1 return count <= h l = 1 r = max(piles) while l < r: mid = (l + r)//2 ...
437787
import pytest import capnpy from capnpy.testing.compiler.support import CompilerTest class TestConst(CompilerTest): def test_global_const(self): schema = """ @0xbf5147cbbecf40c1; const bar :UInt16 = 42; const baz :Text = "baz"; """ mod = self.compile(schema) ...
437809
from .linear_regression import ( LinearRegressionGD, LassoRegressionGD, RidgeRegressionGD, ElasticNetRegressionGD, PolynomialRegressionGD, )
437814
from dependency_injector import containers, providers from server import db_dir from tarkov.quests.repositories import QuestsRepository class QuestsContainer(containers.DeclarativeContainer): repository: providers.Provider[QuestsRepository] = providers.Singleton( QuestsRepository, quests_path=db_dir.join...
437874
import FWCore.ParameterSet.Config as cms gmttree = cms.EDAnalyzer("L1MuGMTTree", GeneratorInputTag = cms.InputTag("none"), SimulationInputTag = cms.InputTag("none"), GTInputTag = cms.InputTag("none"), GTEvmInputTag = cms.InputTag("none"), GMTInputTag = cms.InputTag("l1GmtEmulDigis"), PhysVal =...
437956
import os import cv2 import json import math import numpy as np import torch import torch.utils.data as data import pycocotools.coco as coco from pycocotools.cocoeval import COCOeval from utils.image import get_border, get_affine_transform, affine_transform, color_aug from utils.image import draw_umich_gaussian, gaus...
437976
import serial import time import datetime import math import numpy as np #import math import matplotlib.pyplot as plt class Embo(object): TIMEOUT_CMD = 0.1 TIMEOUT_READ = 2.0 VM_MAX_LEN = 200 READY_STR = "Ready" NOT_READY_STR = "Not ready" def __init__(self): if __name__ == '__main__...
437992
import numpy as np import random A=np.array(([2, 4, 0, 0], [3, 5, 1, 0], [0, 6, 2, 0], [5, 7, 0, 1], [6, 8, 4, 2], [0, 9, 5, 3], [8, 0, 0, 4], [9, 0, 7, 5], [0, 0, 8, 6])) def Nbr(n, k): return A.T[n-1, k-1] L=3 N=L**2 sigma=[random.choice([-1, 1]) for i in range(N)] ##sig...
437999
set_name(0x8007D77C, "GetTpY__FUs", SN_NOWARN) set_name(0x8007D798, "GetTpX__FUs", SN_NOWARN) set_name(0x8007D7A4, "Remove96__Fv", SN_NOWARN) set_name(0x8007D7DC, "AppMain", SN_NOWARN) set_name(0x8007D884, "MAIN_RestartGameTask__Fv", SN_NOWARN) set_name(0x8007D8B0, "GameTask__FP4TASK", SN_NOWARN) set_name(0x8007D948, "...
438043
from typing import AnyStr from bunq.sdk.http.api_client import ApiClient from bunq.sdk.model.generated.endpoint import AttachmentPublicContent, AttachmentPublic from tests.bunq_test import BunqSdkTestCase class TestAttachmentPublic(BunqSdkTestCase): """ Tests: AttachmentPublic AttachmentPubli...
438053
import argparse import os import zipfile from base64 import b64decode from io import BytesIO, TextIOWrapper, StringIO from os.path import join, dirname, abspath from datetime import datetime, timedelta, timezone from zeep import Client from zeep.wsse.username import UsernameToken import psycopg2 as pg url = { 'pr...
438068
import json from confidant.app import create_app from confidant.services import certificatemanager def test_get_certificate(mocker): app = create_app() mocker.patch('confidant.settings.USE_AUTH', False) mocker.patch( 'confidant.authnz.get_logged_in_user', return_value='badservice', )...
438070
import django if django.VERSION >= (3, 1, 0): from django.urls import re_path as url, include else: from django.conf.urls import url, include from .views import home urlpatterns = [url(r"^$", home), url(r"^captcha/", include("captcha.urls"))]
438127
from networkx.linalg.attrmatrix import * from networkx.linalg import attrmatrix from networkx.linalg.spectrum import * from networkx.linalg import spectrum from networkx.linalg.graphmatrix import * from networkx.linalg import graphmatrix from networkx.linalg.laplacianmatrix import * from networkx.linalg import laplacia...
438156
from copy import deepcopy from sqlite3 import Connection from os.path import join, realpath from warnings import warn import shapely.wkb from shapely.ops import unary_union from shapely.geometry import Polygon from aequilibrae.project.field_editor import FieldEditor from aequilibrae.project.table_loader import TableLoa...
438157
import datetime import numpy as np import pandas as pd from scipy import stats from collections import Counter from tqdm import tqdm tqdm.pandas(desc="progress") #================================================================================ #Don't change the code below!!! 以下代码请勿轻易改动。 #==========================...
438171
from leaguepedia_parser.parsers.game_parser import ( get_regions, get_tournaments, get_games, get_game_details, ) from leaguepedia_parser.parsers.team_parser import ( get_team_logo, get_long_team_name_from_trigram, get_team_thumbnail, get_all_team_assets )
438188
from bitcoin.pyspecials import * from bitcoin.main import * from bitcoin.deterministic import * from bitcoin.bci import * from bitcoin.transaction import * from bitcoin.composite import * import re, hmac, hashlib try: from strxor import strxor as sxor except ImportError: sxor = lambda a,b: ''.join([chr(ord(a) ...
438248
from typing import Any, Optional from django.db.models import QuerySet from rest_framework.exceptions import NotFound from rest_framework.request import Request from rest_framework.response import Response from app.views import AuthenticatedAPIView from notion.api.serializers import NotionPageSerializer from notion.a...
438251
import unittest from ocr_numbers import ( convert, ) # Tests adapted from `problem-specifications//canonical-data.json` class OcrNumbersTest(unittest.TestCase): def test_recognizes_0(self): self.assertEqual(convert([" _ ", "| |", "|_|", " "]), "0") def test_recognizes_1(self): self.as...
438260
from django.core.cache import cache from airmozilla.starred.models import StarredEvent def stars(request): context = {} if request.user.is_active: context['star_ids'] = _get_star_ids(request.user) return context def _get_star_ids(user): cache_key = 'star_ids%s' % user.id as_string = cac...
438322
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from pathos.pools import ProcessPool from scipy import interpolate from scipy.integrate import solve_ivp from scipy.special import legendre import config from ADR_solver import solve_ADR fro...
438376
from tests.base_unittest import BaseUnitTest from mock import Mock from mock import patch from pypokerengine.engine.player import Player from pypokerengine.engine.seats import Seats from pypokerengine.engine.table import Table from pypokerengine.engine.card import Card from pypokerengine.engine.message_builder import M...
438377
import random from pprint import pformat import disnake from disnake import Localized from disnake.enums import Locale from disnake.ext import commands class Localizations(commands.Cog): def __init__(self, bot): self.bot: commands.Bot = bot @commands.slash_command() async def localized_command( ...
438380
from config_base import ConfigurationBase class ExtractKeywordsConfig(ConfigurationBase): def __init__(self, config_file): ConfigurationBase.__init__(self, config_file) self.processed_documents_folder = self.__getfilepath__("DEFAULT", "processed_documents_folder") self.file_mask ...
438383
from django.test import TestCase from django.template import Context, Template from django.template.loader import get_template from taggit_templatetags.tests.models import AlphaModel, BetaModel from taggit.tests.tests import BaseTaggingTest from taggit_templatetags.templatetags.taggit_extras import get_weight_fun cl...
438384
import magma as m from mantle import * from loam.boards.papilioone import PapilioOne from loam.shields.megawing import MegaWing megawing = MegaWing(PapilioOne) megawing.Clock.on() megawing.Switch.on(4) megawing.LED.on(8) main = megawing.main() mux16test = Mux(16, 8) A8 = Out(Bits(8)) muxinputs = [ A8(0,0,0...
438441
from unittest import TestCase from mock import Mock, MagicMock from alarmdecoder import AlarmDecoder from alarmdecoder.panels import ADEMCO from alarmdecoder.messages import Message, ExpanderMessage from alarmdecoder.zonetracking import Zonetracker, Zone class TestZonetracking(TestCase): def setUp(self): ...
438470
from re import match from consolemenu.validators.base import BaseValidator class RegexValidator(BaseValidator): def __init__(self, pattern): super(RegexValidator, self).__init__() self.__pattern = pattern @property def pattern(self): return self.__pattern def validate(self,...