text
stringlengths
2
999k
from django.utils.translation import gettext_lazy as _ from django.utils.translation import ngettext from wagtail.admin.views.pages.bulk_actions.page_bulk_action import PageBulkAction class PublishBulkAction(PageBulkAction): display_name = _("Publish") action_type = "publish" aria_label = _("Publish sele...
# 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...
# -*- coding: utf-8 -*- """ test_build_base ~~~~~~~~~~~~~~~ Test the base build process. :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import shutil import pytest from sphinx.testing.util import find_files @pytest.fixture def setup...
import FWCore.ParameterSet.Config as cms # adapt the L1TEMUMonitorClient_cff configuration to offline DQM # # default configuration valid for online DQM # # configuration for online DQM # process subsystem histograms in endLumi # process subsystem histograms in endRun # # configuration for offline DQM # proc...
from __future__ import absolute_import, unicode_literals import uuid from collections import defaultdict from copy import copy from django.conf.urls import url from django.db import connections from django.utils.translation import ugettext_lazy as _, ungettext_lazy as __ from debug_toolbar.panels import Pa...
#!/usr/bin/env python from __future__ import division from builtins import str from builtins import range from builtins import object import os, sys, time, json, requests, logging import re, traceback, argparse, copy, bisect from xml.etree import ElementTree #from hysds_commons.job_utils import resolve_hysds_job #from ...
# General import numpy as np # Data import data_intercity as data_file def logsumNestedLogitRegulator(data): data['LogitUtility'] = np.empty([data['I_tot'],data['N'],data['R']]) data['Logsum'] = np.empty([data['I_tot'],data['N'],data['R']]) #PART 1: LOGIT for i in range(data['I_tot']...
# parsetab.py # This file is automatically generated. Do not edit. # pylint: disable=W,C,R _tabversion = '3.10' _lr_method = 'LALR' _lr_signature = 'AND ATTR BOOLEAN CLASS COLON DOT ELSE EQUALS EXTENDS FALSE GEQTHAN GTHAN ID IF INT LBRACKET LENGTH LEQTHAN LKEY LPAREN LTHAN MAIN MINUS NEQUALS NEW NOT NULL NUMBER PLUS...
######################################################## # evaluator.py # Author: Jamie Zhu <jimzhu@GitHub> # Created: 2014/2/6 # Last updated: 2015/8/30 ######################################################## import numpy as np import time from commons.utils import logger # import from ../../commons from l...
from sqlalchemy import Column, DateTime, Integer from sqlalchemy.orm import relationship from datetime import datetime import pytz from scoring_engine.models.base import Base from scoring_engine.config import config from scoring_engine.db import session class Round(Base): __tablename__ = "rounds" id = Colum...
#!/home/zhangzhengde/bin/bin/python3 # coding=utf-8 import os import argparse import VaspCZ.zzdlib as zzd def modify_vasp_sh(jobname, nodes, ppn): with open('./Vasp.sh', 'r') as f: data = f.readlines() new_data = [] for line in data: if ' #PBS -N' in line: new_data.append(f' #PBS -N {jobname}\n') elif ' ...
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os from collections import Mapping from datetime import datetime from .auth import _basic_auth_str from .compat import cookielib, Ord...
#=============================================================================== # #Autor: Rosenio Pinto # #e-mail: kenio3d@gmail.com #=============================================================================== #=============================================================================== # #Simple console dialog...
#!/usr/bin/env python3 """Run all scripts""" __author__ = 'Stephen Diehl' import argparse import sys import subprocess def get_parser(): """Args Description""" # current_year = datetime.datetime.today().year parser = argparse.ArgumentParser( description=__doc__, formatter_class=argpars...
# Ported from: https://github.com/deepmind/sonnet/blob/v2/examples/vqvae_example.ipynb. import torch from torch import nn from torch.nn import functional as F class ResidualStack(nn.Module): def __init__(self, num_hiddens, num_residual_layers, num_residual_hiddens): super().__init__() # See Sect...
import re from . import UVSubSideBar as _UVSubSideBar import maya.mel as mel import sys import maya.cmds as cmds import os from PySide.QtGui import * from PySide.QtCore import * from random import randint from maya.app.general.UVSubSideBar import UVSubSideBar from maya.app.general.UVGroupSection import UVGroupSection...
# Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
from django.utils.translation import gettext_lazy as _ # This is the list of possible bases. Revenues are booked by receipt # and are not approved, so paymentDate and approvalDate are actually # receivedDate for revenues. EXPENSE_BASES = { 'accrualDate': _('Date of Accrual (e.g. Series end date)'), 'submissio...
import numpy as np from ensembler.conditions._basicCondition import _conditionCls from ensembler.util.ensemblerTypes import systemCls as systemType, Iterable, Number, Union class _boundaryCondition(_conditionCls): """ This parent class is defining some functions for the actual box conditions. """ lo...
# -*- coding: utf-8 -*- # (c) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com> # MIT License (see LICENSE or https://opensource.org/licenses/MIT) from __future__ import (absolute_import, division, print_function) __metaclass__ = type # noqa (fixes E402 for the imports below) import sys import pytest from spn...
""" resample ======== Randomisation-based inference in Python based on data resampling and permutation. Features -------- - Bootstrap samples (ordinary or balanced with optional stratification) from N-D arrays - Apply parametric bootstrap (Gaussian, Poisson, gamma, etc.) on samples - Compute bootstrap confidence int...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Implements key derivation routines. These are mostly meant to be used as modifiers for multibin expressions that can be passed as key arguments to modules in `refinery.units.crypto.cipher`. """ import importlib from refinery.units import Arg, Unit from refinery.lib.ar...
t = int(input()) answer = [] for a in range(t): n = int(input()) line = [int(i) for i in input().split()] answer.append(max(line)+min(line)) for b in answer: print(str(b))
from .arf_htc_nodes import BaseRandomLeaf from .htr_nodes import LeafAdaptive, LeafMean, LeafModel class RandomLeafMean(BaseRandomLeaf, LeafMean): """ARF learning Node for regression tasks that always use the average target value as response. Parameters ---------- stats In regression task...
import requests import pandas as pd import re from requests.exceptions import HTTPError from IPython.display import display def get_json(url, params=None): if params != None: try: response = requests.get(url, params=params) response.raise_for_status() response_json = re...
from bs4 import BeautifulSoup from tqdm import trange import pandas as pd import requests import sys def main(params): url = 'https://www.taiwanratings.com/portal/front/sp?fbclid=IwAR2h6sYLuv_ZrfpIX_Li4X0CLAnTM4stgQqLVCkGzw77lM7yXcGTCYYluh0' response = requests.get(url) content = response.content soup...
# -*- coding: utf-8 -*- ''' Interaction with Mercurial repositories ======================================= Before using hg over ssh, make sure the remote host fingerprint already exists in ~/.ssh/known_hosts, and the remote host has this host's public key. .. code-block:: yaml https://bitbucket.org/example_user...
import logging from enum import Enum from typing import Dict, Union, List, Iterable from threescale_api import auth from threescale_api import utils from threescale_api import errors from threescale_api.defaults import DefaultClient, DefaultPlanClient, DefaultPlanResource, \ DefaultResource, DefaultStateClient, De...
from main import jumping_number from main import jumping_number2 def test(benchmark): assert benchmark(jumping_number, 79) == "Not!!" def test2(benchmark): assert benchmark(jumping_number2, 79) == "Not!!" ''''''''' ---------------------------------------------------------------------------------- benchmar...
import pandas as pd def threshold_analysis(model, cv_iterator, feat, param): res = pd.DataFrame() cv_num = 1 for train_index, test_index in cv_iterator: mod = model.fit(feat, param, train_index) pred, act = model.predict(mod, feat, param, test_index) ...
# -*- coding: utf-8 -*- from __future__ import absolute_import import copy import logging import re import six from bson import DBRef, ObjectId from pymongo import MongoClient, MongoReplicaSetClient from pymongo.read_preferences import ReadPreference from .collection import DummyCollection from .options import _Opti...
""" Django settings for Test project. Generated by 'django-admin startproject' using Django 1.9.1. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ from __future__ ...
""" spaCy Utils ----------- :mod:`textacy.spacier.utils`: Helper functions for working with / extending spaCy's core functionality. """ from __future__ import annotations import itertools import pathlib from typing import Iterable, List, Tuple, Union from spacy import attrs from spacy.language import Language from s...
# Copyright 2015 IBM 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 ag...
import matplotlib import numpy as np matplotlib.use('Agg') import shap def test_front_page_xgboost(): try: import xgboost except Exception as e: print("Skipping test_front_page_xgboost!") return import shap # load JS visualization code to notebook shap.initjs() # trai...
import random import torch import numpy as np import torchvision from torch import nn from tqdm import tqdm import mt_loader as loader from datetime import datetime import timm import os from utils import accuracy MODEL_NAME = 'vit_base_patch16_224'#'tf_efficientnet_b4_ns' DEVICE = torch.device("cuda" if torch.cuda.i...
# Copyright 2019 The Cirq Developers # # 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 ...
import jinja2 import pytest import yaml from localstack.utils.common import short_uid from localstack.utils.generic.wait_utils import wait_until from tests.integration.cloudformation.test_cloudformation_changesets import load_template_raw def test_create_stack_with_ssm_parameters( cfn_client, ssm_client, sns_cli...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def start_sum(start): def wrapper(func): def wrapped(*args): print(f"Entering the wrapper with start value of {start}") print(f"Processing wrapped function: {func}") string = args[0] lst = string.split() ...
#!/usr/bin/env python3 """Simple example with numpy arrays.""" import multiprocessing import numpy import numpy.matlib import ringbuffer def writer(ring): for i in range(10000): m = numpy.matlib.randn(25, 100) x = numpy.ctypeslib.as_ctypes(m) try: ring.try_write(x) e...
from typing import List, Tuple, Dict def make_vector(loc: List[str], start: Tuple[int, int] = (0, 0)) -> Tuple[int, int]: r, s = start for ins in loc: if ins == "nw": r -= 1 elif ins == "ne": r -= 1 s += 1 elif ins == "w": s -= 1 ...
# Loss functions import torch import torch.nn as nn from utils.metrics import bbox_iou from utils.torch_utils import is_parallel def smooth_BCE(eps=0.1): # https://github.com/ultralytics/yolov3/issues/238#issuecomment-598028441 # return positive, negative label smoothing BCE targets return 1.0 - 0.5 * eps,...
from .base import * from .hotspots import * from .burnscar import * from .change import * from .reference import * from .transformers import *
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# Copyright (c) 2012 OpenStack Foundation # 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 ...
# # PySNMP MIB module ISOVIEW-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ISOVIEW-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:57:33 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 0...
import sys import spotipy import yaml import spotipy.util as util from pprint import pprint import json def load_config(): global user_config stream = open('config.yaml') user_config = yaml.load(stream) # pprint(user_config) def add_monthly_playlist_tracks(sources, target_playlist_id): for key in ...
#! /usr/bin/env python2 from flask import ( g, redirect, render_template, request, send_from_directory, session, Flask ) import json import os import sqlite3 app = Flask(__name__) app.config.from_pyfile('webtag.cfg') # config def gen_secret_key(): with open('secret_key', 'w') as se...
# Copyright (C) 2019 The Raphielscape Company LLC. # # Licensed under the Raphielscape Public License, Version 1.d (the "License"); # you may not use this file except in compliance with the License. # """ Userbot initialization. """ import os import re import time from sys import version_info from logging import basic...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # Copyright (c) 2020 ASMlover. 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...
import requests from . import FeedSource, _request_headers class Graphene(FeedSource): def _fetch(self): from bitshares.market import Market feed = {} for base in self.bases: for quote in self.quotes: if quote == base: continue ...
from typing import List, Tuple import time from ray.util.iter import from_actors, LocalIterator from ray.util.iter_metrics import SharedMetrics from ray.rllib.evaluation.metrics import get_learner_stats from ray.rllib.evaluation.rollout_worker import get_global_worker from ray.rllib.evaluation.worker_set import Worker...
#!/usr/bin/python # -*- coding: utf-8 -*- # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This progra...
from __future__ import absolute_import from contextlib import contextmanager, nested from django.contrib.auth.decorators import login_required from django.shortcuts import redirect from django.test.client import Client from django.test.utils import override_settings from mock import patch from nose.tools import make...
# Copyright 2016 OpenMarket 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 agreed to in writin...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
# Generated by Django 3.2.6 on 2021-08-31 07:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('account', '0002_auto_20210810_0738'), ] operations = [ migrations.AddField( model_name='user', name='is_staff', ...
#!/usr/bin/python3 ''' Applied PEP8 (pycodestyle) Author: Ahmet Gungor Date : 29.08.2020 Description : In mathematics, the look-and-say sequence is the sequence of integers beginning as follows; 1, 11, 21, 1211, 111221, 312211, 13112221, 1113213211, ... To generate a...
import argparse import string import sys from pokesummary import __version__, displaying, parsing def prepare_args(args=None): """ Use argparse to create the command-line interface. :param args: a list of arguments passed to the program. If no value is given, use the sys.argv[1:] arguments. :ret...
#Comments are added by using a hash. print "This is supposed to run" #print "This isn't" #But the next line will run print "HI!" print "Single line comments start with a hash symbol" x = """Multiline String is here. Yes.""" print x print "x was a variable having a String of multiple lines i.e. Multiline String, is here...
import subutai import subuco if subutai.GetOS() == 'w': import subuw as subup elif subutai.GetOS() == 'l': import subul as subup elif subutai.GetOS() == 'd': import subud as subup from time import sleep def subutaistart(): coreFile = "core.ova" vboxFile = subup.GetVirtualBoxName() ubuntuFile =...
from django.conf import settings from django.http import HttpRequest def add_al_dot_beer_to_context(request: HttpRequest): return {"alabama_dot_beer": settings.IS_ALABAMA_DOT_BEER}
#from schwimmbad import MPIPool, MultiPool import emcee from emcee.utils import MPIPool import sys if sys.version[0] == '2': from cPickle import PicklingError else: from _pickle import PicklingError import numpy as np class not_really_a_class(object): def __init__(self, give_me_data): _...
# MIT License # # Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com # # 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 # ...
from .base import Widget class ImageView(Widget): def __init__(self, id=None, style=None, image=None): super().__init__(id=id, style=style, image=image) def _configure(self, image): self.image = image # @property # def alignment(self): # return self._alignment # @alignme...
"""Author: Brandon Trabucco. Gets the closest neighbors to the given words in embedding space. """ import glove import glove.configuration import glove.neighbors import numpy as np import json if __name__ == "__main__": config = glove.configuration.Configuration( embedding=300, filedir="./embeddings...
# -*- coding: utf-8 -*- """ Created on Mon Sep 2 19:22:50 2019 @author: czz """ from gluoncv import data, utils from mxnet import gluon import mxnet as mx import cv2 from imutils.object_detection import non_max_suppression from imutils import paths from imutils.video import FileVideoStream import numpy as np import ...
from django.db import migrations, models def forward(apps, schema_editor): Alumne = apps.get_model("cole", "Alumne") for alumne in Alumne.objects.all(): alumne.save() class Migration(migrations.Migration): dependencies = [ ('cole', '0030_auto_20210903_0816'), ] operations = [ ...
#----------------------------------------------------------------------------- # Copyright (c) 2005-2020, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt...
"""Event parser and human readable log generator.""" from datetime import timedelta from itertools import groupby import json import logging import time from sqlalchemy.exc import SQLAlchemyError from sqlalchemy.orm import aliased import voluptuous as vol from homeassistant.components import sun from homeassistant.co...
# SJTU EE208 INDEX_DIR = "IndexFiles.index" import sys, os, lucene, threading, time, math from datetime import datetime # from java.io import File from java.nio.file import Paths from org.apache.lucene.analysis.miscellaneous import LimitTokenCountAnalyzer from org.apache.lucene.analysis.standard import StandardAnaly...
from tensorflow.keras import layers from detection.core.bbox import transforms from detection.utils.misc import * from detection.core.anchor import anchor_generator, anchor_target from detection.core.loss import losses class RPNHead(tf.keras.Model): def __init__(self, anchor_scales=(32, 64, 12...
import numpy as np def calculate_l2_distance(predictions): targets = np.load('datasets/data/TCLD/TEST_LABEL.npy').astype(np.float) predictions = predictions.astype(np.float) targets = targets[1:,:] predictions = predictions[1:,:] targets = targets * 512. predictions = predictions * 512....
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #----------------------------------------------------------------...
from django.contrib import admin from .models import Profile, Address, CreditCard admin.site.register(Profile) admin.site.register(Address) admin.site.register(CreditCard)
"""empty message Revision ID: ca5ad134e688 Revises: 89311980ce03 Create Date: 2020-03-09 17:27:31.530890 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = 'ca5ad134e688' down_revision = '89311980ce03' branch_labels = None depe...
BASE_FUNCTIONS = [('reverse test', lambda ks: ks[::-1]), ('split and swap test', lambda ks: ks[int(len(ks) / 2):] + ks[:int(len(ks) / 2)])] class Exploiter: @staticmethod def get_all(): # mutations that we may want to avoid in tests that passed because they are easily reversible ...
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com> # # 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 applicabl...
import typing from django.shortcuts import render from dotmap import DotMap from home.context import hydrate, home_context DOTMAP = typing.TypeVar('DotMap', bound=typing.OrderedDict) # Exemple # from django.http import HttpResponse # def index(request): # return HttpResponse("Hello, world. You're at the home inde...
strN = input("Please enter a number:") N = int(strN) #N = 10 numbers_to_sum = list(range(1,N+1,2)) total = sum(numbers_to_sum) print("summation 1..",N,"for odd numbers is",total)
from .vehicle import Vehicle, Car, Truck import unittest class TestCar(unittest.TestCase): def setUp(self) -> None: self.car = Car(10, 1.1) # def test_car_is_initiated(self): # self.assertEqual(self.car.fuel_quantity, 10) # self.assertEqual(self.car.fuel_consumption, 1.1) ...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from ... import _utilities, _tables __a...
from pyparams import * import numpy as np matmul1: Module = IncludeModule("fun_module", scope="a") matmul2: Module = IncludeModule("fun_module", scope="b") some_param: int = PyParam(4, scope="some_param") W = np.random.rand(10, 10) X = np.random.rand(10, 1) Y = matmul1.matmul(W, X) Y = matmul2.matmul(W, Y)
from django.test import TestCase, Client from django.contrib.auth import get_user_model from django.urls import reverse class AdminSiteAdmin(TestCase): def setUp(self): """Create a setup to run before the tests""" self.client = Client() self.admin_user = get_user_model().objects.create_su...
# Copyright (c) 2015 Shotgun Software Inc. # # CONFIDENTIAL AND PROPRIETARY # # This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit # Source Code License included in this distribution package. See LICENSE. # By accessing, using, copying or modifying this work you indicate your # agreement to the S...
from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.core.exceptions import ObjectDoesNotExist from django.db import models, transaction from django.db.models import Q from django.db.models.signals import post_save from django.dispatch i...
from collections import OrderedDict from typing import ( TYPE_CHECKING, AbstractSet, Any, Dict, Iterable, Iterator, List, Optional, Set, Tuple, Union, cast, ) from toposort import CircularDependencyError, toposort_flatten from dagster import check from dagster.config im...
from flask import Flask, request, jsonify, Response import requests from json import dumps, loads import bot botApp = Flask(__name__) server_url = 'http://192.168.230.1:8080' # CHANGE port = 8774 move_endpoint = '/api/move' my_address = 'http://192.168.230.67:%d%s' % (port, move_endpoint) @botApp.route('/api/ping') d...
# -*- coding: utf-8 -*- # # Asakusa Framework Sandbox documentation build configuration file, created by # sphinx-quickstart on Wed May 18 11:38:42 2011. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogener...
from nltk import pos_tag import pandas as pd import nltk from nltk.corpus import stopwords, wordnet, words, treebank from nltk.stem import WordNetLemmatizer wnl = WordNetLemmatizer() stopwords_list = stopwords.words('english') negation_stopwords_set = ["nobody", "neither", "nowhere", "not", "no", "without", "neverthel...
from django.test import TransactionTestCase, TestCase from posthog.models import User, Team from django.test import Client class BaseTest(TestCase): TESTS_API: bool = False TESTS_PASSWORD: str = "testpassword12345" def _create_user(self, email, **kwargs) -> User: user = User.objects.create_user(e...
# Taken from https://github.com/psclklnk/spdl # Copy of the license at TeachMyAgent/teachers/LICENSES/SPDL import torch import numpy as np def set_weights(parameters, weights, use_cuda): """ Function used to set the value of a set of torch parameters given a vector of values. Args: parameter...
# Teste parte 2 class Calc: def __init__(self, numero1, numero2): # variável de classe self.__n1 = numero1 self.__n2 = numero2 self.__resultado = 0 def set_n1(self, valor): self.__n1 = valor def get_n1(self): return self.__n1 def set_n2(self, valor): ...
"""Module with syntax constructions """ class switch: """Switch/Case construction for multiple equality based on context managers""" def __init__(self, match: object, *, mode: str = 'eq') -> None: """Initialize Switch object Args: match (Any): Object to check equality mode (str, optional): Mode fo...
# -*- coding: utf-8 -*- """ Defines unit tests for :mod:`colour.volume.mesh` module. """ from __future__ import division, unicode_literals import numpy as np import unittest from itertools import permutations from colour.volume import is_within_mesh_volume from colour.utilities import ignore_numpy_errors __author__...
# -*- coding: utf-8 -*- ''' Salt module to manage Unix mounts and the fstab file ''' # Import python libs from __future__ import absolute_import import os import re import logging # Import salt libs import salt.utils from salt.utils import which as _which from salt.exceptions import CommandNotFoundError, CommandExecu...
import click from .analysis.analysis_cli import cli as analysis_cli from .getlabels.getlabels_cli import cli as getlabels_cli from .kfold.kfold_cli import cli as kfold_cli from .restrict.restrict_cli import cli as restrict_cli from .split.split_cli import cli as split_cli class RegistrationOrderGroup(click.Group): ...
#!/usr/bin/env python # ---------------------------------------------------------------------------- # BalloonTip Demo Implementation # # This Demo Shows How To Use The BalloonTip Control, With Different Styles # And Behaviors. # ---------------------------------------------------------------------------- import wx ...
# coding: utf-8 # flake8: noqa """ Kubernetes No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 OpenAPI spec version: v1.14.7 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import __version__ ...
# Copyright (c) 2019, Hans Jerry Illikainen <hji@dyntopia.com> # # SPDX-License-Identifier: BSD-2-Clause from os import chdir, getcwd from pathlib import Path from tempfile import TemporaryDirectory from typing import Iterator from pytest import fixture @fixture def tmpdir() -> Iterator[Path]: orig = getcwd() ...