text
stringlengths
2
999k
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Test Server Settings """ from freehackquest_libclient_py import FreeHackQuestClient def test_0001_cleanup_users(admin_session, admin_password): """ test_0001_cleanup_users """ print(test_0001_cleanup_users.__doc__) _user_email = [ "user1", ...
import matplotlib.pyplot as plt from __future__ import print_function import numpy as np import umap import torch import torch.nn as nn import torch.nn.functional as F from torch.utils.data import DataLoader import torch.optim as optim import torchvision.datasets as datasets import torchvision.transforms as transf...
#!/usr/bin/env python desc="""Report FASTA statistics. Support gzipped files. Statistics are stored as .fai formatted file (http://www.htslib.org/doc/faidx.html), with 4 extended columns, storing counts for A, C, G & T for each sequence. """ epilog="""Author: l.p.pryszcz+git@gmail.com Mizerow/Bratislava, 26/08/2014 "...
# Generated by Django 3.1.2 on 2021-01-14 02:53 from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('edukasi', '00...
# Copyright (c) 2013 Mirantis 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 agreed to in writi...
# -*- coding: utf-8 -*- """Public section, including homepage and signup.""" from flask import ( Blueprint, current_app, flash, redirect, render_template, request, url_for, ) from flask_login import login_required, login_user, logout_user from one_hack_mc_conversation.extensions import logi...
from itertools import chain def get_aslist(param_or_header): """Checks if parameter/header is described as list for simpler scenarios""" # if schema is not defined it's a complex scenario if 'schema' not in param_or_header: return False schema = param_or_header / 'schema' schema_type = sc...
"""Support for various GEOS geometry operations """ import sys if sys.version_info[0] < 3: from itertools import izip else: izip = zip from ctypes import byref, c_void_p, c_double from shapely.geos import lgeos from shapely.geometry.base import geom_factory, BaseGeometry from shapely.geometry import asShape...
# Copyright 2021 Google LLC # # 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, ...
""" ep_hxc.py """ import numpy as np def ep_hxc(self): """ calculate dft components of Ep """ if self.optPartition.interaction_type == "dft": ###Hartree ehm = 0.5 * self.hartree.v_hartree( np.sum(self.nf, axis=1) ) Ehm = self.grid.integrate( np.sum(self.nf, axis=1) * ehm[:,0] ...
import logging import pytest from bluesky.plan_stubs import rel_set from bluesky.preprocessors import run_wrapper from ophyd.sim import SynAxis from ..plans.preprocessors import return_to_start logger = logging.getLogger(__name__) m1 = SynAxis(name="m1") m2 = SynAxis(name="m2") motors = [m1, m2] @pytest.mark.para...
from __future__ import unicode_literals import os import unittest from errno import ECONNREFUSED from socket import error as SocketError from tempfile import mkdtemp from reviewboard.scmtools.core import HEAD from reviewboard.scmtools.errors import SCMError, AuthenticationError from reviewboard.scmtools.models import...
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2019, John McNamara, jmcnamara@cpan.org # import unittest from ...compatibility import StringIO from ...vml import Vml class TestWriteXAutoFill(unittest.TestCase): """ Test the Vm...
from setuptools import setup, find_packages setup( name='browserlog', version='1.0.0', package_dir={'': 'src'}, description='Masonite Log Viewer', long_description=open("README.md", "r", encoding="utf-8").read(), url='https://github.com/hellomasonite/browserlog', author='Junior Gantin', ...
import os.path as osp import cv2 import numpy as np from pycocotools.coco import COCO from detection.datasets import transforms, utils class CocoDataSet(object): def __init__(self, dataset_dir, subset, flip_ratio=0, pad_mode='fixed', mean=(0, 0, 0), ...
# coding: utf-8 import pprint import re # noqa: F401 import six class Body13(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. """ """ Attributes: swagger_types (dict): The key is attribute name ...
from flask import Flask, render_template app = Flask(__name__, static_folder='.', static_url_path='') @app.route('/') def home(): return app.send_static_file("try_flask_index.html") @app.route('/echo/<thing>') def echo(thing): return render_template('flask2.html', thing=thing) @app.route('/hoho/<thing>/<pla...
# -*- coding: utf-8 -*- # # flake8: noqa # Disable Flake8 because of all the sphinx imports # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF lice...
patchkeymap = [ "a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t", "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T", "1","2","3","4","5","6","7","8","9","0" ] effectkeymap = ["F1","F2","F3","F4","F5","F6"] tunerkey = "F9" emptypatch = [ 0xf0,0x52,0x0...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.async_support.base.exchange import Exchange import math from ccxt.base.errors import ExchangeError from ccxt.base.errors import A...
import argparse import sys import unittest import requests from util.Api import Api from util.Dredd import Dredd from util.Docker import Docker from time import sleep class CatalogueContainerTest(unittest.TestCase): TAG = "latest" container_name = 'catalogue' mysql_container_name = Docker().random_contain...
# -*- coding: utf-8 -*- """ pip_services3_commons.convert.MapConverter ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Map conversion utilities :copyright: Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details. :license: MIT, see LICENSE for more details. """ from typing impor...
# Copyright 2017 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...
import matplotlib.pyplot as plt import matplotlib.image as mpimg import numpy as np import cv2 import os from moviepy.editor import VideoFileClip from IPython.display import HTML from processimage import LaneDetection ld = LaneDetection() videolist = os.listdir("test_videos/") for videoname in videolist: outputd...
#our web app framework! #you could also generate a skeleton from scratch via #http://flask-appbuilder.readthedocs.io/en/latest/installation.html #Generating HTML from within Python is not fun, and actually pretty cumbersome because you have to do the #HTML escaping on your own to keep the application secure. Because ...
#-*- coding:utf-8 -*- #''' # Created on 18-12-11 上午10:05 # # @Author: Greg Gao(laygin) #''' import numpy as np import cv2 from detect.config import * def resize(image, width=None, height=None, inter=cv2.INTER_AREA): # initialize the dimensions of the image to be resized and # grab the image size dim = Non...
""" Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT """ # Test case ID : C4976199 # Test Case Title : Verify that with higher linear damping, the object in motion come...
# working with different topologies import neal import dimod import dwave_networkx as dnx import networkx as nx import dwave.embedding from dwave.system import DWaveSampler, EmbeddingComposite # Creating a Pegasus Sampler P6 = dnx.pegasus_graph(6) classical_sampler = neal.SimulatedAnnealingSampler() sampler = di...
from NeuroPy import NeuroPy from time import sleep neuropy = NeuroPy("COM3") neuropy.start() while True: if neuropy.meditation > 70: # Access data through object neuropy.stop() sleep(0.2) # Don't eat the CPU cycles
import numpy as np from sklearn.gaussian_process.kernels import RBF, ConstantKernel, Matern from sklearn.gaussian_process import GaussianProcessRegressor from .acquisitionfunc import UCB, EI from .optimizer import DifferentialEvolution,LBFGSB, OptimizerResult from .chooser import MaxAcquisition import seaborn as sns im...
from setuptools import setup, find_namespace_packages # read the contents of your README file from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='airflow-hdinsight', ver...
""" Django settings for learning project. Generated by 'django-admin startproject' using Django 2.2. For more information on this file, see https://docs.djangoproject.com/en/2.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/2.2/ref/settings/ """ import os # ...
from os.path import abspath, dirname, join from sys import path, stderr path.insert(1, join(dirname(dirname(abspath(__file__))), 'common')) ######################################################################## def main(name, wrapped, upload_headers, **extras): __pychecker__ = 'no-argsused' from gi.repos...
import copy from pkg_resources import resource_filename import unittest import astropy.units as q import numpy as np from .. import relations as rel class TestSpectralTypeRadius(unittest.TestCase): """Tests for the SpectralTypeRadius class""" def setUp(self): # Make Spectrum class for testing ...
from src.day01.day01 import number_of_grouped_increases, number_of_increases def test_part1(): example_readings = [199, 200, 208, 210, 200, 207, 240, 269, 260, 263] example_answer = 7 assert number_of_increases(example_readings) == example_answer def test_part2(): example_readings = [199, 200, 20...
# -*- coding: utf-8 -*- # # data_store.py - Generic, general purpose data store # # This file is part of debexpo - https://alioth.debian.org/projects/debexpo/ # # Copyright © 2011 Arno Töll <debian@toell.net> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software a...
import re from datetime import date from django.core.validators import URLValidator from django.forms import ValidationError from django.utils.translation import get_language from django_jinja import library import jinja2 from mozillians.users import get_languages_for_locale PARAGRAPH_RE = re.compile(r'(?:\r\n|\r|...
# Copyright The PyTorch Lightning team. # # 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 i...
""" ============================ ``ctypes`` Utility Functions ============================ See Also --------- load_library : Load a C library. ndpointer : Array restype/argtype with verification. as_ctypes : Create a ctypes array from an ndarray. as_array : Create an ndarray from a ctypes array. Reference...
#!/usr/bin/env python3 """ An entry into the ml4seti signal classifier competition. This entry is simply a large densenet architecture convolutional neural network. For more information, see "Densely Connected Convolutional Networks" <https://arxiv.org/pdf/1608.06993.pdf> """ import argparse import time import sklear...
import re class Result(): def parseTranslatorContent(content): tokens = content.split("\n") idx = [] for section in ["[VOCABULARY]", "[REJECTED]", "[L1]", "[L2]"]: idx.append(tokens.index(section)) L1 = "\n".join(tokens[idx[2]+1:idx[3]]).strip() L2 = "\n".join(t...
from itertools import product import operator import numpy as np import pytest from pandas.compat.numpy import _np_version_under1p18 import pandas.util._test_decorators as td import pandas as pd from pandas import ( Categorical, CategoricalIndex, DataFrame, Series, date_range, isna, notna...
from mycroft import MycroftSkill, intent_file_handler class InternalNetworkForProductionMachines(MycroftSkill): def __init__(self): MycroftSkill.__init__(self) @intent_file_handler('machines.production.for.network.internal.intent') def handle_machines_production_for_network_internal(self, message...
"""Module browser. XXX TO DO: - reparse when source changed (maybe just a button would be OK?) (or recheck on window popup) - add popup menu with more options (e.g. doc strings, base classes, imports) - add base classes to class browser tree - finish removing limitation to x.py files (ModuleBrowserTreeItem) """ ...
from consumer import OpenIdAbstractAuthConsumer from forum.authentication.base import ConsumerTemplateContext class GoogleAuthConsumer(OpenIdAbstractAuthConsumer): def get_user_url(self, request): return 'https://www.google.com/accounts/o8/id' class GoogleAuthContext(ConsumerTemplateContext): mode = '...
# encoding: utf-8 import json import six import tableschema from ckantoolkit import Invalid, config # Input validators def resource_schema_validator(value, context): if not value: return msg = None if isinstance(value, six.string_types): if value.lower().startswith('http'): ...
#!/usr/bin/env python """Unit tests for M2Crypto.Engine.""" try: import unittest2 as unittest except ImportError: import unittest from M2Crypto import Engine class EngineTestCase(unittest.TestCase): privkey = 'tests/rsa.priv.pem' bad_id = '1bea1edfeb97' def tearDown(self): Engine.clea...
import pdf_to_json as p2j import json url = "file:data/multilingual/Cyrl.SRP/Serif_8/udhr_Cyrl.SRP_Serif_8.pdf" lConverter = p2j.pdf_to_json.pdf_to_json_converter() lConverter.mImageHashOnly = True lDict = lConverter.convert(url) print(json.dumps(lDict, indent=4, ensure_ascii=False, sort_keys=True))
import torch import torch.nn as nn import torch.nn.functional as F import math class Classifier(nn.Module): def __init__(self, num_classes, in_channels, pooler_resolution): super(Classifier, self).__init__() self.num_class = num_classes self.fc_512 = nn.Linear(in_channels * pooler_resoluti...
##################################################### # Copyright (c) Xuanyi Dong [GitHub D-X-Y], 2019.08 # ##################################################### import os, sys, time, argparse, collections import numpy as np import torch from pathlib import Path from collections import defaultdict, OrderedDict from typ...
import sys i_wordCounts=dict() whole_phraseCounts=dict() ngram_counts=dict() text_field=0 lineCount=0 with open('../nci_data/dataset1-trials/Hemoglobin_CTEP Trials_072018.tsv', encoding="utf8", errors='ignore') as in_file1: for line in in_file1: if line.strip()=="": break fields=line.strip().split("\t") if...
from datetime import datetime, timezone from typing import Optional from pydantic import UUID4, AnyUrl, BaseModel, Field class LinkSettingsModel(BaseModel): title: str = "" description: str = "" archived: bool = False class LinkBaseModel( BaseModel, ): url: AnyUrl alias: str = Field(..., mi...
from datetime import datetime, timedelta from airflow import DAG from airflow.operators.bash import BashOperator default_args = { 'owner': 'metin', 'retries': 5, 'retry_delay': timedelta(minutes=5) } with DAG( catchup=False, default_args=default_args, dag_id="dag_with_cron_expression_v04", ...
import keras from typing import List import cv2 import tensorflow import numpy as np from easy_inference.models import BaseModel """ This code is for easily running the variational autoencoder models that I make """ class VariationalEncoder(BaseModel): def __init__(self, keras_model): self.model = kera...
from rest_framework import serializers from iiif_api_services.models.ManifestModel import Manifest from rest_framework_mongoengine.serializers import DocumentSerializer class ManifestSerializer(DocumentSerializer): class Meta: model = Manifest fields = '__all__' class ManifestViewSerializer(Docu...
# -*- coding: utf-8 -*- from collections import OrderedDict from datetime import datetime, time, timedelta from django.contrib import messages from django.contrib.auth.decorators import login_required from django.contrib.contenttypes.models import ContentType from django.core.exceptions import PermissionDenied from d...
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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) an...
################################ # val: number(float)/string(str)/sql(dict) # col_unit: (agg_id, col_id, isDistinct(bool)) # val_unit: (unit_op, col_unit1, col_unit2) # table_unit: (table_type, col_unit/sql) # cond_unit: (not_op, op_id, val_unit, val1, val2) # condition: [cond_unit1, 'and'/'or', cond_unit2, ...] # sql ...
# The MIT License (MIT) # # Copyright (c) 2015-present, Xiaoyou Chen # # 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, including without limitation the rights # to use, c...
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: http://foglamp.readthedocs.io/ # FOGLAMP_END import json from enum import IntEnum from collections import OrderedDict from aiohttp import web from foglamp.common.storage_client.payload_builder import PayloadBuilder from foglamp.services.core import connect __author__ = ...
"""shakespearebot 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') Clas...
"""Desenvolva em cada LP um programa para aprovar o empréstimo bancário para compra de uma casa. O programa deve perguntar o valor da casa a comprar, o salário e a quantidade de anos a pagar. O valor da prestação mensal não pode ser superior a 30% do salário. Calcule o valor da prestação como sendo o valor da casa a ...
import uuid from datetime import datetime from werkzeug.exceptions import NotAcceptable from database.models import User, Datamart, Metadata, MongodbStorage, PostgresqlStorage, CsvStorage, \ XmlStorage, JsonStorage, DatamartStatus from settings import Settings settings = Settings() def __get_target__(source, t...
import logging import os import re import requests import socket import time import sys import geoip2.database from geopy.geocoders import Nominatim import jinja2 from gevent.pywsgi import WSGIServer from gevent.monkey import patch_all from gevent.subprocess import Popen, PIPE patch_all() import dns.resolver from dn...
# -*- coding: utf-8 -*- # Unit and doctests for specific database backends. from __future__ import unicode_literals import copy import datetime from decimal import Decimal import re import threading import unittest from django.conf import settings from django.core.management.color import no_style from django.db impor...
from models.hsts_result import HstsResult from models.requirements import Requirements, RequirementsResult from reports.constants import HSTS_MISSING, NO_ISSUES, REQ_TITLES class HstsAnalyzer(object): def __init__(self, hsts_scan: HstsResult, requirements: Requirements): self.scan = hsts_scan self...
description = "Instrument shutter" devices = dict( fast_shutter=device("nicos.devices.generic.ManualSwitch", description="Shutter just before the sample", states=["Open", "Closed"], ), heavy_shutter=device("nicos.devices.generic.ManualSwitch", description="Main shutter", sta...
# ------------------------------------------------------------------------------ # Numerical Damping Compensation - Case A-1 # ------------------------------------------------------------------------------ ### Import some useful functions import sys sys.path.append('../') from pathlib import Path import numpy as np fr...
class Solution(object): def missingNumber(self, nums): """ :type nums: List[int] :rtype: int """ # first pass: create cache d = {} for i in nums: d[i] = 1 # second pass: scan for the missing one for i in range(len(nums)+1): ...
# Copyright 2018 The TensorFlow Probability 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 applicable law o...
try: import requests except ModuleNotFoundError: print("[-] Requirements not satisfied!\n\trun 'pip install -r requirements.txt'\n\t\tOR\n\trun 'pip3 install -r requirements.txt'") quit() stages = [''' +----+ | X /|\ / \ =========''', ''' +----+ | O /|\ / \ ...
import time import random class Genetic: def __init__(self,target,population_number): self.gene_pool = '''abcçdefgğhıijklmnoöpqrsştuüvwxyzABCÇDEFGĞHİIJKLMNOÖPQRŞSTUÜVWXYZ 1234567890,.-;:_!"#%&/()=?@${[]}''' self.target = target self.population_number = population_number self.targ...
nun = 0 while (nun != -1): nun = int(input()) if nun == 0: print(nun) elif nun >= 1 and nun <= 10 ** 19: print(nun - 1)
import random def stochastic_hillclimbing(state): expand = 0 generate = 0 while 1: steep = [] neighbors = [] next_state = state.copy() current = attacking_queens(next_state) if current == 0: print("No of nodes generated:") print(generate) ...
/* Knuth Morris Prath String Search algorithm Implementation */ package kmp //Table Building Algorithm func preKMP(T *[]int, pat string) { var i = 0 var j = -1 (*T)[0] = -1 length := len(pat) - 1 for i < length { for j > -1 && pat[i] != pat[j] { j = (*T)[j] } i++ j++ if pat[i] == pat[j] { (...
############################################################################## # pip install recipe for conduit ############################################################################## # # Recipe that uses cmake to build conduit for use in python. # # Optional Conduit features are enabled via env vars: # # HDF5_...
class Solution: def countAndSay(self, n: int) -> str: if not n: return "" result = "1" current = 1 while current < n: new_result = "" idx = 0 while idx < len(result): letter = result[idx] count = 1 ...
from __future__ import unicode_literals import os import frappe from frappe import _ from frappe.utils import get_site_path, cint, get_url from frappe.utils.data import convert_utc_to_user_timezone import datetime def get_context(context): def get_time(path): dt = os.path.getmtime(path) return convert_utc_to_user...
import Image ,ImageEnchance def main(): filename = 'file.jpeg' image = Image.open(filename) size = width,height =image.size enhancer = ImageEnchance.Brightness( image ) image=enhancer.Sharpness(2.0) image.save("modified_"+filename) del image if(__name__=="__main__"): ...
#!/usr/bin/python3 import numpy as np from scipy.integrate import simps import sys _nPoints = 5001 _eps = np.finfo(np.pi).eps def checkAirfoilType(airfoilCode): if len(airfoilCode) == 4: return 'NACA4' elif len(airfoilCode) == 5: return 'NACA5' else: raise ValueError('Invalid airf...
# Generated by Django 2.1.5 on 2019-01-08 05:11 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0009_alter_user_last_name_max_length'), ] operations = [ migrations.CreateModel( name='User', ...
import os from flask_script import Manager from bdc_geoserver import app manager = Manager(app) @manager.command def run(): HOST = os.environ.get('SERVER_HOST', '0.0.0.0') try: PORT = int(os.environ.get('PORT', '5000')) except ValueError: PORT = 5000 app.run(HOST, PORT) @manager.com...
# Software License Agreement (BSD License) # # Copyright (c) 2008, Willow Garage, Inc. # 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...
from . import homosapiens from . import musmusculus from .class_interface import TopologyContainer TOPOLOGIES = { "Mus musculus": { "celltype": { "marker": musmusculus.celltype.celltypemarker.CELLTYPEMARKER_TOPOLOGIES, "mlp": musmusculus.celltype.celltypemlp.CELLTYPEMLP_TOPOLOGIES ...
# MIT LICENSE # # Copyright 1997 - 2020 by IXIA Keysight # # 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, including without limitation # the rights to use, copy, modify,...
# flake8: noqa import pytest import asyncio import functools from graphql.error import format_error from graphql.execution import execute from graphql.language.parser import parse from graphql.execution.executors.asyncio import AsyncioExecutor from graphql.type import ( GraphQLSchema, GraphQLObjectType, Gra...
# coding: utf-8 """ API Specification # Introduction Welcome to gridscales API documentation. A REST API is a programming interface that allows you to access and send data directly to our systems using HTTPS requests, without the need to use a web GUI. All the functionality you are already familiar with in y...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """Celestial coordinate utility functions. """ from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np from numpy import (cos, sin, arccos, arcsin, arctan2, radians, degrees, pi) __all__ = [...
import pytest from pyvst import SimpleHost def _find_test_synths(): return _find_test_plugins('.test_synths_paths.txt') def _find_test_effects(): return _find_test_plugins('.test_effects_paths.txt') def _find_test_plugins(paths_file): """ One plugin path per line in a file Lines starting with...
from unittest.mock import patch from accounts.models import APIKey, User from accounts.serializers import APIKeySerializer from django.test import override_settings from model_bakery import baker, seq from tacticalrmm.test import TacticalTestCase class TestAccounts(TacticalTestCase): def setUp(self): se...
# restricting the access of vulnarable code class Customer: def __init__(self, cust_id, name, age, wallet_balance): self.cust_id = cust_id self.name = name self.age = age self.__wallet_balance = wallet_balance # data encapsulated def update_balance(self, amount): if amo...
def sample_inputs(all_inputs, max_budget): """Importance sampling based input selection. Returns: A sample of the most important input. """ budget = max_budget selected_inputs = [] edges = get_coverage(all_inputs) "Sort the inputs from most to least recent" sorted_inputs = sort_by_recency(all_input...
import os import sys import torch import json import toml from datetime import datetime from tqdm import tqdm from glob import glob import soundfile as sf import numpy as np from tensorboardX import SummaryWriter sys.path.append(os.path.abspath(os.path.join(__file__, '..', '..'))) from hearinglossmodel import MSBGHear...
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ Estimating the susceptibility distortions without fieldmaps. .. testsetup:: >>> tmpdir = getfixture('tmpdir') >>> tmp = tmpdir.chdir() # changing to a temporary directory >>> data = np.zer...
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved # # Generated by configen, do not edit. # See https://github.com/facebookresearch/hydra/tree/master/tools/configen # fmt: off # isort:skip_file # flake8: noqa from dataclasses import dataclass, field from omegaconf import MISSING from typing import...
""" Auto-generated class for Signature """ from datetime import datetime from six import string_types from jumpscale import j from . import client_support class Signature(): """ auto-generated. don't touch. """ @staticmethod def create(**kwargs): """ :type date: datetime :...
import traceback import sys from entity_info import EntityInfo property_file = "../data_ingest.properties" entity_types = ['Donor', 'Sample', 'Dataset'] try: info = EntityInfo(property_file) info.print_all_ids() sys.exit(0) except Exception as e: print("Error during execution.") print(str(e)) ...
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from __future__ import unicode_literals from ..gtract import gtractCostFastMarching def test_gtractCostFastMarching_inputs(): input_map = dict( anisotropyWeight=dict(argstr='--anisotropyWeight %f', ), args=dict(argstr='%s', ), environ=d...
# -*- coding: utf-8 -*- """The shell item event formatter.""" from plaso.formatters import interface from plaso.formatters import manager from plaso.lib import errors class ShellItemFileEntryEventFormatter(interface.ConditionalEventFormatter): """Formatter for a shell item file entry event.""" DATA_TYPE = u'win...
# Generated by Django 3.1 on 2021-11-15 21:48 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('orders', '0003_auto_20211115_2148'), ('payments', '0002_auto_20211018_2221'), ] operations = [ migrations.RenameModel( old_name='P...