input
stringlengths
2.65k
237k
output
stringclasses
1 value
<reponame>rartino/rst2reveal try: import locale locale.setlocale(locale.LC_ALL, '') except: pass import os, sys, codecs import docutils.core from .RevealTranslator import RST2RevealTranslator, RST2RevealWriter # Import custom directives from .TwoColumnsDirective import * from .PygmentsDirective import * from .Vid...
totalsum): b += 1 best = min(best, getsum(a, b, total, totalsum)) best = total - best('Case #%d' % T) return s def func_97d13fa555774b9e84f227df329b52f2(T, infile): N, p, q, r, s = line(infile) A = [((i * p + q) % r + s) for i in xrange(N)] total = sum(A) totalsum = [a for a in A] for i in xrange(1, N): tot...
import pandas as pd from Util import Util from datapreprocessor import DataPreProcessor from test_classifier import Test_Classifier from train_classifier import Train_Classifier class Texture_Classification_Deep: @staticmethod def DTD_Train_test(): device = Util.get_device() # device = 'cuda' if torch.cuda.is_av...
<filename>caret_analyze/infra/lttng/ros2_tracing/processor.py # Copyright 2019 <NAME> GmbH # Copyright 2020 <NAME> # # 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/li...
#usr/bin/python import os import time import itertools import string import hashlib import sys import signal import getopt import random import threading import multiprocessing from multiprocessing import Process from ctypes import c_char_p __version__ = '1.0.0' info = """ Name : find-extreme-hashe...
a registration with `registrationId` exists in the system. This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please define a `callback` function to be invoked when receiving the response. >>> def callback_function(response): >>> pprint(response) >>> >>> thread = api....
<reponame>chiragmatkar/testplan<gh_stars>0 """ This file is base on the difflib from python standard library (version: 2.7.9) it provides diff (context/unified) functions with more options like GNU diff, including: --ignore-space-change, --ignore-whitespace, --ignore-blank-lines Due to the different algorithm, its outp...
new contact name and any optional arguments. Returns new PingdomContact instance Optional Parameters: * email -- Contact email address Type: String * cellphone -- Cellphone number, without the country code part. In some countries you are supposed to exclude leading zeroes. (Requires countrycode and countryiso...
= self.to_hyperdb_value(hyperdb.Date) res = [] properties = self.getclass(classname).getprops() for nodeid, date_stamp, user, action, params in journal: params = eval_import(params) if isinstance(params, type({})): for param, value in params.items(): if not value: continue property = properties.get(param, None...
[1, np.nan], "B": [1.0, 2.0]} df = pandas.DataFrame(frame_data) modin_df = pd.DataFrame(frame_data) for v in ["", 1, np.nan, 1.0]: df_equals(modin_df.fillna(v), df.fillna(v)) @pytest.mark.parametrize("data", test_data_values, ids=test_data_keys) def test_fillna_skip_certain_blocks(self, data): modin_df = pd.Dat...
from typing import Union, List, Optional from pyspark.sql.types import ( StructType, StructField, StringType, ArrayType, BooleanType, DataType, ) # This file is auto-generated by generate_schema so do not edit manually # noinspection PyPep8Naming class TestScriptSchema: """ A structured set of tests against ...
<reponame>rtflynn/tlslite-ng<filename>tlslite/utils/rsakey.py # Author: <NAME> # See the LICENSE file for legal information regarding use of this file. """Abstract class for RSA.""" from .cryptomath import * from . import tlshashlib as hashlib from ..errors import MaskTooLongError, MessageTooLongError, EncodingError,...
<filename>craftroom/displays/regions.py<gh_stars>1-10 '''Wrapper to generate ds9 region files, for sketching on FITS images in ds9.''' class Regions(): def __init__(self, name, units='physical', path=''): self.name = name self.filename = path + self.name + '.reg' self.regions = [] self.addHeader() self.addU...
false return 200 OK and mix of successfully created objects and any with validation errors :param int unitdp: e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts :param bool _return_http_data_only: return received data only :param bool _preload_content: load received data...
<reponame>mobergd/autoio """ Writes strings containing the rate parameters """ # Define the name_buffer between the longest reaction name and the Arr params BUFFER = 5 # Functions to write the parameters in the correct format def troe(reaction, high_params, low_params, troe_params, colliders=None, max_length=45, na...
self.status = False # basic setting def to_input(self, fout): fout.write("\t\t\t\t\t\t&EACH\n") for item in self.params: if self.params[item] is not None: fout.write("\t\t\t\t\t\t\t%s %s\n" % (item, str(self.params[item]))) fout.write("\t\t\t\t\t\t&END EACH\n") def set_params(self, params): for ...
# Probabilitybuckets # reimplemented by <NAME> (<EMAIL>) # according to # "Privacy Buckets: Upper and Lower Bounds for r-Fold Approximate Differential Privacy" # (https://eprint.iacr.org/2017/1034, version 2018 May 8th) import logging import numpy as np from scipy import optimize import copy import gc import os import...
#!/usr/bin/env python """\ @file simperf_host_xml_parser.py @brief Digest collector's XML dump and convert to simple dict/list structure $LicenseInfo:firstyear=2008&license=mit$ Copyright (c) 2008-2009, Linden Research, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this softwar...
<filename>homeassistant/components/ais_shell_command/__init__.py """ Exposes regular shell commands as services. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/shell_command/ """ from homeassistant.const import CONF_IP_ADDRESS, CONF_MAC import asyncio im...
: "readwrite", "description" : """""", }, # scalar "macAuthenticationNamePrefix" : { "nodetype" : "scalar", "moduleName" : "ZYXEL-GS4012F-MIB", "oid" : "1.3.6.1.4.1.890.172.16.31.10.106.2", "status" : "current", "syntax" : { "type" : { "module" :"RFC1213-MIB", "name" : "DisplayString"}, }, "access" : "readw...
desc='Auxiliary power unit weight \n < 0., negative of starting weight which will be modified as appropriate during optimization or parametric variation\n \n = 0., no weight for that component\n \n > 0. but < 5., scale factor applied to internally computed weight\n \n > 5., actual fixed weight for component') win = Fl...
representing the last RNNs hidden state """ tbc, lengths = inputs packed = torch.nn.utils.rnn.pack_padded_sequence(tbc, lengths.cpu(), batch_first=self.batch_first) output, hidden = self.rnn(packed) output, _ = torch.nn.utils.rnn.pad_packed_sequence(output, batch_first=self.batch_first) return self.extract_top_st...
pred heatmap etc. pred_heatmaps, pred_obj_sizes, pred_offsets = self.predict(raw_images, need_conv_img=need_conv_img) # one sample if len(raw_images.shape) == 3: uplf_points, obj_sizes = pred_bbox_one_sample(pred_heatmaps, pred_obj_sizes, pred_offsets, (raw_images.shape[1], raw_images.shape[0]), ) ...
import string import warnings import numpy as np from pandas import ( DataFrame, MultiIndex, NaT, Series, date_range, isnull, period_range, timedelta_range, ) from .pandas_vb_common import tm class GetNumericData: def setup(self): self.df = DataFrame(np.random.randn(10000, 25)) self.df["foo"] = "bar" s...
#!/usr/bin/env python # -*- coding: UTF-8 -*- # # QuantStats: Portfolio analytics for quants # https://github.com/ranaroussi/quantstats # # Copyright 2019 <NAME> # # 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...
<gh_stars>10-100 import base64 from collections import defaultdict import copy import json from numbers import Number import re from django.conf import settings from django.contrib.sites.shortcuts import get_current_site from django.core.cache import cache from django.core.files.base import ContentFile from django.db....
from abc import abstractmethod from dataclasses import dataclass from html import escape from typing import Dict, Generator, Union, Iterable class BaseTag: """ In HTML5 there are six different kinds of elements: void elements, the template element, raw text elements, escapable raw text elements, foreign elements,...
import random import os import itertools import tensorflow as tf from tensorflow import newaxis as ax from basic.attention_modules import hotpot_biattention, zhong_selfatt from basic.batcher import get_batch_feed_dict from my.tensorflow import get_initializer from my.tensorflow.nn import softsel, get_logits, linear_lo...
Leakage': 0.00611897, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781, 'Renaming Unit/Peak Dynamic': 4.56169, 'Renaming Unit/Runtime Dynamic': 0.220301, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime ...
<reponame>Friz64/Vulkan-Docs #!/usr/bin/python3 -i # # Copyright 2013-2021 The Khronos Group Inc. # # SPDX-License-Identifier: Apache-2.0 """Base class for source/header/doc generators, as well as some utility functions.""" from __future__ import unicode_literals import io import os import pdb import re import shutil...
import os import pathlib import torch import numpy as np from imageio import imread from scipy import linalg from torch.nn.functional import adaptive_avg_pool2d from skimage.measure import compare_ssim from skimage.measure import compare_psnr import glob import argparse import matplotlib.pyplot as plt from tools.incept...
<reponame>anybus/pythonMySQL #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'Frankie' from config import * from mysql.connector import errorcode import mysql.connector import traceback import sys import re class pythonMySQL(object): configs = {} # 设置连接参数,配置信息(字典) links = {} # 保存连接标识符(字典) NumberLink ...
<gh_stars>1-10 #!/usr/bin/python # # 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) any later version. # # Ansib...
%d', gen_state) except WindowsError as ex: if ex.winerror == 2: LOG.debug('Sysprep data not found in the registry, ' 'skipping sysprep completion check.') else: raise ex def check_service_exists(self, service_name): LOG.debug("Checking if service exists: %s", service_name) try: with self._get_service_handle(...
<filename>examples/hsgp.py<gh_stars>0 # Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 """ Example: Hilbert space approximation for Gaussian processes. ============================================================ This example replicates the model in the excellent case study by <NAME...
[escCharLookBehind, startTokenEsc] if self.setting('allowWhitespaceAfterDirectiveStartToken'): reParts.append('[ \t]*') reParts.append(validSecondCharsLookAhead) self.directiveStartTokenRE = cachedRegex(''.join(reParts)) self.directiveEndTokenRE = cachedRegex(escCharLookBehind + endTokenEsc) def _makePspREs(self...
= payment_terms_id body['phone_number'] = phone_number body['shipment_method_id'] = shipment_method_id body['tax_area_display_name'] = tax_area_display_name body['tax_area_id'] = tax_area_id body['tax_liable'] = tax_liable body['tax_registration_number'] = tax_registration_number body['type'] = type_ bo...
""" Transforms raw CORD-19 data into an articles.sqlite SQLite database. """ import csv import hashlib import json import os.path import re import sqlite3 from collections import Counter from multiprocessing import Pool from dateutil import parser from nltk.tokenize import sent_tokenize from .grammar import Grammar...
import os import json from Bio.Seq import Seq from django.test import TestCase import edge.recombine from edge.recombine import find_swap_region, recombine, remove_overhangs from edge.blastdb import build_all_genome_dbs, fragment_fasta_fn from edge.models import Genome, Fragment, Genome_Fragment, Operation class Re...
<gh_stars>0 from torch import nn from .layer import BertOnlyMLMHead from collections import defaultdict from torch.nn import functional as F import torch import numpy as np from .do_calculus import Matcher, BoxCoder, BalancedPositiveNegativeSampler, FastRCNNLossComputation from horovod import torch as hvd from .ot impo...
max(loc.rfind(slash) for slash in _SLASHES) autotrim_prefix = loc[0:slash_pos] if slash_pos > -1 else None elif len(records) > 1: common_prefix = records[0]["Location"].strip() for record in records[1:]: for (char_pos, char) in enumerate(record["Location"].strip()): if char_pos >= len(common_prefix): break if c...
for c in self.gtr.alphabet if c not in [self.gtr.ambiguous, '-']} total = np.sum(list(character_counts.values())) additional_columns = [(c,int(np.round(self.additional_constant_sites*n/total))) for c, n in character_counts.items()] columns_left = self.additional_constant_sites pi = len(positions) for c,n in addi...
<reponame>princenyeche/jiraone<filename>jiraone/management.py #!/usr/bin/env python # -*- coding: utf-8 -*- """ Get access to Atlassian User management REST API. You can use the same API key for the organizations REST API and the user management REST API. Create an API key from this URL https://confluence.atlassian.com...
= self.instance_tmpdir.getpath('adjustments.sqlite') writer = SQLiteAdjustmentWriter( dbpath, MockDailyBarReader(), self.trading_calendar.all_sessions, ) splits = mergers = create_empty_splits_mergers_frame() dividends = pd.DataFrame({ 'sid': np.array([1], dtype=np.uint32), 'amount': np.array([10.00], dtype=n...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Nov 5 13:51:51 2018 @author: ivar """ import os from execute import run_shell_command # Splitting NIFTI files along time axis and moving to destination for correction def extract_first_temporary_window_and_save(output_directory, \ blip_file, \ blip...
4.6, 5.6)*nanometers) topology_after = modeller.getTopology() dim3 = topology_after.getPeriodicBoxVectors() self.assertVecAlmostEqual(dim3[0]/nanometers, Vec3(3.6, 0, 0)) self.assertVecAlmostEqual(dim3[1]/nanometers, Vec3(0, 4.6, 0)) self.assertVecAlmostEqual(dim3[2]/nanometers, Vec3(0, 0, 5.6)) # Third way of ...
True if self.start is not None: return True return False @staticmethod def _meta_info(): from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_dnx_driver_oper as meta return meta._meta_table['Fia.Nodes.Node.OirHistory.Flags.Flag.Slots.Slot.CardInfo.OirCircularBuffer']['meta_info'] @property def _common_p...
else: form = ProposalFormEdit(request.POST, request.FILES, request=request, instance=obj) if form.is_valid(): obj = form.save() if form.changed_data: update_cached_project(obj) check_content_policy.CPVCheckThread(obj).start() if obj.Private.all(): for std in obj.Private.all(): mail_proposal_private(obj, std, "...
self.rvrow += 1 return def putFieldset ( self,fset_id,title ): pyrvapi.rvapi_add_fieldset ( fset_id,title,self.report_page_id(),self.rvrow,0,1,1 ) self.rvrow += 1 return def putSection ( self,sec_id,sectionName,openState_bool=False ): pyrvapi.rvapi_add_section ( sec_id,sectionName,self.report_page_id(), sel...
<gh_stars>10-100 import asyncio import logging import os import random import re from datetime import datetime, timedelta from pathlib import Path from typing import Callable, NamedTuple import aiohttp from async_timeout import timeout from buildpg import MultipleValues, Values, asyncpg from .actions import ActionTyp...
project.set_usage_export_bucket(bucket=bucket_name) def test__set_project_metadata(self): self.assertEqual( len(self.driver._set_project_metadata(None, False, "")), 0) # 'delete' metadata, but retain current sshKeys md = self.driver._set_project_metadata(None, False, "this is a test") self.assertEqual(len(md), ...
u('Santa Maria da Vit\u00f3ria - BA'), 'pt': u('Santa Maria da Vit\u00f3ria - BA')}, '55773484':{'en': 'Santana - BA', 'pt': 'Santana - BA'}, '55773485':{'en': 'Carinhanha - BA', 'pt': 'Carinhanha - BA'}, '55773488':{'en': 'Correntina - BA', 'pt': 'Correntina - BA'}, '55773489':{'en': 'Cocos - BA', 'pt': 'Cocos - B...
and var2 samples are given, wants samples of observation return self.sample_observations(var1, var2) def unif_to_sample(self, u: np.ndarray, var1: Union[np.ndarray, None] = None, var2: Union[np.ndarray, None] = None ) -> np.ndarray: # for R2 this u.shape is (2,) assert len(u) == 2 u_for_dist = u[0] ...
<reponame>skmezanul/seahub # encoding: utf-8 import hashlib import os import stat import json import mimetypes import urllib2 import logging from math import ceil import posixpath from django.core.cache import cache from django.core.urlresolvers import reverse from django.contrib import messages from django.http impor...
object. >>> w.histogram[-1] (8, 3) """ # if the a vertex-to-vertex network distance matrix is # not present in the `network.Network` object; calculate # one at this point if not hasattr(self, "distance_matrix"): self.full_distance_matrix(n_processes, gen_tree=gen_tree) # identify all network vertices which...
# -*- coding: utf-8 -*- ''' Integration tests for git_pillar The base classes for all of these tests are in tests/support/gitfs.py. Repositories for the tests are generated on the fly (look for the "make_repo" function). Where possible, a test case in this module should be reproduced in the following ways: 1. GitPyt...
<reponame>Rohith04MVK/Neutron-Bot import typing as t from abc import abstractmethod from collections import defaultdict from contextlib import suppress from dataclasses import field, make_dataclass from importlib import import_module import asyncpg from loguru import logger if t.TYPE_CHECKING: from bot.core.bot impo...
#!/usr/bin/env python """Autogenerated python functions to serialize/deserialize binary messages. Generated by: ../../scripts/aisxmlbinmsg2py.py Need to then wrap these functions with the outer AIS packet and then convert the whole binary blob to a NMEA string. Those functions are not currently provided in this file...
# -*- coding: utf-8 -*- """ @Module SARibbonBar @Author ROOT @brief SARibbonBar继承于QMenuBar,在SARibbonMainWindow中直接替换了原来的QMenuBar 通过setRibbonStyle()函数设置ribbon的风格 SARibbonBar参考office和wps,提供了四种风格的Ribbon模式,@ref SARibbonBar.RibbonStyle 如果想ribbon占用的空间足够小,WpsLiteStyleTwoRow模式能比OfficeStyle节省35%的高度空间 传统的Menu/ToolBar主要通过QMenu的a...
# Copyright 2020 StrongDM 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 writing, sof...
volume_nodes.GetNextItemAsObject() while volume_node: if 'M_Y4' in volume_node.GetName(): VolumeNode = volume_node break volume_node = volume_nodes.GetNextItemAsObject() elif 8 < ageLabel <= 15: VolumePath = os.path.join(ModuleDir, 'Templates', 'M_Y9.nrrd') slicer.util.loadVolume(VolumePath) volume_nodes = sli...
class IceFeature(object): def __init__(self): self.gmlId = None self.geometry = None def get_geometry(self): return self.__geometry def set_geometry(self, value): self.__geometry = value def get_gml_id(self): return self.__gmlId def set_gml_id(self, value): self.__gmlId = value gmlId = proper...
<reponame>Y0mingZhang/pytorch-lightning # 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 requi...
# cleanup db.volume_destroy(self.context, volume_id) os.unlink(dst_path) def test_create_volume_from_image_status_available(self): """Verify that before copying image to volume, it is in available state.""" self._create_volume_from_image('available') def test_create_volume_from_image_exception(self): """Verif...
import os import glob import re import sys import socket import couchdb import logging import argparse import yaml import json import distance import operator try: import ConfigParser except ImportError: import configparser CONFIG = {} logger = logging.getLogger(__name__) def setupServer(conf): db_conf = con...
= { "mountTargetId": mount_target_id } path_params = {k: v for (k, v) in six.iteritems(path_params) if v is not missing} for (k, v) in six.iteritems(path_params): if v is None or (isinstance(v, six.string_types) and len(v.strip()) == 0): raise ValueError('Parameter {} cannot be None, whitespace or empty string'...
<reponame>myamullaciencia/Bayesian-statistics # Bite Size Bayes Copyright 2020 <NAME> License: [Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/) import numpy as np import pandas as pd import matplotlib.pyplot as plt ## Review [In the prev...
<reponame>MahdadJafarzadeh/Zzzscoring<filename>Zzzscoring_v0.1.7.py # -*- coding: utf-8 -*- """ Created on Wed Jun 24 00:23:30 2020 @author: mahda # ============================================================================= # # Copyright (c) 2020 <NAME> # # Zzzscoring: A GUI-based package for sleep scoring! # ==...
self._set_volume() self.reinit_object() elif 'mass' in interventions_dict: for i in range(0, len(self._pybullet_client_ids)): pybullet.changeDynamics( self._block_ids[i], -1, mass=self._mass, physicsClientId=self._pybullet_client_ids[i]) elif 'friction' in interventions_dict: self._set_lateral_friction(self._...
node is for other pilot if item[3].pass_crossing_flag and item[0] >= max_lap_id - 1: # if called from 'check_race_time_expired()' then allow race tied after crossing if pass_node_index < 0: RACE.laps_winner_name = RACE.status_crossing else: # if called from 'pass_record_callback()' then no more ties RACE.laps_win...
image_stacks: results: """ #__table_args__ = (db.UniqueConstraint("study_id","position", name = "imgset_id"),) id = db.Column(db.Integer(), primary_key=True) study_id = db.Column(db.Integer(), db.ForeignKey("study.id"), nullable=False) position = db.Column(db.Integer(), nullable=False) image_stacks = db.relation...
<gh_stars>0 r""" Orthogonal Polynomials - The Chebyshev polynomial of the first kind arises as a solution to the differential equation .. MATH:: (1-x^2)\,y'' - x\,y' + n^2\,y = 0 and those of the second kind as a solution to .. MATH:: (1-x^2)\,y'' - 3x\,y' + n(n+2)\,y = 0. The Chebyshev polynomials of t...
504 , 486, 487, 522 , 522, 487, 523 , 507, 515, 485 , 485, 515, 514 , 508, 511, 509 , 509, 511, 510 , 511, 488, 510 , 510, 488, 489 , 512, 508, 513 , 513, 508, 509 , 515, 512, 514 , 514, 512, 513 , 516, 519, 517 , 517, 519, 518 , 519, 507, 518 , 518, 507, 485 , 520, 516, 521 , 521, 516, 517 , 523, 52...
<filename>juju/client/_client3.py # DO NOT CHANGE THIS FILE! This file is auto-generated by facade.py. # Changes will be overwritten/lost when the file is regenerated. from juju.client.facade import Type, ReturnMapping from juju.client._definitions import * class ActionFacade(Type): name = 'Action' version = 3 sc...
to indicate whether 'angle' is in degrees or radians. If True, 'angle' is interpreted as radians. :return: CompoundGeometry object rotated by 'angle' about 'rot_point' :rtype: :class:`~sectionproperties.pre.geometry.CompoundGeometry` The following example rotates a 200UB25 section with a plate clockwise by 30 degr...
""" ******************************************************************************** 2D Robot Localization - Benchmark ******************************************************************************** Goals of this script: - implement different UKFs on the 2D robot localization example. - design the Extended K...
<reponame>elxavicio/QSTK ''' (c) 2011, 2012 Georgia Tech Research Corporation This source code is released under the New BSD license. Please see http://wiki.quantsoftware.org/index.php?title=QSTK_License for license details. Created on April, 20, 2012 @author: <NAME> @contact: <EMAIL> @summary: Visualizer Main Code ...
await runt.snap.getNodeByNdef(node.get('n2')) if pivo: yield pivo, path.fork(pivo) continue ######################################################################### # regular "-> form" pivot (ie inet:dns:a -> inet:fqdn) found = False # have we found a ref/pivot? refs = node.form.getRefsOut() for refsname, r...
The support of the underlying event train (in seconds). """ return self._support @property def fs(self): """(float) Sampling rate / frequency (Hz).""" return self._fs @fs.setter def fs(self, val): """(float) Sampling rate / frequency (Hz).""" if self._fs == val: return try: if val <= 0: raise ValueErro...
configuration parameters""" config = self.config autogain = AutoGain() autogain.soft_tx_gain_0dBFS = config.soft_tx_gain if config.auto_soft_tx_gain is not None: autogain.recalc0dBFSEstimate(config.auto_soft_tx_gain) autogain.auto_soft_tx_gain_clip_frac = config.auto_soft_tx_gain_clip_frac return autogain d...
--* **[REQUIRED]** The Amazon Managed Blockchain instance type for the node. - **AvailabilityZone** *(string) --* **[REQUIRED]** The Availability Zone in which the node exists. :rtype: dict :returns: """ pass def create_proposal(self, ClientRequestToken: str, NetworkId: str, MemberId: str, Actions: Dict, Descr...
<reponame>vishvananda/dagster '''Scaffolding machinery for dagster-airflow. Entrypoint is scaffold_airflow_dag, which consumes a pipeline definition and a config, and generates an Airflow DAG definition each of whose nodes corresponds to one step of the execution plan. ''' import os from datetime import datetime, ti...
<filename>houdini/handlers/play/pet.py<gh_stars>1-10 import asyncio import operator import random import time from datetime import datetime, timedelta from houdini import handlers from houdini.constants import ClientType, StatusField from houdini.data.mail import PenguinPostcard from houdini.data.pet import PenguinPuf...
#!/usr/bin/env py50n """ $lic$ Copyright (C) 2019-2020 by The Board of Trustees of Stanford University This program is free software: you can redistribute it and/or modify it under the terms of the Modified BSD-3 License as published by the Open Source Initiative. This program is distributed in the hope that it will...
<gh_stars>1-10 import tensorflow as tf class _ResidualInnerBlock(tf.keras.Model): def __init__(self, num_filters_resnet_conv1, num_filters_resnet_conv2, kernel_size, *args, **kwargs): super().__init__(*args, **kwargs) self.conv1 = tf.keras.layers.Conv2D( filters=num_filters_resnet_conv1, kernel_size=[kernel_siz...
review2 = Rating.objects.create( addon=self.addon, body='review 2', user=user_factory()) review1.update(created=self.days_ago(1)) # Add a review belonging to a different add-on, a reply and a deleted # review. They should not be present in the list. review_deleted = Rating.objects.create( addon=self.addon, body='...
255) for _ in range(3)] c1, c2 = (int(x[0]), int(x[1])), (int(x[2]), int(x[3])) cv2.rectangle(img, c1, c2, color, thickness=tl) if label: tf = max(tl - 1, 1) # font thickness t_size = cv2.getTextSize(label, 0, fontScale=tl / 3, thickness=tf)[0] c2 = c1[0] + t_size[0], c1[1] - t_size[1] - 3 cv2.rectangle(img, c1,...
tf.cast(drop, tf.float32) masked_x = x * (1.0 - drop_mask)[Ellipsis, None] + missing_x * drop_mask[Ellipsis, None] shuffled_x = tf.concat([masked_x[1:], masked_x[:1]], 0) switch_mask = tf.cast(switch, tf.float32) masked_x = masked_x * ( 1.0 - switch_mask)[Ellipsis, None] + shuffled_x * switch_mask[Ellipsis, None...
<reponame>jamilatta/scielo-manager # -*- encoding: utf-8 -*- import urllib import hashlib import logging import choices import caching.base from scielomanager import tools try: from collections import OrderedDict except ImportError: from ordereddict import OrderedDict from django.db import ( models, transaction, ...
| | Cf. option | | | | | "ad_weight". | | +------------------+-----------------+------------------+------------------+ | compiler | OT_STRING | Just-in-time | casadi::Function | | | | compiler plugin | Internal | | | | to be used. | | +------------------+-----------------+------------------+------------------+ |...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Jun 4 10:34:22 2019 A class based formulation of other analyses. It is structured as: Dataset _| |_ | | Analysis Forecast ________________|________________ | | | SubxForecast EC45Forecast Seas5Forecast Dataset initialises the majority of the v...
<reponame>fplk/mcs-scene-generator import argparse import glob import logging import os import shapely from shapely import affinity import machine_common_sense as mcs import optimal_path DEBUG_DIRECTORY = './' PERFORMER_AGENT_MAX_REACH = 1 PERFORMER_AGENT_MASS = 2 TROPHY_SIZE = (0.19, 0.14) def action_to_string(a...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # This file is part of the bapsflib package, a Python toolkit for the # BaPSF group at UCLA. # # http://plasma.physics.ucla.edu/ # # Copyright 2017-2018 <NAME> and contributors # # License: Standard 3-clause BSD; see "LICENSES/LICENSE.txt" for full # license terms and co...
data PC_Height = Height[space[0]:space[1]][mask] # Determine the horizontal distance between RUAO and Point Charge. if method == 'static': Cloud_Height[i] = PC_Height elif method == 'dynamic': Cloud_Height[i] = ((Radiosonde_Data['Units']['range'][space[0]:space[1]][mask]/1000)**2 + PC_Height**2)...
import bottle import bottle.ext.sqlite from bottle import Bottle, abort, response, run, static_file, template, debug, redirect, request import json import sys app = Bottle() #install db connection plugin = bottle.ext.sqlite.Plugin(dbfile='./db/dietetika.sqlite') app.install(plugin) app.catchall = False # statične ...
<reponame>adolgert/cascade<filename>src/cascade/model/priors.py from copy import copy from functools import total_ordering import numpy as np import scipy.stats as stats from cascade.core import getLoggers CODELOG, MATHLOG = getLoggers(__name__) # A description of how dismod interprets these distributions and their ...
= None self.y_pos = None self.width = None self.height = None self.titlebar_height = None self.geom_update[int, int, int, int, int].connect(self.save_geometry) self.final_save.connect(self.app.final_save) self.shell_dock.visibilityChanged.connect(self.on_shelldock_toggled) # Notebook and Plot Tab Area signal...
<reponame>dbrandt/spambayes-lite """Core Web Interface Classes: CoreUserInterface - Interface class for basic (non-plugin) display Abstract: This module implements a browser based Spambayes user interface for the the core server. Users may use it to interface with various plugins. The following functions are curre...
= ftype[indx] cfieldid = self.fields['fieldid'][indx] if(minimize_time): ifield = np.where(self.field_array['fieldid'] == cfieldid)[0] if((len(ifield) == 0)): field_minimum_float[cfieldid] = 0.0 elif (self.field_array['cadence'][ifield[0]].strip() == 'none'): field_minimum_float[cfieldid] = 0.0 else: field_min...
import json import os,sys,platform,time from base64 import b64encode from datetime import datetime import re import lxml import lxml.html import lxml.etree import html import urllib.parse from collections import OrderedDict from collections import Mapping from xmljson import BadgerFish import io def getResourceFolder...