text
stringlengths
2
999k
# Медведь на моноцикле <warning descr="Byte literal contains characters > 255">b"aaa�"</warning> b"24sd"
import argparse from collections import Counter import os from loguru import logger import torch from torch import nn from torch.utils.data import DataLoader, DistributedSampler from torch.utils.tensorboard import SummaryWriter from virtex.config import Config from virtex.factories import ( DownstreamDatasetFacto...
# PART I # This function draws stars equal to the value at index i in input list #def draw_stars(star_map): # for i in range(0, len(star_map)): # stars = "" # for j in range(0, star_map[i]): # stars += "*" # print stars #x = [4,6,1,3,5,7,25] #draw_stars(x) # PART II # Th...
#!/usr/bin/env python 3 # -*- coding: utf-8 -*- # # Copyright (c) 2021 PanXu, Inc. All Rights Reserved # """ 使用 bert 的 init weights Authors: PanXu Date: 2021/11/08 08:44:00 """ from torch.nn import Module from torch import nn from transformers import BertConfig class BertInitWeights: """ bert 初始化权重 ...
#!/usr/bin/env python3 import logging import scanpy.api as sc from scanpy_scripts.wrapper_utils import ( ScanpyArgParser, read_input_object, write_output_object, ) def main(argv=None): argparser = ScanpyArgParser(argv, 'Normalise per-cell quantification data') argparser.add_input_object() argpar...
# -*- python -*- # Copyright (C) 2009-2020 Free Software Foundation, Inc. # 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 versio...
"""ChoiceSet classes for device onboarding. (c) 2020 Network To Code 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...
print("I am A Finder who gives you answer to your problems") print("I will find you the traingle vertices points with your midpoints in the side") print('-----------------------------------------------------------------------------') class point: def __init__(self, x, y): self.x = x self.y = y #print("Let A") pr...
# -*- coding: utf-8 -*- # # This file is part of the SKA SAT.LMC project # # Distributed under the terms of the BSD 3-clause new license. # See LICENSE.txt for more info. """This subpackage implements DSP component for PST.LMC.""" __all__ = [ "PstDsp", ] from .dsp_device import PstDsp
#!/usr/bin/env python import ast import re import subprocess import sys from setuptools import Command, find_packages, setup from setuptools.command.test import test as TestCommand _version_re = re.compile(r'__version__\s+=\s+(.*)') with open('mycli/__init__.py') as f: version = ast.literal_eval(_version_re.sea...
__version__ = "0.1.3" from tarexp.dataset import Dataset, SparseVectorDataset, TaskFeeder from tarexp.workflow import Workflow, WorkflowReplay, \ OnePhaseTARWorkflow, OnePhaseTARWorkflowReplay, \ TwoPhaseTARWorkflow from tarexp.ledger import Ledger, FrozenLedger ...
from django.conf.urls import url from orders import views urlpatterns =[ url(r'^orders/settlement/$',views.OrderSettlementView.as_view()), ]
from pprint import pprint done = set(['abs','all','any','ascii','bin','bool','bytearray','bytes','callable','chr','dict','divmod','enumerate','filter','float','frozenset','hex','int','iter','len','list','map','max','min','next','object','oct','ord','pow','range','repr','round','set','sorted','str','sum','tuple','zip']...
"""empty message Revision ID: e553b195fe90 Revises: Create Date: 2017-07-19 12:00:20.474429 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = "e553b195fe90" down_revision = None branch_labels = None depends_on = None de...
import torch import torch.nn as nn import torch.nn.functional as F from fast_jtnn.mol_tree import Vocab, MolTree from fast_jtnn.nnutils import create_var, flatten_tensor, avg_pool from fast_jtnn.jtnn_enc import JTNNEncoder from fast_jtnn.jtnn_dec import JTNNDecoder from fast_jtnn.mpn import MPN from fast_jtnn.jtmpn imp...
# 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...
#!/usr/bin/env python ############################################################################# ## # This file is part of Taurus ## # http://taurus-scada.org ## # Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain ## # Taurus is free software: you can redistribute it and/or modify # it under the terms of t...
from sqla_wrapper import SQLAlchemy, Paginator def create_test_model(): db = SQLAlchemy('sqlite://') class Item(db.Model): id = db.Column(db.Integer, primary_key=True) class Part(db.Model): id = db.Column(db.Integer, primary_key=True) item_id = db.Column(db.Integer, db.ForeignKey...
/usr/local/lib/python3.6/imp.py
import sys import smtplib import json def send_email(senderEmail,senderPassword, recipients, subject, body): ''' recipients: a list Return True if email sent successfully ''' FROM = senderEmail TO = recipients SUBJECT = subject TEXT = body message = """From: %...
import os import sys import numpy as np import tensorflow as tf import load_trace import a3c import fixed_env as env os.environ['CUDA_VISIBLE_DEVICES'] = '' S_INFO = 6 # bit_rate, buffer_size, next_chunk_size, bandwidth_measurement(throughput and time), chunk_til_video_end S_LEN = 8 # take how many frames in the pa...
#! /usr/bin/env python # Copyright 2015 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 require...
from typing import NamedTuple, Optional, Union, Any, Dict, List from datetime import date import lxml.etree as ET # type: ignore[import] from ..paths import _expand_file, PathIsh from ..list_type import ListType from .common import parse_date_safe, strtobool # hmm.. cant figure out the types for this XMLElement = ...
#/** @file # * Copyright (c) 2018-2019, Arm Limited or its affiliates. All rights reserved. # * SPDX-License-Identifier : Apache-2.0 # * # * 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 # ...
""" 使用Bert进行英文命名实体识别 """ import sys sys.path.append('../../../') from reproduction.seqence_labelling.ner.model.bert_crf import BertCRF from fastNLP.embeddings import BertEmbedding from fastNLP import Trainer, Const from fastNLP import BucketSampler, SpanFPreRecMetric, GradientClipCallback from fastNLP.core.callba...
# -*- coding: utf-8 -*- ''' Manage JBoss 7 Application Server via CLI interface This state uses jboss-cli.sh script from JBoss installation and parses its output to determine execution result. In order to run each state, jboss_config dictionary with the following properties must be passed: .. code-block:: yaml j...
# Constants for scaled f-score from sklearn.feature_extraction.stop_words import ENGLISH_STOP_WORDS DEFAULT_BETA = 2 DEFAULT_SCALER_ALGO = 'normcdf' DEFAULT_PMI_THRESHOLD_COEFFICIENT = 8 DEFAULT_MINIMUM_TERM_FREQUENCY = 3 DEFAULT_DIV_ID = 'd3-div-1' DEFAULT_HTML_VIZ_FILE_NAME = 'scattertext.html' SEMIOTIC_SQUARE_H...
""" Tests for kqueue wrapper. """ import errno import os import select import socket import sys import time import unittest from test import support if not hasattr(select, "kqueue"): raise unittest.SkipTest("test works only on BSD") class TestKQueue(unittest.TestCase): def test_create_queue(self): kq ...
# Copyright 2015 Netflix, Inc. # # 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...
"""Glassdoor web scraper """ import re import json import sys import requests import queries def get_job_search_query(query, loc_id, loc_type, count=100, page=1): """Get graphql query for JobSearch """ location_types = { 'N': 'COUNTRY', 'C': 'CITY' } return { "operationN...
import numpy as np import tensorflow as tf from imitation.tensorflow._layers import one_residual class TensorflowModel: def __init__(self, observation_shape, action_shape, graph_location, seed=1234): # model definition self._observation = None self._action = None self._computation...
from django.conf.urls import patterns, url from . import views urlpatterns = [ url('^$', views.index, name='index'), url('^checkout$', views.checkout, name='checkout'), url('^checkout/delete/([0-9]+)$', views.delete, name='cartdelete'), url('^cart/change$', views.changeQuantity, name='cart...
#!/usr/bin/env python3 # # Copyright 2022 Graviti. Licensed under MIT License. # """Row Series module."""
import Queue as Q def print_grid(grid): f = open('output26.dat','w'); for row in grid: for c in row: v = '# ' if c: v = '. ' f.write(v) f.write('\n') def is_open(x, y): seed = 1362 val = x*x + 3*x + 2*x*y + y + y*y val += seed ones = bin(val).count('1') return on...
# # Copyright 2015 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 a...
""" utils ~~~~~ Test utils :copyright: (c) 2019-2020 by J. Christopher Wagner (jwag). :license: MIT, see LICENSE for more details. """ from contextlib import contextmanager from flask.json.tag import TaggedJSONSerializer from flask.signals import message_flashed from flask_security import Securi...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # This file is part of MyDojo package (https://github.com/honzamach/mydojo). # # Copyright (C) since 2018 Honza Mach <honza.mach.ml@gmail.com> # Use of this source is governed by the MIT licen...
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2017, Battelle Memorial Institute. # # 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...
# Copyright 2018 Tensorforce Team. 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 la...
"""phan URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-bas...
import inspect from pathlib import Path from typing import Optional, Tuple, Union from discord import Embed from discord.ext import commands from bot.bot import Bot from bot.constants import URLs SourceType = Union[commands.HelpCommand, commands.Command, commands.Cog, str, commands.ExtensionNotLoaded] class Source...
# -*- coding:utf-8 -*- # Copyright (c) 2019 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 # # U...
# Copyright 2019-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # HPCTools Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause import os import sys import reframe as rfm import reframe.utility.sanity as sn tools = ['memcheck', 'racecheck', 'initcheck',...
import unittest from crypto_tools.stats import letter_frequency class TestLetterFrequency(unittest.TestCase): def test_count_empty(self): counter = letter_frequency.LetterFrequency("") self.assertEqual(counter.calculate(), {}) def test_count_text(self): text = "The quick brown fox jum...
import modeling import numpy as np import tensorflow as tf import linalg from tensorflow.contrib import rnn from tensorflow.contrib import crf class Parser(object): def __init__(self, is_training, num_head_labels, num_rel_labels, mlp_droput_rate, token_start_mask, arc_mlp_size, label_mlp_size, batch_size): sel...
from django.contrib import admin # <HINT> Import any new Models here from .models import Course, Lesson, Instructor, Learner, Question, Choice # <HINT> Register QuestionInline and ChoiceInline classes here class LessonInline(admin.StackedInline): model = Lesson extra = 5 class QuestionInline(admin.StackedIn...
from setuptools import find_packages, setup setup( name='src', packages=find_packages(), version='0.1.0', description='ADSI Lab 3', author='cazmayhem', license='', )
from porcupine.base import Serializer class User(object): def __init__(self, name=None, surname=None, age=None): self.name = name self.surname = surname self.age = age class UserSerializer(Serializer): name: str surname: str age: int = None @staticmethod def resolve_...
from flask import Flask import settings from endpoints import init_api app = Flask(__name__) init_api(app) if __name__ == '__main__': app.run(port=8000, host="127.0.0.1")
#!/usr/bin/env python # The following code is used to watch a video stream, detect Aruco markers, and use # a set of markers to determine the posture of the camera in relation to the plane # of markers. # # Assumes that all markers are on the same plane, for example on the same piece of paper # # Requires camera calib...
#!/usr/bin/env python3 import rospy import struct from pymodbus.client.sync import ModbusSerialClient as modbus from pymodbus.exceptions import ModbusIOException from sensor_msgs.msg import Temperature from std_msgs.msg import Float32 from geometry_msgs.msg import PoseWithCovarianceStamped from diagnostic_msgs.msg impo...
from django.contrib import admin from .models import Room, Message # Register your models here. admin.site.register(Room) admin.site.register(Message)
"""Benchmarks for linear solvers.""" import numpy as np from probnum import linops, problems, randvars from probnum.linalg import problinsolve from probnum.problems.zoo.linalg import random_sparse_spd_matrix, random_spd_matrix LINEAR_SYSTEMS = ["dense", "sparse", "linop"] LINSYS_DIMS = [100, 1000, 10000, 100000] QUAN...
import matplotlib.pyplot as plt from numpy import pi, exp from ....Classes.Arc1 import Arc1 from ....Classes.LamSlot import LamSlot from ....Classes.Segment import Segment from ....definitions import config_dict from ....Functions.Plot import ( ARROW_COLOR, ARROW_WIDTH, MAIN_LINE_COLOR, MAIN_LINE_STYLE...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # Set up custom environment before nearly anything else is imported # NOTE: this should be the first import (no not reorder) from maskrcnn_benchmark.utils.env import setup_environment # noqa F401 isort:skip import argparse import os import pickle...
def mxdiflg(a1, a2): allmax = [] counter = 0 if len(a1) and len(a2) != 0: if len(a1) > len(a2): while counter <= len(a1): for x in a1: for y in a2: allmax.append(abs(len(x) - len(y))) counter += 1 ...
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ..svm import SVMTrain def test_SVMTrain_inputs(): input_map = dict( alphas=dict( argstr="-alpha %s", extensions=None, name_source="in_file", name_template="%s_alphas", suffix="_alphas", ...
import runner runner.start()
# ============================================================================== # # Use: # encrypt("Hello World!") # => OUTPUT # # ============================================================================== def encrypt(text): return encrypted
##################################################################################################################### # lattice: This module implements functions that are useful to build receptive fields localized over a lattice # # generalizing rectangular swichtboards. It is part of the Cuicuilco framew...
import torch from argparse import ArgumentParser import os from utils import read_GeoQuery, data_iterator from pytorch_pretrained_bert.modeling import BertModel from tokens_vocab import Vocab import domains from semantic_parser import TSP, BSP from utils import get_dataset_finish_by, save_model, get_dataset, load_model...
from __future__ import absolute_import, unicode_literals try: from importlib import reload except ImportError: pass from django.conf.urls import url from django.test import TestCase from mock import patch try: import wagtail.core.urls as wagtail_core_urls except ImportError: # pragma: no cover; fallback...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from parlai.core.params import ParlaiParser from parlai.mturk.core.mturk_manager import MTurkManager from worlds import P...
from django.shortcuts import render # Create your views here. def index(request): return render(request, "pages/index.html") def about(request): return render(request, "pages/about.html") def contact(request): return render(request, "pages/contact.html") def team(request): return render(request, "p...
#!/usr/bin/env python # Copyright (c) 2022 SMHI, Swedish Meteorological and Hydrological Institute. # License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit). """ Created on 2022-03-10 14:37 @author: johannes """ """ Microservice Template: https://github.com/shark-microservices/microservice_templa...
from flask import Flask, render_template, request from flask_sqlalchemy import SQLAlchemy from config import LANGUAGE app = Flask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///db.sqlite' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) @app.context_processor def kielivalinta():...
# Copyright 2021. ThingsBoard # # 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 ...
#!/usr/bin/env python2 from baxter_interface import Limb, Head, RobotEnable, Gripper from geometry_msgs.msg import Pose, Point, Quaternion from lib.ikservice import IKService from rospy import init_node __all__ = [ 'Baxter', 'LEFT', 'RIGHT' ] LEFT, RIGHT = 'left', 'right' class Baxter(object): def _...
class Hand: def __init__(self, *cards): self.cards = cards def value(self): return [value for value in sum(cards) if value <= 21]
import torch import torch.nn as nn import torch.nn.utils.rnn as rnn_utils from utils import to_var class SentenceVAE(nn.Module): def __init__(self, vocab_size, embedding_size, rnn_type, hidden_size, word_dropout, embedding_dropout, latent_size, sos_idx, eos_idx, pad_idx, unk_idx, max_sequence_le...
#!/usr/bin/env python """ @package mi.dataset.parser.optaa_dj_dcl @file marine-integrations/mi/dataset/parser/optaa_dj_dcl.py @author Jeff Roy (Raytheon) @brief Parser for the optaa_dj_dcl dataset driver This file contains code for the optaa_dj_dcl parsers and code to produce data particles. For telemetered data, the...
""" Download youtube videos as mp3. """ import pytest from data.playlist import get_playlist from pages.youtube import YouTube320 @pytest.mark.parametrize("video", get_playlist()) def test_download(browser, video): youtube = YouTube320(browser) youtube.download(video)
from __future__ import annotations import logging from typing import TYPE_CHECKING, Union, Tuple, List, Optional, Dict from opentrons.protocols.api_support.labware_like import LabwareLike from opentrons import types, hardware_control as hc from opentrons.commands import paired_commands as cmds from opentrons.command...
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.utils.translation import ugettext_lazy as _ from django_fsm import transition from .base import ShippingProvider class DefaultShippingProvider(ShippingProvider): """ Default shipping provider for items without explicit shipping. ...
"""mysite URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class-based ...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.c (the "License"); # you may not use this file except in compliance with the License. # """ Userbot module for kanging stickers or making new ones. Thanks @rupansh""" import io import math import urllib.req...
import yaml import sys import os from distutils.version import LooseVersion import get_support_version BRANCH = os.environ.get("TARGET_BRANCH") VERSIONS = get_support_version.get_support_version(BRANCH) if (len(sys.argv) != 3): print("Command example: python visible.py <COUNT_TO_KEEP> <PATH_TO_HIDE>\n If COUNT_T...
import re from pinry.core.models import Pin from pinry.users.models import User email_re = re.compile( r"(^[-!#$%&'*+/=?^_`{}|~0-9A-Z]+(\.[-!#$%&'*+/=?^_`{}|~0-9A-Z]+)*" # dot-atom # quoted-string, see also http://tools.ietf.org/html/rfc2822#section-3.2.5 r'|^"([\001-\010\013\014\016-\037!#-\[\]-\177]|\\[...
__all__ = [ 'config', 'export', 'google', 'graph', 'transformers', 'utils', 'converters', 'datasets', 'diagnostics', 'external', 'extractors', 'filters', 'stimuli', 'support' ]
""" Copyright (c) 2019 Intel Corporation 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 wri...
from __future__ import absolute_import, unicode_literals import logging import pykka from mopidy import backend from mopidy.models import Album, Artist, Image, Ref, SearchResult, Track from . import Extension from .cdrom import CD_PROTOCOL, UNKNOWN_DISC, CdRom logger = logging.getLogger(__name__) ROOT_URI = 'cd:...
import mne import numpy as np import os import fnmatch from anlffr.preproc import find_blinks from mne.preprocessing.ssp import compute_proj_epochs # Adding Files and locations # froot = '/home/hari/Documents/PythonCodes/ASSRmartinos/' froot = '/autofs/cluster/transcend/hari/ASSRnew/' subjlist = ['084601', ] para = ...
# Copyright 2019 Xanadu Quantum Technologies Inc. # 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 agre...
# Copyright 2022 Netskope Inc # # 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 # # https:#www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
# 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 PySphinxcontribQthelp(PythonPackage): """sphinxcontrib-qthelp is a sphinx extension which ...
FALSE=0 TRUE=1 DBSAVE=1 DBNOSAVE=0 INT_EXIT=0 INT_CONTINUE=1 INT_CANCEL=2 INT_TIMEOUT=3 DBMAXNUMLEN=33 DBMAXNAME=30 DBVERSION_UNKNOWN=0 DBVERSION_46=1 DBVERSION_100=2 DBVERSION_42=3 DBVERSION_70=4 DBVERSION_71=5 DBVERSION_72=6 DBTDS_UNKNOWN=0 DBTXPLEN=16 BCPMAXERRS=1 BCPFIRST=2 BCPLAST=3 BCPBATCH=4 BCPKEEPIDENTITY=8 BC...
from .widgets import Stars
import numpy as np import tensorflow as tf import tensorflow.contrib.slim as slim import tensorflow.contrib.layers from tensorflow.contrib.layers.python import layers as tf_layers from models.conv_lstm import basic_conv_lstm_cell # Amount to use when lower bounding tensors RELU_SHIFT = 1e-12 FC_LAYER_SIZE = 512 # ke...
# Generated by Django 3.1 on 2020-08-16 14:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('contact', '0001_initial'), ] operations = [ migrations.CreateModel( name='Table', fields=[ ('id', mode...
from django.db.models.query import QuerySet from styleguide_example.users.models import BaseUser from styleguide_example.users.filters import BaseUserFilter def user_get_login_data(*, user: BaseUser): return { 'id': user.id, 'email': user.email, 'is_active': user.is_active, 'is_ad...
import unittest import pickle from xgboost_wrap import D3M_XGBClassifier from pathlib import Path from d3m.metadata import base as metadata_base from d3m import container from d3m.primitive_interfaces.base import PrimitiveBase from d3m.exceptions import PrimitiveNotFittedError from pandas.testing import assert_frame_e...
from metalprot.apps.core import Core import pytest import os import shutil import prody as pr from metalprot import ligand_database from metalprot import core from metalprot.apps.search_struct import Query, Comb def test_contact(): workdir = os.path.dirname(os.path.realpath(__file__)) + '/test_data/' workdir ...
# -*- coding: utf-8 -*- # Copyright 2018 IBM. # # 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 agre...
import pytest pytest_plugins = [ 'clincoded.tests.features.browsersteps', 'clincoded.tests.features.customsteps', ] @pytest.fixture(scope='session') def app_settings(server_host_port, elasticsearch_server, postgresql_server): from .. import test_indexing return test_indexing.app_settings(server_host_...
import torch import torch.nn as nn import torch.nn.functional as F from collections import OrderedDict import math import numpy as np def conv3x3(in_planes, out_planes, stride=1): "3x3 convolution with padding" return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1,...
def evalQuadratic(a, b, c, x): ''' a, b, c: numerical values for the coefficients of a quadratic equation x: numerical value at which to evaluate the quadratic. ''' # Your code here return (a*(x**2))+(b*x)+c
# Copyright 2015 The TensorFlow 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 applica...
from setuptools import setup, find_packages setup( name='pycoin', version='0.0.1', description='Proof of concept - blockchain', packages=find_packages(), install_requires=[ 'cryptography', 'click', 'peewee' ], entry_points={ 'console_scripts': [ 'pycoin-wallet = ...
# 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 """ Genomic Data Store Service No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: v1 Generated by: https://openapi-generator.tech """ import pprint import re # noqa: F401 imp...