text
stringlengths
2
999k
#!/usr/bin/env python3 """ Note: To Run this script gui should be opened with path: cd LANforgeGUI_5.4.3 (5.4.3 can be changed with GUI version) pwd (Output : /home/lanforge/LANforgeGUI_5.4.3) ./lfclient.bash -cli-socket 3990 Note: This is a test file which will run a wifi capacity test. e...
#from apiclient.discovery import build #from oauth2client.file import Storage from string import Template from utils import Date # this code is not yet complete class Report: """create ingest report based on data that has been gathered and computed Reports (eventually) are google docs, they are created usi...
import math AB = int(input()) BC = int(input()) print ( int(round(math.degrees(math.atan2(AB,BC)))), chr(176), sep='') #https://www.hackerrank.com/challenges/find-angle/problem import math print ( int(round(math.degrees(math.atan2(int(input()),int(input()))))), chr(176), sep='')
#! /usr/bin/env python from zplot import * c = pdf(title='simple.pdf', dimensions=[300,300]) c.line(coord=[[10,10],[290,290]]) c.line(coord=[[10,290],[290,10]]) c.line(coord=[[50,50],[50,100],[100,100],[100,50]], linewidth=3, linecolor='orange', linejoin=1, closepath=True) c.box(coord=[...
import pytest from mpi4py import MPI import jax import jax.numpy as jnp comm = MPI.COMM_WORLD rank = comm.Get_rank() size = comm.Get_size() def run_in_subprocess(code, test_file, timeout=10): """Runs given code string in a subprocess""" import os import subprocess import sys from textwrap impor...
#!/usr/local/bin/python2.6 -tt # # 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 licenses this file # to you under the Apache License, Version 2.0 (...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- print('init')
import os,sys,math,random from phycas import * from phycas.utilities.PhycasCommand import * from phycas.utilities.CommonFunctions import CommonFunctions class CPOImpl(CommonFunctions): #---+----|----+----|----+----|----+----|----+----|----+----|----+----| """ Needs to be written. """ def __init__(...
"""Quantum mechanical angular momemtum. TODO: * Improve the algorithm for the Wigner D-Function. * Fix printing of Wigner D-Function. * Implement inner products using Wigner D-Function. * Implement rewrite logic for everything. * Test """ from sympy import I, Symbol, S, Integer, Rational, Matrix, sqrt, sympify from s...
__version__ = "1.1.0" __author__ = "Palo Alto Cortex Xpanse" __license__ = "ISC" __maintainer__ = "Palo Alto Cortex Xpanse" __email__ = "help@expanseinc.com" __status__ = "Production"
#!/usr/bin/python __doc__ = """ This file contains code for daemon test case 2 for the 'server'. Client is in quotes because dibs is peer-to-peer not client-server. However, for this test, the 'client' stores data on the 'server' but not vice-versa. This file creates a directory in /tmp, and uses it to initailize a D...
""" Base settings to build other settings files upon. """ from pathlib import Path import environ from corsheaders.defaults import default_headers as default_cors_headers ROOT_DIR = Path(__file__).resolve(strict=True).parent.parent.parent APPS_DIR = ROOT_DIR / 'safe_transaction_service' env = environ.Env() READ_DO...
from typing import NoReturn from ...base import BaseEstimator import numpy as np from numpy.linalg import det, inv class GaussianNaiveBayes(BaseEstimator): """ Gaussian Naive-Bayes classifier """ def __init__(self): """ Instantiate a Gaussian Naive Bayes classifier Attributes...
from botToken import token from src.bot import bot bot.run(token)
from sklearn.metrics import mean_squared_error import matplotlib.pyplot as plt import numpy as np import pandas as pd import seaborn as sns import sys import os import csv """Read cham-tool-logs with predicted-load values Each rank holds an array of real-load and predicted load. For example, real_load_data=[R0_...
''' @Author: Yingshi Chen @Date: 2020-04-27 18:30:01 @ # Description: ''' from torch import nn import torch.nn as nn import torch.nn.functional as F from operations import * from sparse_max import sparsemax, sparsemoid, entmoid15, entmax15 from genotypes import Genotype import time from MixedOp import * from torch.au...
#!/usr/bin/env python3 import argparse import os import subprocess import sys def setup(): global args, workdir programs = ['ruby', 'git', 'make', 'wget', 'curl'] if args.kvm: programs += ['apt-cacher-ng', 'python-vm-builder', 'qemu-kvm', 'qemu-utils'] elif args.docker and not os.path.isfile('...
# -*- coding: utf-8 -*- # # Akamatsu CMS # https://github.com/rmed/akamatsu # # MIT License # # Copyright (c) 2020 Rafael Medina García <rafamedgar@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 ...
import numpy as np import tensorflow as tf from keras.backend import set_session from keras.layers import Dense, Flatten, Input, concatenate, SeparableConv2D from keras.models import Model from keras.optimizers import Adam from c4_game import C4Action, C4Experience, C4State, C4MoveResult class Ramp(object): def ...
import time import logging import tensorflow as tf # from tensorflow.keras.utils import Progbar # from tensorflow.python.keras import callbacks as callbacks_module # import nvtx.plugins.tf as nvtx_tf logger = tf.get_logger() # Neural Network class TFOptimizedModelTrainer(): def __init__(self, hp, model, mixed_pre...
import logging from logging.handlers import TimedRotatingFileHandler import os formatter = logging.Formatter('%(asctime)s %(name)-12s ' + '%(levelname)-8s %(message)s') log_debug = True # Unit of time interval LOG_TIME_WHEN = "midnight" # Chang log file interval LOG_TIME_INTERVAL = 1 # Kee...
# Copyright 2009-Present The Graphite Development Team # Copyright 2008 Orbitz WorldWide # # 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...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'DeveloperLx' import inspect, functools, asyncio, os, logging from urllib import parse from aiohttp import web from apis import APIError def get(path): ''' Define decorator @get('/path') ''' def decorator(func): @functools.wraps(fun...
from threading import Lock class Resource: def __init__(self, name, count): self.name = name self.count = count self.in_use = 0 self.lock = Lock() def set_count(self, count): self.count = count def get_available(self): return self.count - self.in_use
class Human: def __init__(self,name): self.name = name self.age = 0 def change_age(self,num): if num > 0: self.age = num else: print('ne baluisya') new_human = Human(name='maksim') new_human1 = Human(name='emir') new_human1.change_age(-20)
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Wizblcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the -alertnotify option.""" import os import time from test_framework.test_framework import Wiz...
# coding: utf-8 import re import six from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization class SslOptionRequest: """ Attributes: openapi_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key i...
import sys filename = "MPICH_RANK_ORDER" file = open(filename, "w") print "Printing --transposed-- virtual mapping to MPI ranks to MPICH_RANK_ORDER" print "The processor grid dimensions are ", sys.argv[1], "-by-", sys.argv[1] dim = int(sys.argv[1]); gen = range(dim); for i in range(dim): line = [x * dim + i for x i...
from chill import * source('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/polybench/polybench-code/stencils/jacobi-1d/kernel.c') destination('/uufs/chpc.utah.edu/common/home/u1142914/lib/ytopt_vinu/experiments/jacobi-1d/tmp_files/3213.c') procedure('kernel_jacobi_1d') loop(0) tile(0,2,16,2) tile(1,2,16,2)
import logging from django.conf import settings from django.template.loader import render_to_string import requests import urllib3 from .services import add_sign from .utils import get_issue_instant requests.packages.urllib3.disable_warnings() requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS += ':HIGH:!DH:!aNULL...
from pymongo import ReturnDocument from lib.model import Model from lib.mongodb import db class UserSentTracking(Model): collection = db.user_sent @classmethod def inc_queued(cls, uid): return cls(cls.collection.find_one_and_update( {'uid': uid}, {'$inc': {'last_queued': ...
# -*- coding: utf-8 -*- # Generated by Django 1.10.6 on 2017-04-09 09:14 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('kpis', '0002_auto_20170331_1646'), ] operations = [ migrations.AlterModelOp...
#!/usr/bin/env python3 import testUtils import argparse import random import signal ############################################################### # Test for different test scenarios. # Nodes can be producing or non-producing. # -p <producing nodes count> # -c <chain strategy[replay|resync|none]> # -s <topology> # ...
from lunespy.client.transactions.burn import BurnAsset from lunespy.client.wallet import Account def test_without_asset_id_ready_failed_successful(): """ without a asset_id parameter: - should be return False for BurnAsset.ready - else should be return True """ # Failed ...
import sys import os # If NUSSL_DIRECTORY is defined, then this will use the version of NUSSL that it points to. if os.getenv('NUSSL_DIRECTORY'): sys.path.insert(0, os.getenv('NUSSL_DIRECTORY')) from . import algorithms from . import dataset from . import model import logging # Set up logging format he...
from common.ErrorCounter import ErrorCounter from common.ExporterTypes import TX_TYPE_NFT_WHITELIST, TX_TYPE_NFT_CANCEL_ORDER from terra import util_terra from terra.api_lcd import LcdAPI from terra.col4.handle_simple import handle_simple, handle_unknown from terra.make_tx import ( make_nft_buy_tx, make_nft_dep...
import torch import pdb import torch.nn as nn import math from torch.autograd import Variable from torch.autograd import Function import numpy as np def Binarize(tensor,quant_mode='det'): if quant_mode=='det': return tensor.sign() else: return tensor.add_(1).div_(2).add_(torch.rand(tensor.siz...
# -*- encoding: UTF-8 -*- # !/usr/bin/env python from PyQt4.QtCore import * from PyQt4.QtGui import QApplication, QIcon, \ QDialog, QLabel, QLineEdit, QPushButton import sys DEFAULT_PORT = 8888 DEFAULT_ADDR = '127.0.0.1' WINDOW_WIDTH = 450 WINDOW_HEIGHT = 350 class LoginDialog(QDialog): def __init__(self, ...
from .BaseWork import Work class TechReport(Work): btexType="techreport" _crossrefTypes = ['report'] _reqFields=["doi", "author", "title", "institution", "year"] _optFields=["number", "address", "month"] class Dissertation(Work): _crossrefTypes = ['dissertation'] _reqFields = ["doi", "author",...
from django.contrib.auth.models import AbstractUser from django.core.urlresolvers import reverse from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ @python_2_unicode_compatible class User(AbstractUser): """ User Model ...
import os import time import requests assert os.getenv("NYCKEL_CLIENT_ID"), "NYCKEL_CLIENT_ID env variable not set; can't setup connection." assert os.getenv("NYCKEL_CLIENT_SECRET"), "NYCKEL_CLIENT_SECRET env variable not set; can't setup connection." class Requester: """Class to talk to the Server. Manages the...
from itertools import chain import numpy as np import torch import torch.nn as nn from torch.distributions import Normal def init(m, gain=1.0): if isinstance(m, nn.Conv2d) or isinstance(m, nn.Linear): nn.init.orthogonal_(m.weight.data, gain) nn.init.zeros_(m.bias.data) class DDPGMLP(nn.Module):...
import asyncio import datetime import random from typing import Dict, List import discord from discord.ext.commands import Context from redbot.core import Config, checks, commands from redbot.core.utils.menus import start_adding_reactions from redbot.core.utils.predicates import ReactionPredicate from .game import Ga...
# Copyright 2018 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.apps import AppConfig class InstagConfig(AppConfig): name = 'instag'
# -*- coding: utf-8 -*- from . import config, datastructures, dns, fs, git, github # noqa
#!/usr/bin/env python """ Neural Network implementation. Credit ------ I primarily learned the neural network algorithm from below sources: [ICL] Imperial College London, Mathematics for Machine Learning Specialization, https://www.coursera.org/specializations/mathematics-machine-learning [DA] deeplearning.ai, Deep Le...
#!/usr/bin/env python3 import sys, os from subprocess import Popen, PIPE import yaml def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) # let snakemake read job_properties from snakemake.utils import read_job_properties jobscript = sys.argv[1] job_properties = read_job_properties(jobscript)...
# -*- coding: utf-8 -*- # # Authors: Denis A. Engemann <denis.engemann@gmail.com> # Alexandre Gramfort <alexandre.gramfort@inria.fr> # Juergen Dammers <j.dammers@fz-juelich.de> # # License: BSD (3-clause) from inspect import isfunction from collections import namedtuple from copy import deepcopy from...
import torch import torch.nn as nn import torch.nn.functional as F import cmws.util def step_lstm(lstm, input_, h_0_c_0=None): """LSTMCell-like API for LSTM. Args: lstm: nn.LSTM input_: [batch_size, input_size] h_0_c_0: None or h_0: [num_layers, batch_size, hidden_size] ...
from test import support from test.support import os_helper from tokenize import (tokenize, _tokenize, untokenize, NUMBER, NAME, OP, STRING, ENDMARKER, ENCODING, tok_name, detect_encoding, open as tokenize_open, Untokenizer, generate_tokens, NEWLINE) from i...
# Copyright (c) 2021 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 # # Unless required by appli...
#!/usr/bin/env mayapy # # Copyright 2018 Pixar # # 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...
# -*- coding: utf-8 -*- # Copyright 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 requi...
import hashlib import json import logging import os from datetime import datetime from pathlib import Path import pandas as pd from airflow import DAG from airflow.models import Variable from airflow.operators.dummy import DummyOperator from airflow.operators.python import BranchPythonOperator, PythonOperator from cka...
""" Provides base and example classes for pseudo motors, which are combinations of other motors. """ from . import Motor class PseudoMotor(Motor): """ Pseudo motor base class. """ def __init__(self, motors, dry_run=False, *args, **kwargs): """ Abstract base class for pseudo motors. Th...
from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from direct.particles import ParticleEffect from direct.particles import Particles from direct.particles import ForceGroup from EffectController import EffectController from PooledEffect import PooledEffect import random class JRSoulHarvest...
from .rfe_sklearn import RFESklearn from .rfecv_sklearn import RFECVSklearn from .select_from_model_sklearn import SelectFromModelSklearn from .select_from_total_importance import SelectFromTotalImportance from .select_percentile_sklearn import SelectPercentileSklearn from .sequential_feature_selector_sklearn import Se...
from airflow import DAG, macros from airflow.operators.bash_operator import BashOperator from airflow.operators.postgres_operator import PostgresOperator from airflow.utils.dates import days_ago from datetime import datetime # [START default_args] default_args = { 'owner': 'airflow', 'depends_on_past': False, ...
# Generated by pypy/tool/import_cffi.py import os, sys, math, py from cffi import FFI, FFIError, VerificationError, VerificationMissing, model from cffi import recompiler from pypy.module.test_lib_pypy.cffi_tests.support import * import _cffi_backend lib_m = ['m'] if sys.platform == 'win32': #there is a small chan...
from numpy import exp # natural exponential from numpy import array # creates a matrix from numpy import dot # multiplies matrices from numpy import random class NeuralNetwork(): def __init__(self): # Seed the random number generator, so it generates the same numbers # every time t...
""" Window Fringe """ from .._element import WindowElement __all__ = [ "WindowFringe", ] class WindowFringe( WindowElement, ): pass
""" xled_plus.sequence ~~~~~~~~~~~~~~~~~~ Author: Anders Holst (anders.holst@ri.se), 2021 This module contains some classes for creating spatio-temporal cyclic color sequences. That is, bands or gradients of colors moving across the leds in some direction at some speed. It assumes that a 2D or 3D layout is set on th...
""" missing types & inference """ import numpy as np from pandas._config import get_option from pandas._libs import lib import pandas._libs.missing as libmissing from pandas._libs.tslibs import NaT, iNaT from pandas._typing import DtypeObj from pandas.core.dtypes.common import ( _NS_DTYPE, _TD_DTYPE, ens...
# Generated by Django 3.1.7 on 2021-03-08 12:13 import django.contrib.postgres.indexes from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("order", "0100_auto_20210216_0914"), ] operations = [ migrations.AddIndex( model_name="fulfillment...
from abc import ABC from datetime import datetime from pyramid.response import Response class BaseView(ABC): @staticmethod def json_response(json): """" :param dict | list json: :rtype: dict | list """ if isinstance(json, dict): result = BaseView._dict_resp...
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from thumbor.utils import logger from functools import reduce def ...
# -*- coding: utf-8 -*- """Plotting interface.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ from collections import OrderedDict from contextlib import contextmanager import hashlib import ...
""" OpenAPI definition No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501 The version of the OpenAPI document: v0 Contact: support@gooddata.com Generated by: https://openapi-generator.tech """ import re # noqa: F401 import sy...
# Usage: python predict_no_y.py number_of_separation NEPDF_pathway model_pathway # command line in developer's linux machine : # python predict_no_y.py 9 /home/yey3/cnn_project/code3/NEPDF_data /home/yey3/cnn_project/code3/trained_model/models/KEGG_keras_cnn_trained_model_shallow2.h5 from __future__ import print...
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2018, Anaconda, Inc. and Intake contributors # All rights reserved. # # The full license is in the LICENSE file, distributed with this software. #------------------------------------------------------------------------...
from configparser import ConfigParser from pyrogram import Client class Bot(Client): def __init__(self): name = self.__class__.__name__.lower() config_file = f"{name}.ini" config = ConfigParser() config.read(config_file) super().__init__( name, bot...
#!/usr/bin/env python # -*- coding: utf-8 -*- """Update encrypted deploy password in Travis config file """ from __future__ import print_function import base64 import json import os from getpass import getpass import yaml from cryptography.hazmat.primitives.serialization import load_pem_public_key from cryptography.h...
# 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 licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
### # Copyright (c) 2019, cottongin # Copyright (c) 2020, oddluck <oddluck@riseup.net> # 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 ...
#!/usr/bin/python2.4 # # Copyright 2014 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...
"""Validate a face recognizer on the "Labeled Faces in the Wild" dataset (http://vis-www.cs.umass.edu/lfw/). Embeddings are calculated using the pairs from http://vis-www.cs.umass.edu/lfw/pairs.txt and the ROC curve is calculated and plotted. Both the model metagraph and the model parameters need to exist in the same d...
from datetime import datetime from twint.storage import postgres from . import format, get from .tweet import Tweet from .user import User from .storage import db, elasticsearch, write, panda import logging as logme follows_list = [] tweets_list = [] users_list = [] author_list = {''} author_list.pop() # used by ...
from datadog import initialize, api options = { 'api_key': '<YOUR_API_KEY>', 'app_key': '<YOUR_APP_KEY>' } initialize(**options) name = 'My Dashboard List' api.DashboardList.create(name=name)
import numba import numpy as np @numba.jit(nopython=True, nogil=True) def NoTransform(value_in): return value_in @numba.jit(nopython=True, nogil=True) def AbsValueTransform(value_in): return np.abs(value_in) # Interpret stats, turning any compound stats into individual stats. # Takes a list of stat names ...
import os from uuid import uuid4 from os.path import join from .models import Attachment from . import db FILESTORE_PATH = '/tmp/.dp_filestore' # TODO: make configurable def ensure_filestore(): """ Ensure filestore folder exists""" if not os.path.exists(FILESTORE_PATH): os.mkdir(FILESTORE_PATH) def...
# ex:ts=4:sw=4:sts=4:et # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- """ BitBake 'Fetch' implementations Classes for obtaining upstream sources for the BitBake build tools. """ # Copyright (C) 2003, 2004 Chris Larson # # This program is free software; you can redistribute it and/or modify # it un...
# Copyright IBM Corp. All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 # import unittest import subprocess class perf_goleveldb(unittest.TestCase): def test_FAB_3790_VaryNumParallelTxPerChain(self): ''' In this Performance test, we observe the performance (time to complete a...
from django.apps import AppConfig class EventKitJobs(AppConfig): name = "eventkit_cloud.jobs" verbose_name = "Eventkit-Cloud Jobs" def ready(self): from eventkit_cloud.jobs.signals import job_post_save, user_post_save # NOQA
""" This file defines the 'subset' SomeValue classes. An instance of a SomeValue class stands for a Python object that has some known properties, for example that is known to be a list of non-negative integers. Each instance can be considered as an object that is only 'partially defined'. Another point of view is th...
# --- # jupyter: # jupytext: # cell_metadata_filter: collapsed,code_folding # formats: ipynb,py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.2' # jupytext_version: 1.2.1 # kernelspec: # display_name: Python 3 # language: pyth...
#!/usr/bin/env python # Copyright 2019 ARC Centre of Excellence for Climate Extremes # author: Paola Petrelli <paola.petrelli@utas.edu.au> # # 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 # # ...
""" This module contains the :class:`~xcc.Settings` class and related helper functions. """ import os from typing import Optional from appdirs import user_config_dir from dotenv import dotenv_values, set_key, unset_key from pydantic import BaseSettings def get_path_to_env_file() -> str: """Returns the path to t...
# -*- coding: utf-8 -*- # # wafer-mlops documentation build configuration file, created by # sphinx-quickstart. # # 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 # autogenerated file. # # All configuration values ha...
import numpy as np from common.numpy_fast import clip, interp def apply_deadzone(error, deadzone): if error > deadzone: error -= deadzone elif error < - deadzone: error += deadzone else: error = 0. return error class PIController(): def __init__(self, k_p, k_i, k_f=1., pos_limit=None, neg_limit=...
# -*- Python -*- # Return the options to use for a C++ library or binary build. # Uses the ":optmode" config_setting to pick the options. load("//tensorflow/core:platform/default/build_config_root.bzl", "tf_cuda_tests_tags") # List of proto files for android builds def tf_android_core_proto_sources(): retur...
""" Generic IOS-XE Patterns. """ __author__ = "Myles Dear <pyats-support@cisco.com>" from unicon.plugins.generic.patterns import GenericPatterns from unicon.plugins.generic.service_patterns import ReloadPatterns class IosXEPatterns(GenericPatterns): def __init__(self): super().__init__() self.sh...
import json import os import sys import time import aco from domain import DomainProblem from state import State def run(domain, problem, config): print('==================================================') print(f'{os.path.split(domain)[-1]} --- {os.path.split(problem)[-1]}') print('===================...
# 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...
from django.urls import path from estoque.estoques import views as v app_name = 'estoques' urlpatterns=[ path('', v.estoque_entrada_list, name='estoque_entrada_list'), path('<int:pk>/', v.estoque_entrada_detail, name='estoque_entrada_detail'), ]
# Code for paper: # [Title] - "PAN: Towards Fast Action Recognition via Learning Persistence of Appearance" # [Author] - Can Zhang, Yuexian Zou, Guang Chen, Lei Gan # [Github] - https://github.com/zhang-can/PAN-PyTorch import numpy as np def softmax(scores): es = np.exp(scores - scores.max(axis=-1)[..., None]) ...
# -*- coding: utf-8 -*- """ mslib.msui.mpl_map ~~~~~~~~~~~~~~~~~~ Map canvas for the top view. As Matplotlib's Basemap is primarily designed to produce static plots, we derived a class MapCanvas to allow for a certain degree of interactivity. MapCanvas extends Basemap by functionality to, for ...
_base_ = [ '../_base_/models/dnl_r50-d8.py', '../_base_/datasets/cityscapes_769x769.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_80k.py' ] model = dict( decode_head=dict(align_corners=True), auxiliary_head=dict(align_corners=True), test_cfg=dict(mode='slide', crop_size=(769...
# -*- encoding: utf-8 -*- from contextlib import contextmanager from datetime import datetime import sys from traceback import format_exception import colorama from .conf import settings from . import const def color(color_): """Utility for ability to disabling colored output.""" if settings.no_colors: ...
from typing import List import functools import pytest # type: ignore from strategy_param import Customer, LineItem, Order, Promotion from strategy_param import fidelity_promo, bulk_item_promo, LargeOrderPromo from strategy_param import general_discount @pytest.fixture def customer_fidelity_0() -> Customer: re...