input
stringlengths
2.65k
237k
output
stringclasses
1 value
change_id: ChangeID, timeout: float = 30.0, delay: float = 0.1, ) -> Change: """Wait for the given change to be ready. If the Pebble server supports the /v1/changes/{id}/wait API endpoint, use that to avoid polling, otherwise poll /v1/changes/{id} every delay seconds. Args: change_id: Change ID of change to wa...
attrCtx_LVL2_IND0.name = 'EmployeeAddress__AddressCount' attrCtx_LVL2_IND0.parent = 'EmployeeAddresses_Resolved_referenceOnly/attributeContext/EmployeeAddresses_Resolved_referenceOnly/EmployeeAddress/_generatedAttributeSet' attrCtx_LVL2_IND0.definition = 'resolvedFrom/EmployeeAddresses/hasAttributes/EmployeeAddress/r...
'JLCC', 0x143, 0x13F), ('INT', '27960', 'EPROM', 'PLCC', 0x143, 0x13F), ('INT', '27C010', 'EPROM', 'DIP', 0x05C, 0x0CB), ('INT', '27C010', 'EPROM', 'PLCC', 0x05C, 0x0DE), ('INT', '27C010A', 'EPROM', 'DIP', 0x160, 0x0CB), ('INT', '27C011', 'EPROM', 'DIP', 0x05C, 0x0C9), ('INT', '27C020', 'EPROM', 'DIP', 0x05C, 0x0...
<gh_stars>10-100 import multiprocessing import os import codecs import copy import time import tensorflow as tf from nsm import agent_factory from nsm import data_utils from table.utils import init_experiment, FLAGS, get_train_shard_path, get_init_model_path, load_programs from table.utils import get_experiment_dir,...
pre_avg, post_avg, delta, wait): librosa.util.peak_pick(x, pre_max, post_max, pre_avg, post_avg, delta, wait) @pytest.mark.xfail(raises=librosa.ParameterError) def test_peak_pick_shape_fail(): # Can't pick peaks on 2d inputs librosa.util.peak_pick(np.eye(2), 1, 1, 1, 1, 0.5, 1) @pytest.mark.xfail(raises=librosa....
## @ingroup Components-Energy-Networks # Lift_Cruise.py # # Created: Jan 2016, <NAME> # Modified: Mar 2020, <NAME> # Apr 2021, <NAME> # Jul 2021, <NAME> # Jul 2021, <NAME> # Aug 2021, <NAME> # ---------------------------------------------------------------------- # Imports # ------------------------------------------...
sort1[1]: sort_again = sorted(fwd, key=lambda i: i["sort2"]) sort_again.insert(1, compound_date_link) return sort_again elif order == ["bc", "bc"]: rev = sorted(final, key=lambda i: i["sort1"], reverse=True) sort_again = rev if sort1[0] == sort1[1]: sort_again = sorted(rev, key=lambda i: i["sort2"]) ...
Welcome to PsychoPy2! v1.83.04 () ################ Running: F:\users\emiwar\edited_new\catAtt1.py ################ COM1 Serial<id=0x552a810, open=True>(port='COM1', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=2.5, xonxoff=False, rtscts=False, dsrdtr=False) 492 1 coast [('a', 1.7892104581749066)]...
<gh_stars>0 # -*- coding: utf-8 -*- __version__ = 6.0 import sys, os, time, random, threading from colorama import init, Fore, Back, Style init() warning = "["+Fore.RED+"!"+Fore.RESET+"]" question = "["+Fore.YELLOW+"?"+Fore.RESET+"]" information = "["+Fore.BLUE+"I"+Fore.RESET+"]" wait = "["+Fore.MAGENTA+"*"+Fore.RES...
import numpy as np import subprocess import fileinput import argparse import random import shutil import math import cv2 import os import sys global counter def createNumpyMatrix(geometricVertices): """Parse the strings from the obj file and convert them into numpy matrix of floats to perform math efficiently""" ve...
# -*- coding: utf-8 -*- # (C) Copyright 2014 Voyager Search # # 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 la...
array beta : NDArray beta array moving_mean : NDArray running mean of input moving_var : NDArray running variance of input eps : double, optional, default=0.0010000000474974513 Epsilon to prevent div 0. Must be no less than CUDNN_BN_MIN_EPSILON defined in cudnn.h when using cudnn (usually 1e-5) momentum : flo...
'861571686':{'en': 'Cangzhou, Hebei', 'zh': u('\u6cb3\u5317\u7701\u6ca7\u5dde\u5e02')}, '861571687':{'en': 'Cangzhou, Hebei', 'zh': u('\u6cb3\u5317\u7701\u6ca7\u5dde\u5e02')}, '861571688':{'en': 'Cangzhou, Hebei', 'zh': u('\u6cb3\u5317\u7701\u6ca7\u5dde\u5e02')}, '861571689':{'en': 'Cangzhou, Hebei', 'zh': u('\u6cb3...
def test_cluster_update_timeout_non_int(self, mock_enforce): self._mock_enforce_setup(mock_enforce, 'update', True) cid = 'aaaa-bbbb-cccc' body = {'cluster': {'timeout': '10min'}} req = self._put('/clusters/%(cluster_id)s' % {'cluster_id': cid}, json.dumps(body)) mock_call = self.patchobject(rpc_client.EngineC...
self._po.ff_fname = newff_name self._po._init = False if len(candidates): if optimize_during_scoring: # if we are going through the trouble to optimize every # split, always take the best candidates = sorted( candidates, key=lambda x: np.abs(x[7]), reverse=False ) # but bail if we didn't find any splits bel...
AttachDecorator.data_base64( mapping={"bogus": "proof"}, ident="indy", ) ], ), ) holder = async_mock.MagicMock(IndyHolder, autospec=True) get_creds = async_mock.CoroutineMock( return_value=( { "cred_info": {"referent": "dummy_reft"}, "attrs": { "player": "<NAME>", "screenCapture": "aW1hZ2luZSBhIHNjcmVlbiB...
energy units) - **temperature** (in thermal energy units) - **pressure** (in pressure units) - **pressure_xx**, **pressure_xy**, **pressure_xz**, **pressure_yy**, **pressure_yz**, **pressure_zz** (in pressure units) - The above quantities, tagged with a *_groupname* suffix are automatically available for any group...
<reponame>ezedonovan/ReadabiliPy """Common HTML cleaning functions.""" from bs4 import Comment, Doctype, NavigableString from .text import normalise_text def elements_to_delete(): """Elements that will be deleted together with their contents.""" html5_form_elements = ['button', 'datalist', 'fieldset', 'form', 'inpu...
<gh_stars>0 import datetime import hashlib import traceback import sys import json from pathlib import Path from typing import List, Optional, Tuple, Dict, NamedTuple, Iterable, Set, Any, Callable import click import yaml import openshift as oc from doozerlib.rpm_utils import parse_nvr from doozerlib.brew import Koji...
<filename>src/tests/google/appengine/api/search/QueryLexer.py #!/usr/bin/env python # # Copyright 2007 Google 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/li...
EvaluationCacheManager.CacheStatus.valid else: metrics.counter_inc(name="anchore_policy_evaluation_cache_misses_invalid") return EvaluationCacheManager.CacheStatus.invalid def flush(self): """ Flush all cache entries for the given image :return: """ session = get_session() for entry in session.query(CachedPo...
255, 255)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.BrightText, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.ButtonText, brush) brush = QtGui.QBrush(QtGui.QC...
<reponame>mwallraf/network-config-parser # -*- coding: utf-8 -*- import os import re import pprint #from netaddr import IPNetwork import logging import argparse import json import sys from nmsnetlib.parsers.carrierethernet import ERSParser, SAOSParser from nmsnetlib.parsers.parsercollection import ParserCollection fro...
iqdata_loc2.shape[0] no_of_data_loc3 = iqdata_loc3.shape[0] no_of_data_loc4 = iqdata_loc4.shape[0] no_of_data_loc5 = iqdata_loc5.shape[0] no_of_data_loc6 = iqdata_loc6.shape[0] no_of_data_loc7 = iqdata_loc7.shape[0] no_of_data_loc8 = iqdata_loc8.shape[0] no_of_data_loc9 = iqdata_loc9.shape[0] no_of_data_loc10 = iqdat...
= building_block._extract_functional_groups( functional_groups=functional_groups, ) building_block._with_functional_groups(functional_groups) building_block._placer_ids = ( building_block._normalize_placer_ids( placer_ids=placer_ids, functional_groups=building_block._functional_groups, ) ) building_block._cor...
from .baseservice import IDError from .sheetsservice import SheetsService class StatsService(SheetsService): def __repr__(self): return "<StatsService Object>" @property def viewer_id(self): if self.__viewer_id is None: raise IDError("Service id is uninitialized, use .initialize_env(...)") return self.__view...
from dataclasses import dataclass from functools import reduce from typing import Callable, Iterable, Iterator ''' The first phase of a compiler is called `lexical analysis` implemented by a `scanner` or `lexer`. It breaks a program into a sequence `lexemes`: meaningful substrings of the input. It also transforms le...
<gh_stars>1-10 import subprocess import platform import os import sys # Set these to None for compile/link debugging or subprocess.PIPE to silence # compiler warnings and errors. STDOUT = subprocess.PIPE STDERR = subprocess.PIPE # STDOUT = None # STDERR = None # This is the max length that I want a printed line to be...
<gh_stars>1-10 #! /usr/bin/env python ################################################################################################### # Script to generate specific random streams intended to verify correct load-balance in LAGs. # An inverse stream is sent from destination to source to perform MAC learning. # It ca...
<reponame>galizia-lab/pyview ''' Creates .lst file for single wavelength TIFF files (pre-calculated RATIO) in the format used in Trondheim Author: Giovanni, Dec 2021, based on template in VIEW folder by Ajay Expected data structure: In the folder "01_DATA", each animal has a folder, e.g. "190815_h2_El", and located...
data = h[0].data.tostring() headerFields = [] try: numberOfCols = header['NCOLTBL'] except KeyError as e: print("Cannot read the DCMP table column headers.") print(e) return [] try: for i in range(numberOfCols): headerFields.append(header['COLTBL%s'%(i+1)]) except KeyError as e: print("Cannot read the DC...
import datetime import pytest from flask import url_for from brewlog.models import TastingNote from . import BrewlogTests @pytest.mark.usefixtures('client_class') class TestTastingNoteListView(BrewlogTests): @pytest.fixture(autouse=True) def set_up(self, user_factory, brewery_factory): self.public_user = user_...
building. if split.startswith("test"): continue path = self.files_by_split[split] yield from self.load_data(path) def count_examples(self): ''' Compute here b/c we're streaming the sentences. ''' example_counts = {} for split, split_path in self.files_by_split.items(): example_counts[split] = sum( 1 for line...
# Utilities for generating multi-timestep splittings import itertools import numpy as np # To-do: add utilities for estimating the total number of force terms from simtk import openmm as mm def generate_solvent_solute_splitting_string(base_integrator="VRORV", K_p=1, K_r=3): """Generate string representing sequence ...
""" 348. Design Tic-Tac-Toe Medium Assume the following rules are for the tic-tac-toe game on an n x n board between two players: A move is guaranteed to be valid and is placed on an empty block. Once a winning condition is reached, no more moves are allowed. A player who succeeds in placing n of their marks in a ho...
rloc_probe else False ) if 24 - 24: OOooOOo if 71 - 71: IiII - i1IIi def is_smr ( self ) : return ( True if self . smr_bit else False ) if 56 - 56: OoOoOO00 + oO0o if 74 - 74: iII111i / I1Ii111 / II111iiii - iII111i / oO0o % I11i def is_smr_invoked ( self ) : return ( True if self . smr_invoked_bit else False )...
<reponame>tdongsi/calendars """ Test classes and functions for retail calendar. Use unittest module as the main test framework. All the test cases in this module assume default values of class parameters: 1) fiscal year starts on Aug 1st. 2) Retail calendar's end date is the last Saturday of July. It is hard to unit-...
'multnum2': r"{\s*(\d+)\s*,\s*(\d*)\s*}", 'multhashnum1': r"#{\s*(\d+)\s*}", 'multhashnum2': r"{\s*(\d+)\s*,\s*(\d*)\s*}" } class Sequence(DiagramItem): def __init__(self, *items): DiagramItem.__init__(self, 'g') self.items = [wrapString(item) for item in items] self.needsSpace = True self.up = 0 self.down = ...
import pygame from pygame import mixer import os import random import csv mixer.init() pygame.init() SCREEN_WIDTH = 800 SCREEN_HEIGHT = int(SCREEN_WIDTH*0.8) SCREEN = pygame.display.set_mode((SCREEN_WIDTH,SCREEN_HEIGHT)) pygame.display.set_caption('HALLOWEEN GAME') #SET FRAME RATE clock = pygame.tim...
import sys import os import datetime import logging from tqdm import tqdm import copy import numpy as np import re from concurrent import futures logger = logging.getLogger("sacluster").getChild(os.path.basename(__file__)) path = "../../.." os.chdir(os.path.dirname(os.path.abspath(__file__))) sys.path.append(path + ...
<gh_stars>0 # -*- coding: utf-8 -*- # Copyright (c) 2017-18 <NAME> and contributors # See LICENSE.rst for details. """ Encapsulates sending commands and data over a serial interface, whether that is I²C, SPI or bit-banging GPIO. """ import errno import time import luma.core.error from luma.core import lib __all__ =...
#! /usr/bin/python import os SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__)) import sys # Class containg statistic information gained from a dataset # Should be characteristic of a sequencing patform # This class is used from importing FQSTQSim profiles class FQSProfile: def __init__(self, name): self.na...
self.cur_player # If it is a game on lan, no need to show other players tiles on the rack if not self.lan_mode or self.lan_mode and self.own_mark == self.cur_play_mark: for letter, tile in zip(player.letters, self.rack): if letter == '@': tile.letter.set(' ') else: tile.letter.set(letter) tile['bg'] = '#BE975...
path_params['fk'] = params['fk'] query_params = {} header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.\ select_header_accept(['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascri...
""" A module for building and performing inference with cluster graphs """ # Standard imports import collections # Third-party imports import IPython import graphviz import matplotlib.pyplot as plt from matplotlib.lines import Line2D import networkx as nx import numpy as np from tqdm.auto import tqdm # Local imports...
4 (5 tiers) df['energyrate/period4/tier0'] = df['energyratestructure/period4/tier0rate'] + df['energyratestructure/period4/tier0adj'].fillna(0) df['energyrate/period4/tier1'] = df['energyratestructure/period4/tier1rate'] + df['energyratestructure/period4/tier1adj'].fillna(0) df['energyrate/period4/tier2'] = df['ener...
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ Configuration service utilities """ from argparse import ArgumentParser from configparser import RawConfigParser from astropy.io import fits import numpy as np import sys __all__ = ['ConfigurationException', 'Configuration'] class ConfigurationExc...
<gh_stars>1-10 import re from Queue import Queue from math import ceil from types import * WHITESPACE = ['\n', '\t', ' ', '', u'\u3000'] # from helpers.constants import WHITESPACE def splitKeepWhitespace(string): """ Splits the string on whitespace, while keeping the tokens on which the string was split. Args: s...
<filename>rotkehlchen/tests/api/test_blockchain.py<gh_stars>0 import logging from contextlib import ExitStack from http import HTTPStatus from unittest.mock import patch import pytest import requests from eth_utils import to_checksum_address from rotkehlchen.fval import FVal from rotkehlchen.logging import Rotkehlche...
from assess import * from sklearn_extra.cluster import KMedoids import cx_Oracle import json import platform import numpy as np import time # Library functions usings = [difference, ratio, reldifference] # , absdifference # labels = [quartile, # ok for all comparisons # likert3, likert5, # ok for difference and relati...
# Purpose: painless matplotlib embedding for wxPython # Author: <NAME> <<EMAIL>> # # Copyright 2005-2009 Illinois Institute of Technology # # See the file "LICENSE" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. """ Embedding matplotlib in wxPython applications is s...
= _messages.StringField(3) parent = _messages.StringField(4, required=True) class HealthcareProjectsLocationsDatasetsHl7V2StoresMessagesCreateRequest(_messages.Message): r"""A HealthcareProjectsLocationsDatasetsHl7V2StoresMessagesCreateRequest object. Fields: createMessageRequest: A CreateMessageRequest resourc...
import asyncio import json import time from collections.abc import Mapping from datetime import datetime, timedelta from enum import IntEnum, unique from functools import singledispatch from logging import getLogger from pprint import pformat from typing import Union, Optional, Any, Callable, Dict, Iterable from warnin...
<reponame>spencerpomme/Public-Transit-Status-with-Apache-Kafka<filename>consumers/venv/lib/python3.7/site-packages/mode/utils/objects.py """Object utilities.""" import collections.abc import sys import typing from contextlib import suppress from decimal import Decimal from functools import total_ordering from pathlib i...
An iTIP message has been sent to an attendee by the organizer. We need to update the attendee state based on the nature of the iTIP message. """ # Do security check: ORGANZIER in iTIP MUST match existing resource value if self.recipient_calendar: existing_organizer = self.recipient_calendar.getOrganizer() existi...
Generate video only insights. Ignore audio if present. Fails if no video is present. all_insights = "AllInsights" #: Generate both audio and video insights. Fails if either audio or video Insights fail. class OnErrorType(str, Enum): stop_processing_job = "StopProcessingJob" #: Tells the service that if this Transf...
each layer conditioned on the predicted class and candidate true classes test_stats_pred = np.zeros((n_test, self.n_layers)) pvalues_pred = np.zeros((n_test, self.n_layers)) test_stats_true = {c: np.zeros((n_test, self.n_layers)) for c in self.labels_unique} pvalues_true = {c: np.zeros((n_test, self.n_layers)) for ...
<filename>deep_verify/src/layers/layers.py # coding=utf-8 # Copyright 2019 DeepMind Technologies Limited. # # 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/LI...
# -*- coding: utf-8 -*- from __future__ import absolute_import, division import argparse import os import platform import re import shutil import subprocess import sys import warnings import setuptools from distutils.core import Command from Cython.Distutils import build_ext as _build_ext __package__ = 'pydriver' ...
DL_name_setting, redirectValue[tempB]-offset, int((self.uvValue[objCounter][tempB][0])*textureSize[0]), int((self.uvValue[objCounter][tempB][1])*textureSize[1]), DL_end_setting, self.uvValue[objCounter][tempB][0], self.uvValue[objCounter][tempB][1])) modifiedUVValues[objCounter][redirectValue[tempB]][0] = self.uvValu...
# By <NAME> # # Honeybee started by <NAME> is licensed # under a Creative Commons Attribution-ShareAlike 3.0 Unported License. """ Grizzlybear exports Honeybee zones to gbXML file - Provided by Honeybee 0.0.55 Args: EquipRange: reserved for future use LPDRange: reserved for future use bldgType: rese...
# -*- coding: utf-8 -*- """ Edit history Author : yda Date : 2020-11-12 Package name changed - asammdf to mdfstudio """ import logging from textwrap import fill import numpy as np from numpy.core.defchararray import encode from .blocks import v2_v3_blocks as v3b from .blocks import v4_blocks as v4b from .blocks....
<reponame>ssebastianj/ia2013-tpi-rl #!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import try: import cdecimal as decimal except ImportError: import decimal import csv import logging import multiprocessing import psutil import Queue import random import threading import time from Py...
new_instancemethod(_TopTools.Handle_TopTools_HArray1OfListOfShape__kill_pointed,None,Handle_TopTools_HArray1OfListOfShape) Handle_TopTools_HArray1OfListOfShape_swigregister = _TopTools.Handle_TopTools_HArray1OfListOfShape_swigregister Handle_TopTools_HArray1OfListOfShape_swigregister(Handle_TopTools_HArray1OfListOfShap...
except that the new cluster is created with the default cluster security and parameter groups. After Amazon Redshift creates the cluster, you can use the ModifyCluster API to associate a different security group and different parameter group with the restored cluster. If you are using a DS node type, you can also choos...
<filename>python/quick_der/classes.py # classes.py -- The various classes in the ASN.1 supportive hierarchy import _quickder from packstx import * import primitive import format import builder if not 'intern' in dir (globals () ['__builtins__']): try: from sys import intern except: intern = lambda s: s # ...
lcl_8: lcl_8 = rbnf_named__check_3 else: lcl_9 = rbnf_named__check_3[1] rbnf_tmp_3 = lcl_9 lcl_9 = rbnf_tmp_0.lineno lcl_10 = rbnf_tmp_0.value lcl_10 = unwrap(lcl_10) lcl_11 = rbnf_tmp_1.value lcl_11 = unwrap(lcl_11) lcl_10 = Prod(lcl_10, lcl_11, rbnf_tmp_2, rbnf_tmp_3) lcl_10 = (lcl_9, lcl_10) rbnf_tmp_1_ ...
"""Module for various abstractions to common actions that may involve \ controlling multiple components.""" from kinetic import components as Components class DualMotor: """Abstraction for dual motor drive train.""" def __init__(self, motor_left: Components.Kinetics.Motor, motor_right: Components.Kinetics.Motor...
""" Some species in the dataframe have observed as well as climatology values. For these species, plot up X/Y and latitudinal comparisons """ import seaborn as sns sns.set(color_codes=True) current_palette = sns.color_palette("colorblind") sns.set_style("darkgrid") # Get the observational data if isinstance(df...
timeout_after(0.05) as ta: await coro1() results.append('coro1 success') except TaskTimeout: results.append('coro1 timeout') except TimeoutCancellationError: results.append('coro1 timeout cancel') assert not ta.expired await coro2() results.append('coro2 success') async def parent(): try: async with timeo...
Any) -> str: """Builds the PCE request endpoint.""" endpoint = self.endpoint if parent: # e.g. /sec_policy/active/rulesets/1/sec_rules parent_draft_href = convert_active_href_to_draft(href_from(parent)) endpoint = '{}/{}'.format(parent_draft_href, endpoint) else: # mutually exclusive as the parent HREF will have...
from hdfs import InsecureClient from io import StringIO import json import math import numpy as np import os import pandas as pd from pyspark import SparkConf, SparkContext, StorageLevel import random import re import shutil from sklearn.ensemble import RandomForestRegressor from sklearn.impute import SimpleImputer fro...
and output RA and DEC vectors are in radians rather than degrees RESTRICTIONS: Accuracy of precession decreases for declination values near 90 degrees. PRECESS should not be used more than 2.5 centuries from 2000 on the FK5 system (1950.0 on the FK4 system). EXAMPLES: (1) The Pole Star has J2000.0 coordinate...
<reponame>lewisl9029/pulumi # Copyright 2016-2021, Pulumi 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 ap...
<reponame>luoyu-123/ezdxf # Copyright (c) 2019-2020 <NAME> # License: MIT License from typing import TYPE_CHECKING, Iterable, List, Union from contextlib import contextmanager from ezdxf.lldxf.attributes import DXFAttr, DXFAttributes, DefSubclass, XType from ezdxf.lldxf.const import SUBCLASS_MARKER, DXF2000, DXFTypeErr...
<gh_stars>0 import math import warnings import numpy import six from chainer import configuration from chainer import cuda from chainer.functions.math import identity from chainer import testing from chainer import variable def _copy_arrays(xs): xp = cuda.get_array_module(*xs) return [xp.array(x, order='C', dtype...
<gh_stars>100-1000 # Copyright (c) 2016, <NAME>, www.az2000.de # All rights reserved. # file created 2011-04-15 # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the abov...
be the retention policy. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :param frequency_interval: Required. How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and F...
plot.fig.axes[0].autoscale(tight=True) plot.fig.axes[1].autoscale(tight=True) return alldata #%% def sweepgate(scanjob): """ Return the sweepgate in a scanjob """ g = scanjob['sweepdata'].get('param', None) if isinstance(g, str): return g if isinstance(g, qcodes.Parameter): return g.name g = scanjob['sweep...
<filename>nautobot/core/api/views.py import logging import platform from collections import OrderedDict from django import __version__ as DJANGO_VERSION from django.apps import apps from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from django.http.response import HttpResponseBadRe...
<filename>tests/execute_w3c_tests.py #!/usr/bin/env python3 # # Copyright (c), 2018-2021, SISSA (International School for Advanced Studies). # All rights reserved. # This file is distributed under the terms of the MIT License. # See the file 'LICENSE' in the root directory of the present # distribution, or http://opens...
data required def test_create_gps_device_log_with_driver(self): self.minimum_valid_data["device"] = self.gps_device.id self.client.credentials(HTTP_AUTHORIZATION=self.token) response = self.client.post(self.create_url, self.minimum_valid_data, format='json') self.assertEqual(response.status_code, status.HTTP_201_C...
-> None: self.start_poll() response = self.request( "poll.vote", {"value": {"1": 1, "2": 0}, "id": 1, "user_id": 1}, ) self.assert_status_code(response, 200) self.assert_model_exists("vote/1") self.assert_model_not_exists("vote/2") poll = self.get_model("poll/1") self.assertEqual(poll.get("votesvalid"), "1.00...
<reponame>Smithsonian/cheby_checker # -*- coding: utf-8 -*- # cheby_checker/cheby_checker/orbit_cheby.py """ -------------------------------------------------------------- cheby_checker's orbit_cheby module. 2020 - 2022 <NAME> & <NAME> & <NAME> This module provides functionalities to evaluate dictionaries of ...
# -*- coding: utf-8 -*- """ Created on Thu May 11 14:40:19 2017 @author: ishort """ import math import Useful def convec(numDeps, tauRos, depths, temp, press, rho, kappa, kappaSun, zScale, teff, logg, mmw): logE = math.log10(math.E) #// for debug output ln10 = math.log(10.0) #//needed to convert lo...
<reponame>forked-group/invest-python # pylint:disable=too-many-lines from dataclasses import dataclass from datetime import datetime from typing import List from . import _grpc_helpers class SecurityTradingStatus(_grpc_helpers.Enum): SECURITY_TRADING_STATUS_UNSPECIFIED = 0 SECURITY_TRADING_STATUS_NOT_AVAILABLE_FOR...
import numpy #import pyPyrUtils as ppu import pyPyrUtils #import pyPyrCcode import math import matplotlib.cm import os import scipy.misc import cmath import JBhelpers import pylab import copy class pyramid: # pyramid # properties pyr = [] pyrSize = [] pyrType = '' image = '' # constructor def __init__(self): ...
#! /usr/bin/env python ''' . ABOUT: USAGE: DEPENDS: Python 2.5 or 2.6 (not version 3.x compatible) EXITSTA: 0: No errors AUTHOR : <NAME>, for STScI HISTORY: May 15 2009: Initial Version @author: <NAME> ''' __author__ = '<NAME>' __version__ = '0.9' #Processes command line arguments def process_args(ju...
None] - crat4[:, :, None] * ssinwt) ca = np.sqrt((wm[:, :, None] - wp[:, :, None] * ceiwt) / 2 / (wp[:, :, None] - wm[:, :, None] * ceiwt)) cpsi = np.sqrt(1 / psipre[:, :, None] / (1 - psirat[:, :, None] * ceiwt2)) cf = -(wg[-3:, None] * (1 - ceiwt)) / (wp[:, :, None] - wm[:, :, None] * ceiwt) cesum = rat[:, :, Non...
collect a small handful of RGBDWithPose msgs - call the FindBestMatch service (a service of pdc-ros) - return what was found from FindBestMatch """ # self.moveHome() rgbdWithPoseMsg = self.captureRgbdAndCameraTransform() listOfRgbdWithPoseMsg = [rgbdWithPoseMsg] self.list_rgbd_with_pose_msg = listOfRgbdWithPo...
@classmethod def from_dict(cls, _dict: Dict) -> 'GenericComponentResponseMspCa': """Initialize a GenericComponentResponseMspCa object from a json dictionary.""" args = {} if 'name' in _dict: args['name'] = _dict.get('name') if 'root_certs' in _dict: args['root_certs'] = _dict.get('root_certs') return cls(**args...
<reponame>157239n/k1lib<gh_stars>1-10 # AUTOGENERATED FILE! PLEASE DON'T EDIT """This module is for all things related to atoms, molecules and their simulations""" import k1lib from typing import Dict, List settings = k1lib.Settings().add("overOctet", False, "whether to allow making bonds that exceeds the octet rule") ...
<filename>backend/ozon/core/ModelData.py # Copyright INRIM (https://www.inrim.eu) # See LICENSE file for full licensing details. import sys import os import logging import pymongo import ujson from .database.mongo_core import * from .BaseClass import PluginBase from .QueryEngine import QueryEngine from fastapi.exceptio...
from typing import Dict, Generator, List, Set, Union from collections import defaultdict import json import copy import re from fuzzy_search.fuzzy_phrase import Phrase def as_phrase_object(phrase: Union[str, dict, Phrase], ngram_size: int = 2, skip_size: int = 2) -> Phrase: if isinstance(phrase, Phrase): return ph...
<filename>extra/extra_analysis/logreg.py """ logreg.py This module contains functions to run and analyse logistic regressions to predict stimulus information from ROI activity for data generated by the Allen Institute OpenScope experiments for the Credit Assignment Project. Authors: <NAME> Date: October, 2018 Not...
units = obj_tables.sci.units.UnitAttribute(unit_registry, choices=(unit_registry.parse_units('molecule'),), default=unit_registry.parse_units('molecule')) references = obj_tables.ManyToManyAttribute(Reference, related_name='observables') identifiers = IdentifierAttribute(related_name='observables') class Meta(obj...
filter the metric stream. Only refer to datums emitted to the metric stream with the given unit and ignore all others. Only useful when datums are being emitted to the same metric stream under different units. The default is to use all matric datums in the stream, regardless of unit, which is recommended in nearly all ...
<filename>yamtbx/dataproc/auto/command_line/multi_check_cell_consistency.py """ (c) RIKEN 2015. All rights reserved. Author: <NAME> This software is released under the new BSD License; see LICENSE. """ import iotbx.phil from cctbx import uctbx from cctbx import sgtbx from cctbx import crystal from cctbx.crystal impor...
# calculate last-modified time and etag if zip: info = zip.getinfo(paths[-1]) lm = util.zip_timestamp(info) last_modified = http_date(lm) etag = "%s-%s-%s" % ( lm, info.file_size, adler32(info.filename.encode("utf-8")) & 0xFFFFFFFF, ) else: stats = os.stat(paths[0]) last_modified = http_date(stats.st_mtime...
> 2) def test_cdist_rogerstanimoto_random(self): eps = 1e-07 X1 = eo['cdist-X1'] < 0.5 X2 = eo['cdist-X2'] < 0.5 Y1 = cdist(X1, X2, 'rogerstanimoto') Y2 = cdist(X1, X2, 'test_rogerstanimoto') _assert_within_tol(Y1, Y2, eps, verbose > 2) def test_cdist_russellrao_random(self): eps = 1e-07 X1 = eo['cdist-X1']...