text
stringlengths
2
999k
""" Definition of the :class:`NativeRegistration` class. """ from pathlib import Path from typing import Tuple from typing import Union import nibabel as nib from brain_parts.parcellation.parcellations import ( Parcellation as parcellation_manager, ) from nilearn.image.resampling import resample_to_img from nipype...
""" Copyright (C) Microsoft Corporation. All rights reserved.​ ​ Microsoft Corporation (“Microsoft”) grants you a nonexclusive, perpetual, royalty-free right to use, copy, and modify the software code provided by us ("Software Code"). You may not sublicense the Software Code or any use of it (except to your affiliates...
''' This file defines the testing module. This needs the following: 1. The system under test 2. The specification or the function which we are trying to minimize 3. Domains of the uncertainities ''' from .optimizers import * from .func_tree import * from .utils import * from sklearn.decomposition import KernelPCA imp...
import argparse from suzieq.cli.sqcmds import * from suzieq.cli.sqcmds import context_commands from suzieq.cli.sqcmds import sqcmds_all from suzieq.cli.sq_nubia_context import NubiaSuzieqContext from suzieq.cli.sq_nubia_statusbar import NubiaSuzieqStatusBar from nubia import PluginInterface, CompletionDataSource from n...
from django.db import models from django.contrib.auth.models import User from django.template.defaultfilters import slugify import os from django.urls import reverse class standard(models.Model): name = models.CharField(max_length=100, unique=True) slug = models.SlugField(null=True,blank=True) descriptio...
from django.shortcuts import render from rest_framework import generics, authentication, permissions from rest_framework.authtoken.views import ObtainAuthToken from rest_framework.settings import api_settings from user.serializers import UserSerializer, AuthTokenSerializer class CreateUserView(generics.CreateAPIVie...
import requests import numpy as np import collections import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from PIL import Image from io import BytesIO class Image_Data: image = None @property def Array(self) -> np.ndarray: """ Return ...
from pymongo import MongoClient client = MongoClient() # carPricingDB = client["carPricing"] # firstOffersCollection = carPricingDB.create_collection("firstOffers") # firstOffersCollection.insert_one({"item":"initialone"}) carPricingDB = client.carPricing firstOffersCollection = carPricingDB.firstOffers firstOffer...
# coding: utf-8 # -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- from __future__ import print_function import xml.dom.mi...
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for lots of functionality provided by L{twisted.internet}. """ from __future__ import division, absolute_import import os import sys import time from twisted.python.compat import _PY3 from twisted.trial import unittest from twisted.in...
import setuptools with open('README.md') as file: readme = file.read() name = 'aio4chan' module = __import__(name) version = module.__version__ author = 'Exahilosys' url = f'https://github.com/{author}/{name}' download_url = f'{url}/archive/v{version}.tar.gz' setuptools.setup( name = name, version ...
# coding: utf-8 """ Signing Today Web *Signing Today* is the perfect Digital Signature Gateway. Whenever in Your workflow You need to add one or more Digital Signatures to Your document, *Signing Today* is the right choice. You prepare Your documents, *Signing Today* takes care of all the rest: send invitatio...
import os import sys import traceback from _pydev_bundle.pydev_imports import xmlrpclib, _queue, Exec from _pydev_bundle._pydev_calltip_util import get_description from _pydev_imps._pydev_saved_modules import thread from _pydevd_bundle import pydevd_vars from _pydevd_bundle import pydevd_xml from _pydevd_bundle.pydevd...
from .writer import saveMeshTracks from .reader import loadMeshTracks from .meshdata import Track, Mesh
"""Utilities for setting up a project's settings. The default way to use this is to import and call :func:`init_settings` in a project's settings module: # project/top_level_package/settings.py from arcutils.settings import init_settings init_settings() This adds a few default settings for bootstrapping ...
# Copyright (c) 2010-2012 OpenStack Foundation # # 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 agree...
# -*- coding: utf-8 -*- """ Created on Thu Apr 9 21:03:57 2020 @author: Mehul """ #importing the libraries import numpy as np import matplotlib.pyplot as plt import pandas as pd import random import warnings from matplotlib import style from collections import Counter from math import sqrt style.use(...
# -*- coding:utf-8 -*- from mongoengine import (IntField, DateTimeField, StringField, ReferenceField, DictField) from model import BaseModel # from ext import db class Account(BaseModel): name = StringField(max_length=5000, null=False) tel = IntField(null=False) password = StringField(max_length=5000, nu...
import autofit as af import autolens as al from test_autolens.integration.tests.interferometer import runner test_type = "lens_only" test_name = "lens_x2_light__hyper" data_type = "lens_x2_light" data_resolution = "sma" def make_pipeline( name, phase_folders, real_space_shape_2d=(100, 100), real_spac...
from django.test import TestCase, override_settings from model_bakery import baker from rest_framework.test import APIClient from accounts.models import User from core.models import CoreSettings from rest_framework.authtoken.models import Token class TacticalTestCase(TestCase): def authenticate(self): s...
# # Copyright (c) 2017 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...
""" parquet compat """ from __future__ import annotations import io import os from typing import Any from warnings import catch_warnings from pandas._typing import ( FilePath, ReadBuffer, StorageOptions, WriteBuffer, ) from pandas.compat._optional import import_optional_dependency from pandas.errors i...
from builtins import zip from builtins import range from builtins import object import re import csv import unicodecsv from bs4 import BeautifulSoup from openelex.base.load import BaseLoader from openelex.models import RawResult from openelex.lib.text import ocd_type_id, slugify from .datasource import Datasource cl...
# -*- coding: utf-8 -*- """ For more information on this file, see https://docs.djangoproject.com/en/1.11/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os import re from django.template import base # from typing import List # B...
""" If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000. """ def mul_sum(a: int=3, b: int=5): max_num = 1000 all_nums = [x for x in range(1, max_num) if (x % 3 == 0) | (x % 5 ==...
from ..adapter import CustomSocialAccountAdapter def test_authentication_error_logs(mocker): mocker.patch( "allauth.socialaccount.adapter.DefaultSocialAccountAdapter.authentication_error" ) # noqa error = mocker.patch("{{cookiecutter.project_slug}}.multisalesforce.adapter.logger.error") adapt...
from pydantic import BaseSettings class Settings(BaseSettings): APP_ENDPOINT: str = 'localhost:8080' CONFIG_PATH: str = None DATACENTER_ID: int = 0 WORKER_ID: int = 0
#!/usr/bin/env python """Django's command-line utility for administrative tasks.""" import os import sys def main(): """Run administrative tasks.""" os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'offline.settings') try: from django.core.management import execute_from_command_line except Impo...
import os from PIL import Image #Vérification rep_cour=os.getcwd() if rep_cour!="C:\Documents and Settings\Administrateur\Bureau\ISN/trait_img": os.chdir("C:\Documents and Settings\Administrateur\Bureau\ISN/trait_img") print(os.getcwd()) print("Tout est en ordre!") #Paramètres de l'image + son affichage...
# -*- coding: utf-8 -*- """Test sequences for graphiness. """ # Copyright (C) 2004-2018 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import heapq import networkx as nx __author__ = "\n".join(['Aric Hagberg...
import logging import operator import time import traceback from pathlib import Path from typing import List, Type, Set, Tuple, Optional from PyQt5.QtCore import QEvent, Qt, pyqtSignal from PyQt5.QtGui import QIcon, QWindowStateChangeEvent, QCursor from PyQt5.QtWidgets import QWidget, QVBoxLayout, QCheckBox, QHeaderVi...
from fastapi import FastAPI from fastapi.testclient import TestClient app = FastAPI() @app.get("/api/v1/healthcheck") async def read_main(): return "OK" @app.post("/api/v1/query") async def query(): return [{"event_date": "20210105"}] client = TestClient(app) def test_read_main(): response = client.g...
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 from yandex.cloud.datasphere.v1 import app_token_service_pb2 as yandex_dot_cloud_dot_...
import pytest @pytest.mark.usefixtures("smart_setup") class TestObjectValue: def test_get_sheet_object_value(self, smart_setup): smart = smart_setup['smart'] sheet = smart.Sheets.get_sheet(smart_setup['sheet'].id, include='objectValue') assert isinstance(sheet.rows[0].cells[0].object_valu...
import random import time class Athlete(): name = "" health = 100 def __init__(self, newName): self.name = newName print("На ринге появляется новый боец, его имя - ", self.name ) print() def punch(self, other): time.sleep(1) print(self.name, "наносит удар бойцу ", other.name) other.health -= 20 ...
import bagel import numpy as np from sklearn.metrics import precision_recall_curve from typing import Sequence, Tuple, Dict, Optional def _adjust_scores(labels: np.ndarray, scores: np.ndarray, delay: Optional[int] = None, inplace: bool = False) -> np.ndarray: ...
""" This is a library for defining and using particle filters. """ #----------------------------------------------------------------------------- # Copyright (c) 2013, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with...
# -*- coding: utf-8 -*- # Copyright (c) 2015, Mayo Clinic # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # Redistributions of source code must retain the above copyright notice, this # list...
from .connection import Connection
#Split one picture import cv2 import numpy.random as random import numpy as np import os import time #borders #mitochondria #mitochondria borders #PSD #vesicles def is_Img(name): img_type = ('.png', '.jpg', '.jpeg') if name.endswith((img_type)): return True else: return False file_dir_arr = ["axon", "mitocho...
"""payu.cli ======== Command line interface tools :copyright: Copyright 2011 Marshall Ward, see AUTHORS for details. :license: Apache License, Version 2.0, see LICENSE for details """ import argparse from distutils import sysconfig import importlib import os import pkgutil import shlex import subprocess ...
from django.db import models from django.contrib.auth.models import AbstractBaseUser, PermissionsMixin, BaseUserManager from django.conf import settings class UserProfileManager(BaseUserManager): """Manager for user profiles""" def create_user(self, email, name, password=None): """ Create a new user p...
import dash import dash_bootstrap_components as dbc # bootstrap theme # https://bootswatch.com/lux/ external_stylesheets = [dbc.themes.YETI] app = dash.Dash(__name__, external_stylesheets=external_stylesheets, suppress_callback_exceptions=True) server = app.server
# coding: utf-8 __author__ = 'cleardusk' import os.path as osp import time import numpy as np import cv2 import torch from torchvision.transforms import Compose import torch.backends.cudnn as cudnn import _3DDFA_V2.models as models from _3DDFA_V2.bfm import BFMModel from _3DDFA_V2.utils.io import _load from _3DDFA_V...
import sys def sol(): input = sys.stdin.readline N = int(input()) node = [[] for i in range(N)] for i in range(N): vector = list(map(int, input().split(" "))) for j in range(N): if vector[j] == 1: node[i].append(j) for i in range(N): visited = ["...
from .._sign.sphincs_sha256_128f_robust import ffi as __ffi, lib as __lib from .common import _sign_generate_keypair_factory, _sign_sign_factory, _sign_verify_factory PUBLIC_KEY_SIZE = __lib.CRYPTO_PUBLICKEYBYTES SECRET_KEY_SIZE = __lib.CRYPTO_SECRETKEYBYTES SIGNATURE_SIZE = __lib.CRYPTO_BYTES generate_keypair = _sig...
from n0s3p4ss.domain_list import SubdomainList from n0s3p4ss.attack_surface_discoverer import discover from n0s3p4ss.sniffer_switcher_http_status_based import apply_flow_for def sniff(target_domains): subdomains = SubdomainList().list_each_domain_subdomains(target_domains) attack_surfaces = [discover(subdomai...
import DBinterface as DB import random import datetime as dt def print_ranking(my_ranking,ranking_size,top_or_bottom): Tweet="" if top_or_bottom == True: Tweet += ("The first " + ranking_size + " cities with more CO2 emissions due to traffic are: \r\n ") else: Tweet += ("The first " ...
from experiments.experiments.PubIntegBackground import PubIntegBackground import numpy as np if __name__ == "__main__": for i in np.arange(0.0, 10.0, 0.1): PubIntegBackground(correlation=False, listing=True, pub='None', intensity=i)
import logging from typing import Any, Dict, List, Union import bleach import cssutils import markdown from django.conf import settings from django.core.mail import EmailMultiAlternatives, get_connection from django.template.loader import get_template from django.utils.translation import ugettext as _ from i18nfield.s...
# Time: O(n) # Space: O(1) class Solution(object): # @param {integer[]} nums # @return {integer[]} def productExceptSelf(self, nums): if not nums: return [] left_product = [1 for _ in xrange(len(nums))] for i in xrange(1, len(nums)): left_product[i] = left_...
# 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 agreed to in...
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from gaiatest import GaiaTestCase from gaiatest.apps.settings.app import Settings class TestChangeLanguage(GaiaTestCas...
# esle stmt # using else block after for loop s = 0 for i in range(1, 6): s += i else: print("end of for loop!") print("sum =",s) # using else blokc after while loop r = n = 1 while n <= 5: r *= n n += 1 else: print("end of while loop!") print("5! = " + str(r)) if r==3: ...
# Generated by Django 3.0.3 on 2020-04-22 13:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('core', '0018_auto_20200422_1314'), ] operations = [ migrations.AlterField( model_name='user_movie', name='insert_dat...
import os import re import subprocess import logging """ Uses command line pdfinfo utility (from poppler pakage) for various small operations (e.g. get pdf page count). """ logger = logging.getLogger(__name__) def get_pagecount(filepath): """ Returns the number of pages in a PDF document as integer. fi...
import glob import pyclass from sicparse import OptionParser import sys def main(): if len(sys.argv)!=3: print "not enough arguments" return # if (not pyclass.gotgdict()): pyclass.get(verbose=False) # sys.argv = [arg.replace("\"","") for arg in sys.argv] string_found = sy...
from .models import Restriction from django.db.models.signals import post_save from django.dispatch import receiver @receiver(post_save, sender=Restriction) def post_save_restriction(sender, **kwargs): msg = "worked" pass
#!/usr/bin/python from flask import Flask, request, flash, redirect, render_template, jsonify from flaskext.mysql import MySQL from flask_wtf import Form from wtforms import StringField, PasswordField from wtforms.validators import DataRequired import twilio.twiml import random import requests import json import omdb ...
AMOUNTS = [ 99999999999999999999999999999, 0x0, 0x1, 0x1000000000000000000000000, 0x30000000000000, 1000000000000000000, 0x180000000000000, 100000000000000000, 10000000000000000, 1000000000000000, 0x2, 5000000000000000, 0x20, 0x700000000000000, 0x8, 0x3c00...
""" Collection of functions to assist PyDoof modules. """ from collections import Iterable from datetime import date from enum import Enum def parse_query_params(params): """ Parses a query-parameters dictionary into their proper parameters schema. Each key value of the dictionary represents a parameter ...
# coding=utf-8 # flake8: noqa E302 """ Test plugin infrastructure and hooks. """ import sys import pytest # Python 3.5 had some regressions in the unitest.mock module, so use 3rd party mock if available try: import mock except ImportError: from unittest import mock import cmd2 from cmd2 import plugin class...
import json import os from FastAutoAugment.common.common import get_logger, common_init, expdir_abspath from FastAutoAugment.data_aug.train import train_and_eval if __name__ == '__main__': conf = common_init(config_filepath='confs/aug_train_cifar.yaml', param_args=["--autoaug.loader.aug", "...
# coding: utf-8 """ ESPER API REFERENCE OpenAPI spec version: 1.0.0 Contact: developer@esper.io --------------------------------------------------------- Copyright 2019 Shoonya Enterprises Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the Li...
from . import Link def iterate_words(lines): for line in lines: words = line.split() if len(words) == 0: continue for word in words[:-1]: yield word, is_stop_word(word) yield words[-1], True # EOL is considered a stop word def is_stop_word(word): return...
from django.shortcuts import render from catalog.models import Book, Author, BookInstance, Genre from django.contrib.auth.mixins import LoginRequiredMixin def index(request): """View function for home page of site.""" # Generate counts of some of the main objects num_books = Book.objects.all().count() ...
import enum @enum.unique class Flag(enum.IntEnum): NOT_NULL = 1 PRI_KEY = 2 UNIQUE_KEY = 4 MULTIPLE_KEY = 8 BLOB = 16 UNSIGNED = 32 ZEROFILL = 64 BINARY = 128 ENUM = 256 AUTO_INCREMENT = 512 TIMESTAMP = 1024 SET = 2048 PART_KEY = 16384 GROUP = 32767 UNIQUE =...
#!/usr/bin/env python3 # Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 import argparse from distutils.version import StrictVersion import logging as log import os import re import shlex import subprocess import sys # Di...
# -*- coding: utf-8 -*- # @Time : 2020/10/11 上午10:58 # @Author : TaoWang # @Description : 参数配置 import argparse def ArgumentParser(): parser = argparse.ArgumentParser() parser.add_argument('--embed_size', type=int, default=300, help="embedding size of word embedding") parser.add_argument("--epoch",type=i...
""" The ``mlflow.pytorch`` module provides an API for logging and loading PyTorch models. This module exports PyTorch models with the following flavors: PyTorch (native) format This is the main flavor that can be loaded back into PyTorch. :py:mod:`mlflow.pyfunc` Produced for use by generic pyfunc-based deploym...
#!/usr/bin/env python3 # Copyright (c) 2016 The Bitcoin Core developers # Copyright (c) 2017-2018 The Placeholder Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the bumpfee RPC. Verifies that the bumpfee R...
"""The Amazon Redshift dialect. This is based on postgres dialect, since it was initially based off of Postgres 8. We should monitor in future and see if it should be rebased off of ANSI """ from sqlfluff.core.parser import ( OneOf, AnyNumberOf, AnySetOf, Anything, Ref, Sequence, Bracketed,...
import os import cv2 import imutils import numpy as np from imutils import contours from imutils import perspective from scipy.spatial import distance as dist def detect_shape(filepath, min_width=15, debug=False): image = cv2.imread(filepath, 0) resized = imutils.resize(image, width=300) ratio = image.sh...
import numpy as np def euclidean_distance(p1,p2): """ returns euclidean distance between matrices @params: p1, p2: np.ndarray matrices to perform operation to. """ return np.sqrt(np.sum((p1-p2)**2, axis=1)) def entropy(p): """ Will be our measurement for uncertainty in our construction of descisio...
from django.contrib import admin from friends.models import FriendRequest # Register your models here. admin.site.register(FriendRequest)
import _plotly_utils.basevalidators class ConnectgapsValidator(_plotly_utils.basevalidators.BooleanValidator): def __init__( self, plotly_name="connectgaps", parent_name="scattermapbox", **kwargs ): super(ConnectgapsValidator, self).__init__( plotly_name=plotly_name, pa...
#!/bin/python3 __author__ = "Adam Karl" """Find the sum of all primes less than or equal to N""" #https://projecteuler.net/problem=10 from math import sqrt isPrime = [] def sieve(n): """fills isPrime array with booleans for whether the number at isPrime[i] is prime or not""" """uses a process known as the s...
import torch from syft.generic import object_storage def test_clear_objects(): obj_storage = object_storage.ObjectStorage() x = torch.tensor(1) obj_storage.set_obj(x) objs = obj_storage.current_objects() assert len(objs) == 1 assert objs[x.id] == x ret_val = obj_storage.clear_objects(...
from ApiManager.utils.operation import add_project_data, add_module_data, add_case_data, add_config_data, \ add_register_data, bulk_import_data from ApiManager.models import ModuleInfo import yaml '''前端test信息转字典''' def key_value_dict(mode=3, **kwargs): if not kwargs: return None sorted_kwargs = s...
import tensorflow as tf #from tensorflow.python.ops.rnn_cell import * #from tensorflow.python.ops.rnn_cell_impl import _Linear from tensorflow.contrib.rnn.python.ops.core_rnn_cell import * #from tensorflow import keras from tensorflow.python.ops import math_ops from tensorflow.python.ops import init_ops from tensorflo...
import sys # Alternatively just load env variables via your env/bin/activate script if sys.platform.startswith('darwin') or sys.platform.startswith('win'): import json path = "Gigger/utilities/env_local.json" with open(path) as json_file: global CONFIG CONFIG = json.load(json_file) else: ...
import logging import six import ddtrace from ddtrace.compat import StringIO from ddtrace.constants import ENV_KEY from ddtrace.constants import VERSION_KEY from ddtrace.contrib.logging import patch from ddtrace.contrib.logging import unpatch from ddtrace.contrib.logging.patch import RECORD_ATTR_SPAN_ID from ddtrace....
# -*- coding: utf-8 -*- ''' Helpful decorators for module writing ''' # Import python libs from __future__ import absolute_import import inspect import logging import time from functools import wraps from collections import defaultdict # Import salt libs import salt.utils import salt.utils.args from salt.exceptions i...
#!/usr/bin/env python3 import argparse import boutvecma import easyvvuq as uq import chaospy import os import numpy as np import time import matplotlib.pyplot as plt CAMPAIGN_NAME = "Conduction." def refine_sampling_plan(campaign, analysis, number_of_refinements): """ Refine the sampling plan. Paramet...
import machine, time from machine import Pin __version__ = '0.2.0' __author__ = 'Roberto Sánchez' __license__ = "Apache License 2.0. https://www.apache.org/licenses/LICENSE-2.0" class HCSR04: """ Driver to use the untrasonic sensor HC-SR04. The sensor range is between 2cm and 4m. The timeou...
#!/usr/bin/env python # Copyright 2021-2022 NVIDIA 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 appli...
import pytest import os import RaveEngine.projectManager as projectManager import RaveEngine.botManager as botManager import RaveEngine.configManager as configManager import Utils.commandManager as commandManager from flaky import flaky import Utils.sad as sad import Utils.utils as utils @pytest.fixture(autouse=True) ...
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from conftest import Mock import responses class TestIP(object): @responses.activate def test_get_ip(self, manager): data = Mock.mock_get('ip_address/10....
from rpython.rlib.rarithmetic import LONG_BIT, intmask, longlongmask, r_uint, r_ulonglong from rpython.rlib.rarithmetic import ovfcheck, r_longlong, widen from rpython.rlib.rarithmetic import most_neg_value_of_same_type from rpython.rlib.rfloat import isinf, isnan from rpython.rlib.rstring import StringBuilder from rpy...
import tvm import tvm._ffi import numpy as np from functools import reduce from tvm.tensor_graph.core.utils import to_int, to_tuple, flatten_tir_graph, op_feature def make_tir_graph(fwd_graph, loss=None, optimizer=None, inference=True, need_output=True, need_grad=True): if inference: finputs, foutputs, fw...
# Copyright (c) 2012 OpenStack Foundation # # 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 ...
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Persistent identifier fetchers. A proper fetcher is defined as a function that re...
import logging,os from rest import Restclient LOCAL_DATA_FOLDER = '/DATA' GENOTYPE_FOLDER = '/GENOTYPE' REST_HOST = os.environ['REST_HOST'] REST_USERNAME = os.environ['REST_USERNAME'] REST_PASSWORD = os.environ['REST_PASSWORD'] restclient = Restclient(REST_HOST,REST_USERNAME,REST_PASSWORD) class CeleryProgressLogHa...
import os from collections import OrderedDict import matplotlib.pyplot as plt import pandas _ramachandran_densities = pandas.read_csv( 'data/rama500-general.data', skiprows=6, delimiter=' ', names=['phi', 'psi', 'value'] ) """ DSSP output: H = α-helix B = residue in isolated β-bridge E =...
""" This is a dummy file used only to avoid errors in ReadTheDocs. The real BF.py is created during the setup once swig is run. """ def CP(): pass def LeP(): pass def LaP(): pass def HoPpro(): pass def HoPphy(): pass def FS(): pass def ELMReLU(): pass def ELMSigmoid(): pa...
seq = 'CTTCTCACGTACAACAAAATC' symbol2number = {"A":0,"C":1,"G":2,"T":3} def PatternToNumber(Pattern): if not Pattern: return 0 symbol = Pattern[-1] prefix = Pattern[:-1] return ((4*PatternToNumber(prefix))+symbol2number[symbol]) def NumberToPattern(index, k): bases = ['A', ...
import os from dotenv import load_dotenv, find_dotenv #this will load all the envars from a .env file located in the project root (api) load_dotenv(find_dotenv()) CONFIGURATION = { "development": "config.DevConfig", "testing": "config.TestConfig", "production": "config.Config", "default": "config.Conf...
# Execution time : 0.003847 seconds # Solution Explanation # A simple brute-froce approach is enough import time width = 40 from functools import reduce def solution(): v = list() v.append([0]*23) v.append([0]*23) v.append([0]*23) for line in open('input_p011.in','r'): v.append(list(map...
import sys config = { "Database": { "Address": "localhost", "Username": "root", "Password": "", "Name": "Houdini", "Driver": "PyMySQL" if sys.platform == "win32" else "MySQLdb" }, "Redis": { "Address": "127.0.0.1", "Port": 6379 }, "Servers": { "Login": { "Address": "127.0.0.1", "Port": 6112, ...
# GENERATED BY KOMAND SDK - DO NOT EDIT from setuptools import setup, find_packages setup(name='haveibeenpwned-rapid7-plugin', version='4.0.2', description='Determine if a user, domain, or password has been leaked via data available in the Have I Been Pwned database', author='rapid7', author_e...