content
stringlengths
5
1.05M
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # 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 ...
import os tg_token = os.environ['TG_TOKEN'] lastfm_api_key = os.environ['LASTFM_API_KEY'] lastfm_secret_key = os.environ['LASTFM_SECRET_KEY'] db = {"user": os.environ['DB_USER'], "password": os.environ['DB_PASS'], "address": os.environ['DB_ADDRESS'], "port": os.environ['DB_PORT'], "db_name": ...
from flask import Flask from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_bcrypt import Bcrypt from flask_login import LoginManager # from flask_bootstrap import Bootstrap from config import app_config db = SQLAlchemy() migrate = Migrate() bcrypt = Bcrypt() login_manager = LoginMa...
import os def options(): ops = ["op1: Normal", "op2: Repair"] showops = input(ops) if showops == "op1": os.system("python3 Op1.py") elif showops == "op2": os.system("python3 Op2.py") else: print("Oops! Try Again") options()
"""A collection of examples for CARLAEnvironment""" import pygame from tensorforce import Agent from tensorforce.environments import CARLAEnvironment def training_example(num_episodes: int, max_episode_timesteps: int): # Instantiate the environment (run the CARLA simulator before doing this!) env = CARLAEnv...
#!/usr/bin/python # pickle,使用该模块你可以将任意对象存储在文件中, # 之后又可以将其完整的取出来。 # 这被称为持久地存储对象 import pickle shoplistfile = 'shoplist.data' shoplist = ['apple', 'mango', 'carrot'] print(shoplist) # write to the file f = open(shoplistfile, 'wb') pickle.dump(shoplist, f) # dump the object to a file f.close() del shoplist # de...
# Licensed under an MIT open source license - see LICENSE import os from astropy.table import Table import numpy as np import matplotlib.pyplot as p import sys import matplotlib.cm as cm from matplotlib import rc # rc("font", **{"family": "sans-serif", "size": 16}) # rc("text", usetex=True) from scipy.stats import sco...
# Copyright (c) 2009 - 2015 Tropo, now part of Cisco # Released under the MIT license. See the file LICENSE # for the complete license # -------------------------------------------- # python app that says a random number between 1 and 100 # -------------------------------------------- from random import * # The argu...
import gmpy2 n = 273969943463309776500846837112464474192340886489639620594695419610130465377217321037260895579925113999932297622867844590870497578006894633261502206403024138463860142671605606712630071193343873226584683873586035325957412907461529801004732296070497215793066306148072656696225488714492775344904259067873077...
import numpy as np import matplotlib.pyplot as plt from astropy.cosmology import FlatLambdaCDM #import pysynphot as S from abspecphot import abspecphot cosmo = FlatLambdaCDM(H0=73, Om0=0.3) # testing #vega_wave,vega_flux = np.loadtxt('spectra/vega.dat',dtype=float,usecols=(0,1),unpack=True) #vega_u=abspecphot(vega_wa...
import enum class State(enum.Enum): HEALTHY = "Healthy" INFECTED = "Infected" RISKY = "Risky" EXPOSED = "Exposed"
# pylint:disable=missing-module-docstring,missing-class-docstring,missing-function-docstring from .base import compare_template, SimpleTestCase class DatePickerHtmlTest(SimpleTestCase): maxDiff = None def test_basic_short(self): template = """ {% load carbondesign %} {% DatePicker form.started_at_empt...
from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls from ryu.lib.packet.ether_types import ETH_TYPE_IP from ryu.ofproto import ofproto_v1_3 from ryu.lib.packet import packet, ether_types...
from .abstract import make_design def make_ascii(tiling): return "\n".join(gen_ascii(tiling)) def gen_ascii(tiling): faces, vlines, hlines, nodes = make_design(tiling) for i in range(0, len(vlines)): node_chars = ["+" if node else " " for node in nodes[i]] h_chars = ["-" if h else " " fo...
from flask import Flask, request, redirect from datetime import datetime import os from google.cloud import datastore app = Flask(__name__) dataclient = datastore.Client() def addVisitor(): ent = dataclient.key('data','visitors') total = dataclient.get(key=ent) if total: total['total'] += 1 dataclient.put(total)...
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' #============================================================================= # # FileName: flask_util_js.py # Desc: provide flask_util.js # 在 app.config 中可以配置: # FLASK_UTIL_JS_PATH: flask_util.js 的url路径 # ...
# -*- coding: utf-8 -*- # # This file is part of the RefTelState project # # # """ RefTelState Ref (Reference Element) device of Type TelState """ # PyTango imports import PyTango from PyTango import DebugIt from PyTango.server import run from PyTango.server import Device, DeviceMeta from PyTango.server import attri...
"""Batch Rename Program""" __all__ = ["BatchRenamer"] import re import sys from argparse import ArgumentError, Namespace from copy import deepcopy from shlex import split try: # pylint: disable=unused-import import readline except ModuleNotFoundError: print("History not available") from .filehistory impo...
from fastapi import APIRouter # from .endpoints import router = APIRouter(prefix="/v1") # router.include_router(healthcheck.router)
""" We have a collection of rocks, each rock has a positive integer weight. Each turn, we choose the two heaviest rocks and smash them together. Suppose the stones have weights x and y with x <= y. The result of this smash is: If x == y, both stones are totally destroyed; If x != y, the stone of weight x is totally ...
from dataclasses import dataclass from typing import List import os import logging from .config import get_config @dataclass class User: "Class for storing information about the current user." name: str roles: List[str] visitor: bool = False _allowed_visitor_roles = set(('user', 'readdb', 'annotato...
from collections import namedtuple Color = namedtuple("Color", "RED BLACK") class Node: def __init__(self): self.color = None self.height = None self.lis = None self.data = None self.size = None self.next = None self.right = None self.left = None ...
""" Build a simple mdlstm network with peepholes: >>> n = buildSimpleMDLSTMNetwork(True) >>> print(n) simpleMDLstmNet Modules: [<BiasUnit 'bias'>, <LinearLayer 'i'>, <MDLSTMLayer 'MDlstm'>, <LinearLayer 'o'>] Connections: [<FullConnection 'f1': 'i' -> 'MDlstm'>, <FullConnecti...
# -*- coding: utf-8 -*- """ Created on Wed Jan 01 20:00:29 2020 @author: Ing. Daniel Villarreal """ from PyQt5.QtWidgets import QMainWindow from PyQt5.uic import loadUi import pandas as pd from src_gui.generateDataframe import DataFrameModel from Gui.View_dso import Ui_MainWindow # Clase de la su...
from django.db import models from django.utils import timezone from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.db.models import Max from django.utils import timezone # Create your models here. class ...
""" ReflectiveLearning Application Student Arbeit Universität Siegen @author: Sukrut S. Sathaye User Interface: Main Screen """ import os import kivy from kivy.uix.screenmanager import ScreenManager, Screen from kivy.lang import Builder from kivy.properties import ObjectProperty, StringProperty import pick...
import time import json import codecs import sys import multiprocessing as mp, os import core from argparse import ArgumentParser from digsandpaper.elasticsearch_indexing.index_knowledge_graph import index_knowledge_graph_fields # # from concurrent import futures # from pathos.multiprocessing import ProcessingPool # fr...
import glob import os import numpy as np import csv import cv2 import argparse parser = argparse.ArgumentParser(description="", add_help='How to use', prog='python creating_numpy.py <options>') parser.add_argument("-if", "--inputfile", default=None, help='Path to the CSV file [DEFAULT: "data/tari...
from mlpug.pytorch.trainers.callbacks.basic import * from mlpug.pytorch.trainers.callbacks.callback import * from .checkpoint_manager import CheckpointManager from mlpug.pytorch.trainers.callbacks.lr_scheduler_wrapper import LRSchedulerWrapper from mlpug.pytorch.trainers.callbacks.metrics_logger import MetricsLoggingMo...
""" Choropleth Map ============== A choropleth map of unemployment rate per county in the US """ # category: maps import altair as alt from vega_datasets import data counties = alt.topo_feature(data.us_10m.url, 'counties') source = data.unemployment.url alt.Chart(counties).mark_geoshape().encode( color='rate:Q' )...
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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 a...
import sys sys.stdout.write("qwert\nyuiop...")
from . import views from django.urls import path # We specify an app name to reference the URL we need in our HTML templates app_name = 'bookmyslot' # The app(bookmyslot) specific URL's urlpatterns = [ path('mybookings/',views.BookingList.as_view(),name='list'), path('mybookings/<int:pk>/',views.BookingDetail...
import os import sys # Read arguments if len(sys.argv) != 2: raise ValueError('Please provide a filename input') filename = sys.argv[1] # Read file file_data = open(os.getcwd() + '/' + filename, 'r') # Parse file commands = [] for line in file_data.readlines(): commands.append(line.split(' ')) # Get answer...
# coding=utf-8 import tensorflow as tf from tfninja.utils import loggerfactory logger = loggerfactory.get_logger(__name__) hello = tf.constant('hello ninjas!!') session = tf.Session() logger.info(session.run(hello))
from pycg3d import cg3d_vector from pycg3d import utils class CG3dCordsBase(object): def __init__(self): pass @property def origin(self): raise NotImplementedError @property def ex(self): raise NotImplementedError @property def ey(self): raise NotImplemen...
from threading import Thread import asyncio import random import time import pytest import _thread from pybeehive.asyn.socket import SocketListener, SocketStreamer import pybeehive def test_no_zmq(async_hive): async_hive._socket_listener_class = None async_hive._socket_streamer_class = None with pytest....
import mxnet as mx import nnvm import random import itertools import numpy as np from nnvm.compiler import graph_attr, graph_util from nnvm import graph as _graph import math import tvm from mxnet import nd import sym_utils as sutils import utils import mrt as _mrt def random_shape(shp, min_dim=1, max_dim=64): fo...
############### Configuration file ############### import math start_epoch = 1 num_epochs = 60 batch_size = 8 optim_type = 'Adam' lr = 0.00001 weight_decay = 0.0005 num_samples = 25 beta_type = "Blundell" mean = { 'cifar10': (0.4914, 0.4822, 0.4465), 'cifar100': (0.5071, 0.4867, 0.4408), 'mnist': (0.1307...
import numpy as np import matplotlib.pyplot as plt from profit.sur.backend.gp_functions_old import invert, nll, predict_f, \ get_marginal_variance_BBQ, wld_get_marginal_variance from profit.sur.backend.kernels import kern_sqexp from profit.util.halton import halton def f(x): return x*np.cos(10*x) # Custom functio...
# General course information COURSE_NUMBER = "CS 106A" COURSE_NAME = "Programming Methodology" COURSE_TITLE = COURSE_NUMBER + ": " + COURSE_NAME CS198_NUMBER = 1 # B = 2, X = 3 # General quarter information QUARTER_NUMBER = 1188 QUARTER_NAME = "Summer" QUARTER_YEAR = "2018" QUARTER_FULL_NAME = QUARTER_NAME + " " + QUA...
import datetime import pytest import auth try: import mock except ImportError: from unittest import mock class Test_purge_login_tokens: @mock.patch('auth.datetime') def test_not_yet_expired_tokens_are_kept(self, stub_datetime): auth.login_tokens = { ('token', 'username'): datet...
import time import requests def compute_collateral_benefit(num_of_top_isp_rpki_adopters, rpki_adoption_propability_list): print("### Collateral benefit ###") for rpki_adopters_value in num_of_top_isp_rpki_adopters: for rpki_adoption_propability in rpki_adoption_propability_list: print("Top...
import sys from .app import Application def main(): app = Application(sys.argv) sys.exit(app.exec_()) if __name__ == '__main__': main()
# This file contains helper functions developed by the MITx 6.00.1x course # The game can be played through ps4_6.py (and ps4_7.py with a computer player) import random VOWELS = 'aeiou' CONSONANTS = 'bcdfghjklmnpqrstvwxyz' HAND_SIZE = 7 SCRABBLE_LETTER_VALUES = { 'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, '...
# https://gitlab.freedesktop.org/wayland/wayland/-/blob/main/protocol/wayland.xml import struct from .base import ( ArgUint32, ArgString, Interface ) class ArgDisplayError: def parse(data): oid, code = struct.unpack('=II', data[:8]) _, msg = ArgString.parse(data[8:]) return (oid, code, msg) class ArgRegis...
# 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 writing, software # distrib...
import logging import os import re import sys from configparser import RawConfigParser from html import unescape from html.parser import HTMLParser from json import dumps from logging.handlers import TimedRotatingFileHandler from os.path import isfile from shutil import copyfile import gevent from bottle import templa...
""" An object to be imported. """ class InsightObject: def __init__(self): print("et print, ergo sum") def fizz(self): return "buzz"
import sys, os from lxml import etree import urllib from edx_gen import _edx_consts from edx_gen import _css_settings from edx_gen import _util import __SETTINGS__ #-------------------------------------------------------------------------------------------------- # Text strings WARNING = " WARNING:" INFO = ...
# # Copyright 2008-2012 NVIDIA Corporation # Copyright 2009-2010 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/L...
from hashlib import sha1 as sha def main(): m = sha() m.update(b"Nobody inspects") m.update(b" the spammish repetition") digest1 = m.digest() print('digest1: ', digest1) print('digest1 size (The size of the resulting hash in bytes.): ', m.digest_size) print( "digest1 bloc...
#!/usr/bin/env python """Tests for constructing supercell models.""" import itertools import pytest import numpy as np from parameters import T_VALUES # pylint: disable=invalid-name @pytest.mark.parametrize("t_values", T_VALUES) @pytest.mark.parametrize("offset", [(0.2, 1.2, 0.9), (-0.2, 0.912, 0.0)]) @pytest.mar...
import os from scipy.special import comb def bagging_proba(n, acc=0.8): ''' n independent estimators with accuracy 'acc', then what is estimated accuracy of bagging estimator with majority voting ? Note, 6 or more out of 10 is called a majority. ''' if n == 1: return acc error = 0 ...
''' @package: pyAudioLex @author: Jim Schwoebel @module: word_endings Given a word ending (e.g. '-ed'), output the words with that ending and the associated count. ''' from nltk import word_tokenize import re def word_endings(importtext,ending): text=word_tokenize(importtext) #number of words endi...
__author__ = 'varun' from .views import settings_page, update_user_profile from django.conf.urls import url urlpatterns = [ url(r'^$', settings_page), url(r'^update-profile$', update_user_profile), ]
""" entrada nombre->int->n monto_compra-->int-->mc salidas total_descuento->str->td """ n = str(input("nombre del cliente: ")) mc = int(input("ingrese el valor de la compra $")) if (mc < 50000): print(n) print("No hay descuento") print("Monto a pagar: " + str(mc),"$") elif(mc > 50000 and mc <= 100000): td...
# Generated by Django 2.2.2 on 2019-06-18 02:26 from django.db import migrations, models import django.utils.timezone class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='Song', fields=[ ...
""" This file handles searching and adding workouts """ from flask import (Blueprint, render_template, flash, session, request, redirect, url_for, json) from flaskapp import db bp = Blueprint('workout', __name__, url_prefix='/workout') @bp.route('/') def workout(): """ Page where user adds...
import pickle import sys import maya.cmds as cmds import os # import DLS from maya.api.OpenMaya import MVector import xml.etree.ElementTree import maya.mel as mel import random import DLS import time import re mapping_folder = 'd:/.work/.chrs/.bone_mapping' xml_folder = 'd:/.work/.chrs/.xml' upper_low...
'''Dsp module contains functions pertaining to the actual generation, manipulation, and analysis of sound. This ranges from generating sounds to calculating sound to noise ratio. ''' ############################################################################### import sys, os import inspect import numpy as np from num...
import os from nose.tools import assert_greater from scrapy.selector import Selector from .. import parse_user_arts CURRENT_PATH = os.path.dirname(__file__) def test_parse_user_arts(): for name in [ 'tid.html', ]: yield check_parse_user_arts, name def check_parse_user_arts(name): with ...
import math import logging import gensim from collections import defaultdict from .matcher import Matcher class WordWeightMatcher(Matcher): """ 採用詞權重來比對短語相似度 """ def __init__(self, segLib="Taiba"): super().__init__(segLib) self.wordDictionary = defaultdict(int) # 保存每個詞的出現次數 ...
from PhotochemPy import PhotochemPy template = 'Archean2Proterozoic' sun = 'Sun_2.7Ga.txt' pc = PhotochemPy('../input/templates/'+template+'/species.dat', \ '../input/templates/'+template+'/reactions.rx', \ '../input/templates/'+template+'/settings.yaml', \ '../input...
import inflection SCHEMA = { 'Assignment': { 'create_endpoint_name': 'assignToEnvironment' }, 'EntityAssignment': { 'create_endpoint_name': 'assignToEntity' }, 'MaterialAssignment': { 'create_endpoint_name': 'assignToMaterial' }, 'Datapoint': { 'id_field_name...
#!/usr/bin/env python ''' Use Netmiko to connect to each of the devices in the database. Execute 'show version' on each device. Record the amount of time required to do this. DISCLAIMER NOTE: Solution is limited to the exercise's scope ''' from net_system.models import NetworkDevice import django from termcolor import...
# coding: utf-8 # Author: Marc Weber """ ========================================================================================= Multiple sequence alignment ========================================================================================= We follow the definition of conservation score in @Capra2007 by compu...
# pylint: disable=import-outside-toplevel # pylint: disable=R0904 import json import logging import re import time from time import sleep from uuid import uuid4 import docker from botocore import UNSIGNED from botocore.config import Config from rpdk.core.contract.interface import Action, HandlerErrorCode, OperationSt...
from __future__ import absolute_import import sys, os, shutil import forcebalance.parser import unittest from __init__ import ForceBalanceTestCase class TestParser(ForceBalanceTestCase): def test_parse_inputs_returns_tuple(self): """Check parse_inputs() returns type""" output = forcebalance.parser....
import json from collections import Counter def read_depparse_features(data_path): with open(data_path, "r") as f: examples = [json.loads(jsonline) for jsonline in f.readlines()] dependencies = [] predicted_heads = [] predicted_dependencies = [] for example in examples: ...
import tkinter as tk import tkinter.ttk as ttk import Inbound import MainInventory import Outbound from Database import Database database = Database() def main(): window = tk.Tk() window.title("UNCW Football!") tab_control = ttk.Notebook(window) inventory = MainInventory.MainInventory(tab_control, ...
import pytest from admin.maintenance import views from django.utils import timezone from django.test import RequestFactory from django.contrib.auth.models import Permission from django.core.exceptions import PermissionDenied import website.maintenance as maintenance from osf.models import MaintenanceState from osf_t...
from typing import List from flask import Response, make_response, jsonify def item_not_found(item_name: str, field_name: str, field_value: str) -> Response: return make_response( jsonify( { "error": { "code": 1, "msg": f"Could not find ...
from flask import Flask app = Flask(__name__) import grpc import demo_pb2 import demo_pb2_grpc @app.route('/grpc') def hello_world_grpc(): with grpc.insecure_channel('127.0.0.1:9090') as channel: client = demo_pb2_grpc.DemoServiceStub(channel) response = client.CreateOne(demo_pb2.RequestData( ...
from services.log_service import LogService from entities.word_evaluation import WordEvaluation import os import torch import torch.nn as nn from datetime import datetime from typing import Dict, List, Tuple from overrides import overrides from entities.models.model_checkpoint import ModelCheckpoint from entities....
# -*- coding: utf-8 -*- """ Created on Sat Dec 4 10:38:45 2021 Advent of Code 2021 is here My goal is to attempt all challenges before the onset of 2022 @author: Rahul Venugopal """ #%% --- Day 4: Giant Squid --- Part 1 #test data number_list = ['7','4','9','5','11','17','23','2','0','14','21','24','10','16','13','6'...
import rfl.core as core import rfl.tflbridge as tflbridge import click import json class ReporterContext: def __init__(self): self._path = None self._model = None @property def path(self): return self._path @path.setter def path(self, new_path: str): self._path = new_path @property d...
from .episodes import * # noqa from .podcasts import * # noqa from .progress import * # noqa from .playlists import * # noqa
import os, sys; sModulePath = os.path.dirname(__file__); sys.path = [sModulePath] + [sPath for sPath in sys.path if sPath.lower() != sModulePath.lower()]; from fTestDependencies import fTestDependencies; fTestDependencies(); try: # mDebugOutput use is Optional import mDebugOutput as m0DebugOutput; except ModuleNotF...
from pandas import Timestamp # Chinese holidays are quite irregular because # 1. some of the holidays are base on traditional Chinese calendar (lunisolar) # 2. the government tries very hard to arrange multi-day holidays # and is not consistent in ways of doing so. # So instead of writing rules for them, it's much cl...
#!/usr/bin/env python """ generated source for module GdlValidator """ # package: org.ggp.base.util.gdl import org.ggp.base.util.symbol.grammar.Symbol import org.ggp.base.util.symbol.grammar.SymbolAtom import org.ggp.base.util.symbol.grammar.SymbolList # # * The GdlValidator class implements Gdl validation for the...
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : 2_BrowserClass.py @Time : 2020-8-22 20:20:16 @Author : Recluse Xu @Version : 1.0 @Contact : 444640050@qq.com @Desc : 浏览器类相关 官方文档:https://miyakogi.github.io/pyppeteer/reference.html#pyppeteer.page.Page.target ''' # here put the import...
""" File Processing (file_processing.py): ------------------------------------------------------------------------------- Last updated 7/2/2015 This module creates functions for generic file operations. """ # Packages import os import sys def get_file(dirct, contains=[""]): """ Given a directory, this function f...
#!/usr/bin/env python import platform import resource from unicorn import * import regress # OS X: OK with 2047 iterations. # OS X: Crashes at 2048:th iteration ("qemu: qemu_thread_create: Resource temporarily unavailable"). # Linux: No crashes observed. class ThreadCreateCrash(regress.RegressTest): def test(se...
import os import compas from compas.geometry import Point, Polygon from compas.datastructures import Mesh from compas.utilities import i_to_red from compas_assembly.datastructures import Assembly, Block from compas_view2.app import App from compas_view2.objects import Object, NetworkObject, MeshObject from compas_vi...
import random def main(): length = get_length() chars = parse_chars() password = construct_pass(length, chars) print("Your password is: " + password) input("Press enter to exit.") def get_length(): print("Weak: 0-7; Moderate: 8-11; Strong: 12+") while True: num = inpu...
from .clang_tidy_parser import ClangTidyParser, ClangMessage
from typing import MutableMapping from app.views.handlers.list_action import ListAction class ListAddQuestion(ListAction): def is_location_valid(self): if not super().is_location_valid() or self._current_location.list_item_id: return False return True def handle_post(self): ...
import os import re import pandas as pd from scripts.task import Task from Constants import METADATA, RESULT class FindPatternInJudgements(Task): def __init__(self, input_dir: str, pattern: str, label: str, line_limit: int = 0, limit_lines: bool = False, store_result: bool = True): su...
import pytest from rdkit import RDLogger from prolif.fingerprint import Fingerprint from prolif.interactions import _INTERACTIONS, Interaction, get_mapindex import prolif from .test_base import ligand_mol from . import mol2factory # disable rdkit warnings lg = RDLogger.logger() lg.setLevel(RDLogger.ERROR) @pytest.fi...
# -*- coding: utf-8 -*- """ ========================= rx_sect_plot (mod: 'vmlib.seis') ========================= basemap cdp_spacing distance """ __all__ = ['cdp', 'navmerge', 'rcv', 'src', 'traces', 'rx_sect_plot', 'rx_sect_qc', 'segy'] from .cdp import CDP_line from .navmerge import basemap, elevatio...
from django.contrib.auth.models import Group def get_group_obj(gid): try: return Group.objects.get(pk=gid) except Group.DoesNotExist: return None
from .BayesianLogisticRegression import BayesianLogisticRegression from .BayesianNetwork import BayesianNetwork, MLP_mcmc from .MLP import MLP from .CNN import CNN, Net from .HMC_GP import HMC_GP
import allure from antiphishme.src.api_modules.ip_module import get_ip, get_ip_details from antiphishme.tests.test_helpers import ( assert_true, assert_equal, assert_none, assert_type, assert_not_empty, info ) @allure.epic("api_modules") @allure.parent_suite("Unit tests") @allure.story('Unit')...
import datetime import pytest real_datetime_class = datetime.datetime class DatetimeSubclassMeta(type): @classmethod def __instancecheck__(mcs, obj): return isinstance(obj, real_datetime_class) class BaseMockDatetime(real_datetime_class): @classmethod def now(cls): if hasattr(cls, ...
# -*- coding: utf-8 -*- import djchoices from django.db import models import schools.models import users.models class Discount(models.Model): class Type(djchoices.DjangoChoices): SOCIAL = djchoices.ChoiceItem(1, 'Социальная скидка') PARTNER = djchoices.ChoiceItem(2, 'Скидка от партнёра') ...
import blobconverter import numpy as np import cv2 import depthai as dai class TextHelper: def __init__(self) -> None: self.bg_color = (0, 0, 0) self.color = (255, 255, 255) self.text_type = cv2.FONT_HERSHEY_SIMPLEX self.line_type = cv2.LINE_AA def putText(self, frame, text, coo...
#!/usr/bin/env python ''' Create CFIS photometric images from SKIRT IFS datacube. Version 0.1 SED to flux conversions use the AB system following the documentation here: http://www.astro.ljmu.ac.uk/~ikb/research/mags-fluxes/ Also found here (though incorrect in places): http://mfouesneau.github.io/docs/pyphot/ Updat...
#!/usr/bin/env python """ Summary ------- Provides implementation of the Test Problem C Oracle for use in PyMOSO. """ from ..chnbase import Oracle from math import exp, sqrt, sin class ProbTPC(Oracle): """ An Oracle that simulates Test Problem C. Attributes ---------- num_obj : int, 2 dim...