content
stringlengths
5
1.05M
# -*- coding: utf-8 -*- ''' Support for htpasswd command. Requires the apache2-utils package for Debian-based distros. .. versionadded:: 2014.1.0 The functions here will load inside the webutil module. This allows other functions that don't use htpasswd to use the webutil module name. ''' from __future__ import absol...
""" sac2asdf_hinet.py: convert the sac files downloaded from hinetpy to the asdf format. """ from ...tasks.asdf.sac2asdf_hinet import sac2asdf_hinet class Sac2Asdf(): def __init__(self, sac_directory, cmt_path, output_path): super().__init__() self.sac_directory = sac_directory self.cmt_pa...
from lumicks.pylake.detail.utilities import first import pytest def test_first(): assert(first((1, 2, 3), condition=lambda x: x % 2 == 0) == 2) assert(first(range(3, 100)) == 3) with pytest.raises(StopIteration): first((1, 2, 3), condition=lambda x: x % 5 == 0) with pytest.raises(StopIteratio...
# Copyright 2017 Google Inc. 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 applicable law or ag...
"""Logging.""" import logging import sys from colorlog import ColoredFormatter import bmbf from bmbf import config SETUP = False FORMAT = ('%(cyan)s%(asctime)s ' '%(log_color)s%(levelname)-8s ' '%(green)s%(threadName)s ' '%(cyan)s%(name)s ' '%(white)s%(message)s%(reset)s') D...
from crawler_api.crawlers import COURTS, TJALCrawler, TJMSCrawler def test_crawlers_map(): expected = { '02': TJALCrawler, '12': TJMSCrawler } assert COURTS == expected
from django.apps import AppConfig class DraftsConfig(AppConfig): name = 'drafts'
import logging import sys __all__ = "logger" logger = logging.getLogger("bunnybook") logger.setLevel(logging.INFO) handler = logging.StreamHandler(sys.stdout) formatter = logging.Formatter( "%(levelname)s: %(asctime)s (file: %(filename)s, line: %(lineno)d, func: %(funcName)s) - %(message)s") handler.setFormatter...
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
# -*- coding: utf-8 -*- """ Sphinx test suite utilities ~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. This is a slightly modified version of Sphinx' built-in tests.util module. It's duplicated here because t...
import importlib import importlib.machinery import decimal import io import sys from tokenize import tokenize, untokenize, NUMBER, STRING, NAME, OP def _call_with_frames_removed(f, *args, **kwargs): return f(*args, **kwargs) class FloatLiteral(float): def __new__(cls, *args): obj = super().__new__(cls...
from io import StringIO from numpy import array #from pyNastran.bdf.field_writer_8 import print_card_8 #from pyNastran.bdf.field_writer_16 import print_card_16 #from pyNastran.bdf.bdf_interface.assign_type import (integer, from pyNastran.dev.bdf_vectorized.cards.elements.property import Property class PCOMPG(Propert...
from skype_log import Skypper my_log = Skypper() print(my_log.get_skype_path()) print(my_log.get_skype_user()) print(my_log.get_skype_database_path()) my_log2 = Skypper(skype_user="no_one") #print(my_log2.get_skype_user())
import unicodedata, unittest from pathlib import Path from coldtype.geometry import Rect from coldtype.helpers import glyph_to_uni from coldtype.pens.datpen import DATPen, DATPens from coldtype.text.composer import StSt, Font, Style, Slug, Graf, SegmentedString tf = Path(__file__).parent co = Font.Cacheable("assets/Co...
def insertionSort(arr): for i in range(1,len(arr)): currentVal = arr[i] position = i while position > 0 and arr[position-1] > currentVal: arr[position] = arr[position-1] position = position - 1 arr[p...
import re,time from pymongo import MongoClient # calling custom methods from amazon import * client = MongoClient('127.0.0.1',27017) db = client['amazon'] col = db['record'] def dbinsert(data): devdata = data # print('Data to be inserted') name = data[0] pc = data[1] ram = data[2] rom = data[3...
""" We copy some functions from the Python 3.3.0 ssl module. http://hg.python.org/releasing/3.3.0/file/1465cbbc8f64/Lib/ssl.py """ import re class CertificateError(ValueError): pass def _dnsname_to_pat(dn): pats = [] for frag in dn.split(r'.'): if frag == '*': # When '*' is a frag...
# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory # # 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 ...
# -*- coding: utf-8 -*- """ Created on Sat Sep 25 13:16:15 2021 @author: gerry """ #lager en tom liste liste = list() #Lager en liste med oppgitte elementer, er tallene 1, 2, 3, 4, 5 liste2 = [1, 2, 3, 4, 5] #Skriver ut lengden på lista print(len(liste2)) #legger til et element i listen liste.append(4) liste.app...
## @ingroup Analyses-Mission-Segments-Conditions # Conditions.py # # Created: # Modified: Feb 2016, A. Wendorff # Jun 2017, E. Botero # Jan 2020, M. Clarke # Oct 2021, E. Botero # ---------------------------------------------------------------------- # Imports # -----------------------...
import os import pytest from tests.utils import (get_login_session, get_session) from pyfortune.exception import (LoginRequireException) class TestFetchApplyDetail(): def test_success_apply_detail(self): s = get_login_session() a_list = s.fetch_apply_list() detail_list ...
import sys import os from contextlib import contextmanager import traceback from .builderbase import BuilderBase from ..lang.exceptions import ( Q1StateError, Q1Exception, Q1InternalError, Q1SequenceError, Q1TimingError ) from ..lang.sequence import Sequence from ..lang.loops import Loo...
import torch from torch.utils.data import Dataset import os import json from random import randint from torch import nn from torch.nn import functional as F import pandas as pd import numpy as np def make_dataset(directory, class_to_idx): instances = [] directory = os.path.expanduser(directory) for target...
import pyglet from perlin_noise import PerlinNoise from pyglet.gl import glClear, GL_COLOR_BUFFER_BIT, glLoadIdentity, glBegin, GL_TRIANGLES, glVertex2f, glEnd # Not using these lines yet display = pyglet.canvas.Display() screen = display.get_default_screen() # Resizeable window = pyglet.window.Window(resizable=True)...
import random from PIL import Image, ImageDraw image = Image.open("roof.jpg") draw = ImageDraw.Draw(image) width = image.size[0] height = image.size[1] pix = image.load() green = [0 for i in range(256)] red = [0 for i in range(256)] blue = [0 for i in range(256)] brightness = [0 for i in range(256)] for x in range...
#! ./venv/bin/python import sys import pandas as pd import json from time import sleep import datetime import dateutil.parser import pytz import requests as re from selenium import webdriver from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.common.by import By from selenium.webdriv...
# config import sys import time import os import numpy as np import torch from config import config from net.RES_FPN.FPN import FPN import net.networks as networks from eval.Estimator_fast import Estimator from options.train_options import TrainOptions from Dataset.DatasetConstructor_fast import TrainDatasetConstructor...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Scs(MakefilePackage): """A C package that solves convex cone problems via operator splitt...
import downloadImage path = './training/tellurion' urls = 'link/地球仪.txt' # images = [path + '/pos-1', path + '/neg-1'] images = path + '/neg-1' size = (150, 150) # url = open(path + urls).readline() # urllib.request.urlretrieve(url, path + images + '/1.jpg') ''''' print(os.getcwd()) print(os.path.join(os.getcwd(), ...
# $Id$ # This file is included simply to make this directory a python package.
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Caps(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "isosurface" _path_str = "isosurface.caps" _valid_props = {"x", "y", "z"} # x # - ...
import datetime import logging # TODO - Validate query arguments logger = logging.getLogger(__name__) def format_date(date): if isinstance(date, datetime.date): return date.strftime('%d-%b-%Y') return date def build_search_query(**kwargs): # Parse keyword arguments unread = kwargs.get('unr...
__source__ = 'https://leetcode.com/problems/move-zeroes/' # https://github.com/kamyu104/LeetCode/blob/master/Python/move-zeroes.py # Time: O(n) # Space: O(1) # # Description: Leetcode # 283. Move Zeroes # # Given an array nums, write a function to move all 0's # to the end of it while maintaining the relative order # ...
from pynytimes import NYTAPI # Make sure to turn parse dates on so that the dates # are parsed into datetime.datetime or datetime.date objects nyt = NYTAPI("API Key", parse_dates=True) # Get the most viewed articles of today most_viewed = nyt.most_viewed() # Optionally you can also define the time period of the most...
from .method_descriptor_base import MethodDescriptor from .method_descriptor_factories import MethodDescriptorFactories
''' @author: Brecht Laperre @description: dtw-measure algorithm ''' import sys import numpy as np sys.path.append('.') from src.dtw.dtw_m_e import eff_dtw_measure def _compute_cost(D): D[0, :] = np.cumsum(D[0, :]) D[:, 0] = np.cumsum(D[:, 0]) for i in range(1, D.shape[0]): new_min = np.min(D[i-...
import argparse import json import logging import os import pathlib import sys import time import typing from urllib import parse import coloredlogs import requests from requests import adapters, exceptions import urllib3 from . import version LOGGER = logging.getLogger(__name__) LOGGING_FORMAT = '[%(asctime)-15s] %...
# -*- coding: utf-8 -*- from __future__ import absolute_import from tests.helper import BaseTest, timestamp_utcnow class ItemTest(BaseTest): def update_item_test(self): 'should correctly build an activity feed' self.assertEqual(self.a.redis.exists(self.a.feed_key('david')), False) self.a....
"""update_viw_activeoipcreviews Revision ID: b98bd07cd6e8 Revises: b25c9f49e1f1 Create Date: 2022-03-17 13:11:46.632925 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'b98bd07cd6e8' down_revision = 'b25c9f49e1f1' branch_labels = None depends_on = None def up...
""" The roseguarden project Copyright (C) 2018-2020 Marcus Drobisch, This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This pr...
#!/usr/bin/env python3 import logging import atexit import sys import sh from . import defaults class OSRM(): """ Base class wrapper around all the osrm-* binaries. All functions accept additional **kwargs to be passed upon execution. This class is used in the background and need not be initialized d...
#! /usr/bin/env python import os def main(): if os.path.exists(".dockerignore"): print(".dockerignore already exists, remove it to proceed") exit(-1) with open(".gitignore", "r") as fin, open(".dockerignore", "w") as fout: fout.write("# This file was automatically generated by ./ci/boot...
# -*- coding: utf-8 -*- """The module with the Instagram analyzing class.""" from app.backend.analyzing.substring_match.find_similarity_ratio import find_similarity_ratio class InstagramAnalyze: """The class to analyze scraped Instagram profiles by their nickname and biography.""" def __init__(self, scraping...
import copy import random import copy # Consider using the modules imported above. class Hat: def __init__(self, **kwargs): self.contents = [] for key, value in kwargs.items(): self.contents.extend([key] * value) def draw(self, num): balls = self.contents if len(self.contents) < num: return balls ...
""" Definitions related to message data specification. :copyright: Copyright since 2006 by Oliver Schoenborn, all rights reserved. :license: BSD, see LICENSE_BSD_Simple.txt for details. """ from .listener import getArgs as getListenerArgs from .validatedefnargs import MessageDataSpecError from .topicargspecimpl imp...
import numpy as np from gym import spaces from robosuite.wrappers.gym_wrapper import GymWrapper class GymWrapper(GymWrapper): """ Initializes the Gym wrapper. Mimics many of the required functionalities of the Wrapper class found in the gym.core module Args: env (MujocoEnv): The environment to...
#coding=utf8 import math import torch import torch.nn as nn import dgl.function as fn from model.model_utils import Registrable, FFN from model.encoder.functions import * @Registrable.register('hansql') class HANSQL(nn.Module): def __init__(self, args): super(HANSQL, self).__init__() self.num_laye...
import ROOT import json import sys source_data = json.load(open(sys.argv[1])) root_file = sys.argv[2] f = ROOT.TFile(root_file, 'RECREATE') for cname, channel_def in source_data['channels'].iteritems(): print('CH', cname) binning = channel_def['binning'] bindata = channel_def['bindata'] data = ROOT...
# # ARCADIA Mocks # # Copyright (C) 2017 SINTEF Digital # All rights reserved. # # This software may be modified and distributed under the terms # of the MIT license. See the LICENSE file for details. # from unittest import TestCase from arcadiamock.servicegraphs import * from arcadiamock.adapters import XMLPrinter...
#T!/usr/bin/env python # # Looks up historical weather data in Dark Sky # # Copyright (c) 2019 DevicePilot Ltd. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, includin...
# -*- coding:utf-8 -*- import os import numpy as np import tensorflow as tf os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # # 말뭉치 # corpus = """나는 책을 샀다 나는 책을 본다 나는 책을 팔았다 너는 책을 샀다 너는 책을 본다 너는 책을 팔았다 나는 책을 서점에서 샀다 나는 책을 도서관에서 본다 나는 책을 책방에 팔았다 너는 책을 도서관에서 본다 너는 책을 도서관에서 본다 너는 책을 서점에서 샀다""" # # Vocabulary # # unique wor...
import numpy as np import time import torch import torch.nn as nn import torch.autograd import h5py import torch.optim as optim import scipy.io from torch.autograd import Variable import torch.optim as optim from enum import Enum from HeatEquation.Dataset.Baseline import HeatEquationDataset from Schrodinger.Schrodinge...
from typing import ByteString import pytest @pytest.fixture(scope="class", params=["B1", "B2"]) def two(request): print("\n SETUP", request.param) yield request.param # print "\n UNDO", request.param @pytest.fixture(scope="class", params=["A1", "A2"]) def one(request): print("\n SETUP", request.par...
from flask import Flask, Blueprint from flask_migrate import Migrate import os import sys import configparser import importlib application = Flask(__name__) basedir = os.path.abspath(os.path.dirname(__file__)) appenv = os.environ.get('APP_ENV') config = configparser.ConfigParser() config.read('app/db-config.ini') ...
# Copyright (c) 2009-2018 The Regents of the University of Michigan # This file is part of the HOOMD-blue project, released under the BSD 3-Clause License. # Maintainer: mphoward R""" MPCD streaming methods An MPCD streaming method is required to update the particle positions over time. It is meant to be used in con...
import torch import torchvision import torch.nn.functional as F import torch.nn as nn import numpy as np class DFRParamRegressor(nn.Module): def __init__(self, config): super(DFRParamRegressor, self).__init__() input_size = 18*512 # W+ dims from StyleGAN(2) output_size =...
from fastapi import APIRouter from api.v1.Items import items as items_router routes = APIRouter() routes.include_router(items_router)
import stddraw class Body(object): # 建立一个新的星球, # vector r 用于表示位置 # vector v 用于表示速度 # float mass 表示其质量 def __init__(self, r, v, mass): self._r = r self._v = v self._mass = mass def Move(self, f, dt): a = f.scale(1 / self._mass) self._v = self._v + a.s...
import unittest from python_datastructures import CircularList class Test_Queue(unittest.TestCase): def setUp(self): self.circularList = CircularList() def test_isEmpty(self): self.assertEqual(self.circularList.isEmpty(), True) self.circularList.add(3) self.assertEqual(self.ci...
from binder import SqliteConnection from binder import PostgresConnection from binder import MysqlConnection import os # SQLite _bindertest_dir = os.path.dirname( __file__ ) DBFILE = os.path.join(_bindertest_dir, "test.db3") def connect_sqlite(read_only=None): return SqliteConnection(DBFILE, read_only) # Postgr...
from enum import IntEnum from typing import Any, Dict, List, Optional, Tuple, Union import numpy as np from sklearn.model_selection import ( KFold, ShuffleSplit, StratifiedKFold, StratifiedShuffleSplit, TimeSeriesSplit, train_test_split ) from typing_extensions import Protocol # Use callbac...
from polylogyx.models import DistributedQuery, DistributedQueryTask, db import datetime as dt def add_distributed_query(sql, description): return DistributedQuery.create(sql=sql,description=description) def create_distributed_task_obj(node, query): return DistributedQueryTask(node=node, distributed_query=quer...
# Copyright (c) 2021 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 # # Unle...
import pytest from typing import ( TYPE_CHECKING, Dict, ) from eth_typing import ( ChecksumAddress, HexStr, ) from eth_utils import ( add_0x_prefix, ) from web3._utils.formatters import ( hex_to_integer, ) from web3.types import ( BlockData, EnodeURI, ParityFilterParams, Parity...
from django.db import models from django.contrib.auth.models import AbstractUser from apps.adverts.models import Advert from django.conf import settings from django.db.models.signals import post_save from django.dispatch import receiver from rest_framework.authtoken.models import Token class CustomUser(AbstractUser):...
import copy import numpy as np import pytest import torch import torch.optim as optim from pytest_mock import MockFixture from torchvision import transforms from src.libs.dataset import get_dataloader from src.libs.helper import do_one_iteration, evaluate, train from src.libs.loss_fn import get_criterion from src.lib...
spend = 60 print(f"一年大约有:{spend * spend * 24 * 365}秒")
""" On top of the :py:class:`ActorCritic` implementation, this module provides a couple algorithms to solve a problem stated in terms of Reinforcement Learning. All algorithms follow the same approach, namely (action dependent) Heuristic Dynamic Programming. The baseline algorithm is implemented in :py:class:`ADHDP`. ...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from rest_framework import viewsets, permissions from .models import User, Message from .serializers import UserSerializer, MessageSerializer class UserViewSet(viewsets.ModelViewSet): """ API endpoint that allows ClientInfo to be viewed or edite...
# import signals and slugify from django.db.models import signals from django.template.defaultfilters import slugify # function for use in pre_save def yourmodel_pre_save(signal, instance, sender, **kwargs): if not instance.slug: slug = slugify(instance.attribute) # change the attibute to the field that ...
from . import main from flask import render_template, url_for, jsonify import random from .. import poem_generator from config import APP_ROOT import os import ujson with open(os.path.join(APP_ROOT, 'balladmonger/printingpress/out/ngram_chain.json'), 'r') as r: reader = r.read() chain = ujson.loads(reader)...
from dataclasses import dataclass, field from typing import Dict, List, Optional from transformers import DataCollator from transformers.data.processors.utils import InputFeatures from transformers.data.data_collator import default_data_collator from IPython import embed from tqdm import tqdm from abc import * impor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Wrapper around openpyxl Developed by Coin-AI, 2017-2018 Contact: banca """ from openpyxl import load_workbook def getwb(filename): return load_workbook(filename) def get_cell(wb,wsname,address): ws = wb[wsname] return ws[address] ...
from unittest import TestCase from KeyboardMap import KeyboardMap import pyrubberband as prb import numpy as np from scipy.io.wavfile import write, read class TestMap(TestCase): def setUp(self): self.keymap = KeyboardMap(69, None, 44100) class TestInit(TestMap): def test_startNote_initializes_properly...
"""Runs program with default parameters.""" from k_means.core.app import run from k_means.resources.input import default_message from tests.unit.resources.test_input import test_default_message if __name__ == "__main__": if test_default_message(): run(default_message)
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('proyectos', '0013_auto_20150422_1724'), ] operations = [ migrations.AddField( model_name='tarea', na...
#TODO: Modular url grabbing so this can be paired with a cron that puts things into argv import discord from urllib.request import Request, urlopen from bs4 import BeautifulSoup as beausu import ssl ctx = ssl.create_default_context() ctx.check_hostname = False ctx.verify_mode = ssl.CERT_NONE f = open("token", "r") ...
from __future__ import division import numpy as np class ConvUnit(): def __init__(self): self.type ='CONV' self.no = -1 self.in_size = [0, 0, 0] #width, height, channel_size self.output_size = [0, 0, 0] #width, height, channel_size self.kernel_size = [0, 0] ...
import numpy as np import cv2 import glob import matplotlib.pyplot as plt import matplotlib.image as mpimg import os import pickle #%matplotlib qt # CALIBRATION def CameraCalibrate(calDataPath): # prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0) objp = np.zeros((6*9,3), np.float32) objp[:...
import socket import threading def recvall(sock, BUFF_SIZE = 2048): data = b"" while True: part = sock.recv(BUFF_SIZE) data += part if len(part) < BUFF_SIZE: break return data class Client: def __init__(self, host, port): self...
from app import cfg from app import db from app import util from flask import Blueprint from flask import render_template bp_index = Blueprint('index', __name__) @bp_index.route("/") def page_index(): return render_template("home.html")
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Provides test cases for copying a WavRead object. """ import copy import itertools import unittest import wavfile class TestWavReadCopy(unittest.TestCase): filename = "test-file-1.wav" def test_basic_copy(self): with wavfile.open(self.filename) as ...
from .search import search_apmex from .search import search_gainesvillecoins from .search import search_goldeneaglecoins # from .search import search_jmbullion from .search import search_provident from .search import search_shinybars from .search import search_silvertowne
# -*- coding: utf-8 -*- from tespy.networks import Network from tespy.components import Sink, Source, SolarCollector from tespy.connections import Connection from tespy.tools import document_model import numpy as np from matplotlib import pyplot as plt import pandas as pd from mpl_toolkits.mplot3d import Axes3D # %% ...
import requests from bs4 import BeautifulSoup print("Enter an e-mail address:") email = input() request = requests.get("https://cleantalk.org/email-checker/"+email) content = request.content soup = BeautifulSoup(content, "html.parser") object = soup.find("span", {"text-warning"}) if object is None: print(emai...
# -*- coding: utf-8 -*- """ Given a spectrum, precision, and list of reporters, get reporter intensity values """ def quantify_reporters(idx, scan, spectrum, precision, reporters, digits): """ :param idx: file index, for reporting only :param scan: scan number of the spectrum, for reporting only :p...
# Generated by Django 2.2.13 on 2020-07-14 15:31 import django.contrib.postgres.fields.jsonb from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('exportplan', '0010_auto_20200714_1431'), ] operations = [ migrations.RemoveField( model_nam...
import os import sys import shutil import getpass from enum import Enum from collections import deque from PySide2 import QtCore, QtWidgets, QtGui from dcc.userinterface import qproxywindow, iconutils from dcc.perforce import clientutils, cmds, isConnected import logging logging.basicConfig() log = logging.getLogger...
# -*- coding: utf-8 -*- from flask import Blueprint, render_template, url_for, redirect account_app = Blueprint('account', __name__, url_prefix='/account', template_folder='templates') @account_app.route('/signin', methods=['GET', 'POST']) def signin(): return render_template('account/si...
from pavilion.module_actions import ModuleLoad, ModuleSwap, ModuleRemove from yapsy import IPlugin import logging import re LOGGER = logging.getLogger('pav.{}'.format(__name__)) class ModuleWrapperError(RuntimeError): pass _WRAPPED_MODULES = {} def __reset(): global _WRAPPED_MODULES _WRAPPED_MODULES...
import asyncio async def test_list_accessories(pairing): accessories = await pairing.list_accessories_and_characteristics() assert accessories[0]["aid"] == 1 assert accessories[0]["services"][0]["iid"] == 1 char = accessories[0]["services"][0]["characteristics"][0] print(char) assert char["de...
import pandas as pd import numpy as np import logging import os import geojson import math import itertools import geopandas as gpd from geopy.geocoders import Nominatim from shapely.geometry import Point, Polygon, MultiPolygon, shape import shapely.ops from pyproj import Proj from bs4 import BeautifulSoup import ...
# Generated by Django 3.1.2 on 2020-10-29 22:18 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('registration', '0003_auto_20201028_1647'), ('game', '0006_auto_20201029_1018'), ] operations = [ mi...
from ..factory import Type class topChatCategoryInlineBots(Type): pass
import pygame from random import * pygame.init() Pixel = 30 win = pygame.display.set_mode((32*Pixel, 16*Pixel)) X = 3 * Pixel Y = 16 * Pixel - Pixel vel_x = 10 vel_y = 10 jump = False BLACK = (0, 0, 0) WHITE = (255, 255, 255) ORANGE = (252, 168, 79) RED = (150, 0, 0) GREEN = (0, 50, 0) speed = 0.4 ...
#encoding=utf-8 """ Created on 17:22 2017/5/1 @author: Jindong Wang """
#import's necessários from .base import on_connect_db """ - Observação: O Arquivo __init__.py vai ser meio que uma importação 'global' de todo os modulos e configuração da pasta DATABASE E suas Conexões. """
# ___________________________________________________________________________ # # Prescient # Copyright 2020 National Technology & Engineering Solutions of Sandia, LLC # (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. # This software is ...
# coding=utf-8 # Copyright 2021 The Uncertainty Baselines Authors. # # 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 ap...
import numpy as np import numpy.linalg as LA from scipy.special import digamma import pandas as pd from sklearn.cluster import KMeans from utils import get_ind_function, normalize, cumsum_ex, beta, most_accuring_terms from scipy.special import logsumexp import random random.seed( 30 ) def initialize_categorical_parame...