input
stringlengths
2.65k
237k
output
stringclasses
1 value
1], zkey: xyz[:, 2]}) else: already_done = {xkey, ykey, zkey}.issubset(datanames) if not already_done: rdz = self._get_rdz(realspace=realspace, dataset=dataset) xyz = self.rdz2xyz(rdz) util.update_table(dataset, {xkey: xyz[:, 0], ykey: xyz[:, 1], zkey: xyz[:, 2]}) xyz = util.xyz_array(dataset, keys=[xkey, ykey...
n, h]) + pos_emb) def _AttenContext(self, theta, probs, value): # TODO(jamesqin): optimize it. encoded = tf.einsum('BNij,BjNH->BiNH', probs, value) if not self.params.skip_value_emb: encoded += tf.einsum('BNij,ijNH->BiNH', probs, self._RelativePositionValueEmb(theta, value)) return encoded def _AttenContextO...
<reponame>jgarwin95/Interstellar_Escort<filename>Interstellar_Escort.py import pygame import random import os import time class Boundary: '''Generate pygame display window. Args: width (int): width of display in number of pixels height(int): height of display in number of pixels ''' back_ground = pygame.image....
# Generated by the protocol buffer compiler. DO NOT EDIT! # sources: steammessages_parental.steamclient.proto # plugin: python-betterproto # Last updated 09/09/2021 from dataclasses import dataclass from typing import List import betterproto class EProfileCustomizationType(betterproto.Enum): Invalid = 0 RareAchie...
int or None :param resources: The resources to be allocated :type resources:\ :py:class:`pacman.model.resources.resource_container.ResourceContainer` :return: True if there is a core available given the constraints, or\ False otherwise :rtype: bool """ # TODO: Check the resources can be met with the processor ...
<gh_stars>0 # SPDX-FileCopyrightText: 2019 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT """ `adafruit_lsm303_accel` ==================================================== CircuitPython driver for the accelerometer in LSM303 sensors. * Author(s): <NAME>, <NAME> Implementation Notes ----------------...
classification. """ if molecule not in self.molecules: raise KeyError("molecule not in system") self.molecules.remove(molecule) for bond in molecule.bonds: self.bonds.remove(bond) for angle in molecule.angles: self.angles.remove(angle) for dihedral in molecule.dihedrals: self.dihedrals.remove(dihedral) fo...
<filename>tests/test_dbdiff.py import logging import os from pathlib import Path import pandas as pd import pytest from click.testing import CliRunner from dbdiff.main import check_primary_key from dbdiff.main import create_diff_table from dbdiff.main import create_joined_table from dbdiff.main import get_column_diff...
raise ValueError("Not safe to evaluate code generated with default_assumptions") from sage.misc.sage_eval import sage_eval result = sage_eval(ans, preparse=preparse) print(ans) return result else: return ans valid_name_re = re.compile('^[a-zA-Z_][a-zA-Z0-9_]*$') def name_is_valid(name): r""" Test whether a str...
(multiplayer_send_2_int_to_player, ":cur_player", multiplayer_event_set_team_score, ":team_2_score", ":team_1_score"), (call_script, "script_multiplayer_server_swap_player", ":cur_player"), (try_end), (try_end), # Vincenzo end #auto team balance control at the end of round (assign, ":number_of_players_at_te...
<gh_stars>0 """ This module provides a class for interfacing with sensors and actuators. It can add, edit and remove sensors and actuators as well as monitor their states and execute commands. """ from datetime import datetime, timedelta from json import dumps, loads from os import getpid, path from threading import Ev...
with the lowest value 'max' - choose the index with the highest value 'random' - choose the index randomly int - choose the index int Na = number of atoms, Nc = number of conformations Atomic Positions ‘coordinates’ Å float32 (Nc, Na, 3) Atomic Numbers ‘atomic_numbers’ — uint8 (Na) Total Energy ‘wb97x_dz.ener...
<reponame>MerleLiuKun/python-youtube """ Main Api implementation. """ from typing import Optional, List, Union import requests from requests.auth import HTTPBasicAuth from requests.models import Response from requests_oauthlib.oauth2_session import OAuth2Session from pyyoutube.error import ErrorCode, ErrorMessage, ...
destination_address IP Address of this interface **type**\: str **pattern:** (([0\-9]\|[1\-9][0\-9]\|1[0\-9][0\-9]\|2[0\-4][0\-9]\|25[0\-5])\\.){3}([0\-9]\|[1\-9][0\-9]\|1[0\-9][0\-9]\|2[0\-4][0\-9]\|25[0\-5])(%[\\p{N}\\p{L}]+)? **config**\: False .. attribute:: prefix_length Prefix length of the I...
== 0: depth1.append(moves) if re.match(r'\+r|r', Wboard.w9e)and Wboard.w3e==''\ and board.s8e+board.s7e+board.s6e+board.s5e+board.s4e=='': moves = '9e3e' kaihimore(moves) if oute.oute == 0: depth1.append(moves) if re.match(r'\+r|r', Wboard.w9e)and Wboard.w2e==''\ and board.s8e+board.s7e+board.s6e+board.s5e+boa...
#!/usr/bin/env python #################### # Required Modules # #################### # Generic/Built-in import logging import signal import sys import time from multiprocessing import Process from typing import Dict, List # Lib # Custom from .base import RootLogger from .config import ( DIRECTOR_NAME_TEMPLATE, ...
self.node.dt.filename, self)) return self.node.dt.phandle2node[int.from_bytes(self.value, "big")] def to_nodes(self): """ Returns a list with the Nodes the phandles in the property point to. Raises DTError if the property value contains anything other than phandles. All of the following are accepted: foo = ...
# coding: utf-8 """ Experimental Looker API 3.1 Preview This API 3.1 is in active development. Breaking changes are likely to occur to some API functions in future Looker releases until API 3.1 is officially launched and upgraded to beta status. If you have time and interest to experiment with new or modified servi...
# -*- coding: utf-8 -*- ''' Data Handler Module This module contains a class for managing a data processing pipeline ''' from time import time from datetime import timedelta import numpy as np import pandas as pd from scipy.stats import mode, skew from scipy.interpolate import interp1d from sklearn.cluster import DBS...
config.volumes_dir os.environ['sql_test_password'] = <PASSWORD> def configure(args): """ Returns config using a file, arguments, or interactive input. """ _f = args.config_file config = None if get_config_file_needed(args): if not os.path.exists(_f): _o = input_with_validator('Config file "%s" does not exist....
<reponame>BayesWatch/pytorch-moonshine # blocks and convolution definitions import math import torch import torch.nn as nn import torch.nn.functional as F from torch.autograd import Variable try: from pytorch_acdc.layers import FastStackedConvACDC except ImportError: # then we assume you don't want to use this laye...
5526, 5527, 5533, 5532) model.createElement(3920, 2687, 2688, 2694, 2693, 5527, 5528, 5534, 5533) model.createElement(3921, 2688, 2689, 2695, 2694, 5528, 5529, 5535, 5534) model.createElement(3922, 2689, 2690, 2696, 2695, 5529, 5530, 5536, 5535) model.createElement(3923, 2690, 618, 617, 2696, 5530, 3065, 3066, 5536) mo...
all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_person_relationships" % key ) local_var_params[key] = val del local_var_params['kwargs'] if self.api_client.client_side_validation and ('id_type_scope' in local_var_params and # noqa: E501 len(local_var_params['id_type_sc...
the request. with mock.patch.object( type(client.transport.delete_transition_route_group), "__call__" ) as call: client.delete_transition_route_group() call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == transition_route_group.DeleteTransitionRouteGroupRequest() @pytest.mark.asyncio async de...
job.get_resources() # Get job info off of the queue queue = Queue.objects.get(job_id=job.id) queued_job_exe = QueuedJobExecution(queue) queued_job_exe.scheduled('agent_1', node.id, resources) job_exe_model = queued_job_exe.create_job_exe_model(framework_id, now()) # Test method with patch('job.execution.configu...
SetEMotorS(api, index, isEnabled, speed, distance, isQueued=0): emotorS = EMotorS() emotorS.index = index emotorS.isEnabled = isEnabled emotorS.speed = speed emotorS.distance = distance queuedCmdIndex = c_uint64(0) if slaveDevType == DevType.Magician: tempSlaveId = slaveId elif masterDevType == DevType.Conntro...
instead.""" if value_mapper is None: value_mapper = {} if block_mapper is None: block_mapper = {} operands = [ (value_mapper[operand] if operand in value_mapper else operand) for operand in self.operands ] result_types = [res.typ for res in self.results] attributes = self.attributes.copy() successors = [(blo...
<reponame>J007X/forte<filename>forte/datasets/wikipedia/dbpedia/dbpedia_datasets.py # Copyright 2019 The Forte 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 # ...
34, "metric_value": 0.232, "depth": 11} if obj[5]>1: # {"feature": "Direction_same", "instances": 18, "metric_value": 0.1049, "depth": 12} if obj[10]<=0: return 'True' else: return 'True' elif obj[5]<=1: # {"feature": "Direction_same", "...
import os class TuringMachine: def __init__(self): print(self) @staticmethod def getInputData(): return input("\n\t\t\t\t\t Digite o Numero : ") # *********************************************************************** def divisao(self): # *******************************************************************...
<filename>test/test.py # To run: # gmake install in $IPC_DIR/python # export PYTHONPATH="$IPC_DIR/python:$IPC_DIR/lib/$SYS" # where IPC_DIR is the location of IPC and SYS is the system type # (e.g., Linux-3.8) # Run $IPC_DIR/bin/$SYS/central in a separate terminal # export CENTRALHOST=localhost # python # import test; ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Generated Sat Mar 7 09:04:16 2020 by generateDS.py version 2.35.15. # Python 3.8.1 (v3.8.1:1b293b6006, Dec 18 2019, 14:08:53) [Clang 6.0 (clang-600.0.57)] # # Command line options: # ('--no-namespace-defs', '') # ('-o', './python/landed_cost_web_service_schema.py') # #...
- start d = n if amount > 1: # The delta value is divided by amount-1, because we also want the last point (t=1.0) # If we don't use amount-1, we fall one point short of the end. # If amount=4, we want the point at t 0.0, 0.33, 0.66 and 1.0. # If amount=2, we want the point at t 0.0 and 1.0. d = float(n) / (amo...
'code', 'old', 'new']) for change in self.changeList: if change.frame not in self.undone_changes: writer.writerow( [ change.frame, change.end, change.change.name, change.change.value, change.orig, change.new, ] ) @qc.pyqtSlot(str) def loadChangeList(self, fname: str) -> None: self.changeList.clear() wi...
# -*- coding: utf-8 -*- from datetime import time, datetime, timedelta from .interval import Interval, AbsoluteInterval from .mixins.default import TranslatableMixin, FormattableMixing, TestableMixin from .constants import ( USECS_PER_SEC, SECS_PER_HOUR, SECS_PER_MIN ) class Time(TranslatableMixin, FormattableMixi...
<filename>tests/infra/remote.py # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache 2.0 License. import os import time from enum import Enum import paramiko import logging import subprocess import getpass from contextlib import contextmanager import infra.path import json from logur...
<filename>redback/transient/transient.py from __future__ import annotations from typing import Union import matplotlib import numpy as np import pandas as pd import redback from redback.plotting import \ LuminosityPlotter, FluxDensityPlotter, IntegratedFluxPlotter, MagnitudePlotter class Transient(object): DATA_...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011-2013 Codernity (http://codernity.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
def save(self): self.paramSave() #兼容PHP那边旧版本的强密码规则开关 #关闭PHP的开关 DomainAttr.saveAttrObjValue( domain_id=self.domain_id.value, type=u"webmail", item="sw_pass_severe", value="-1" ) #使用超管这边的开关 DomainAttr.saveAttrObjValue( domain_id=self.domain_id.value, type=u"webmail", item="sw_pass_severe_new", value="1" )...
from __future__ import absolute_import, division, print_function import os, random import numpy as np from enum import Enum import cv2 # for FaceEncoderModels.LBPH, FaceEncoderModels.OPENFACE import pickle # for FaceEncoderModels.OPENFACE and FaceEncoderModels.DLIBRESNET from imutils import paths # for FaceEncode...
Zendesk " + str(role)) ################################################# botlog.LogSymphonyInfo(str(firstName) + " " + str(lastName) + " (" + str(displayName) + ") from Company/Pod name: " + str( companyName) + " with UID: " + str(userID)) callerCheck = (str(firstName) + " " + str(lastName) + " - " + str(displayN...
<filename>gw1/wat1.py #!/usr/bin/env python2 # -*- coding: utf-8 -*- from datetime import datetime,date import time import calendar import json import math import os,sys import socket import traceback import urllib2 as urllib user = "GW1" test = False if test: host = "greenwall.gembloux.uliege.be" else: host = "lo...
""" Copyright BOOSTRY Co., Ltd. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distr...
<filename>pylablib/aux_libs/devices/PCO_SC2.py from . import PCO_SC2_lib from .PCO_SC2_lib import lib, PCOSC2LibError, named_tuple_to_dict from ...core.devio.interface import IDevice from ...core.utils import funcargparse, py3, dictionary, general from ...core.dataproc import image as image_utils _depends_local=[".PC...
states: A `.NestedMap` of tensors representing states that the clients would like to keep track of for each of the active hyps. num_hyps_per_beam: Beam size. Returns: A tuple (results, out_states). results: A `.NestedMap` of beam search results. atten_probs: The updated attention probs, of shape [tgt_batch, src_...
not sufficing) is ruled out by later assertion, `pads_built`. # Frontend also assures this in `compute_padding_fr`, and/or via # `scale_diff_max_to_build` repeat_last_built_id(scale_diff, scale_diff_last_built) continue elif (scale_diff_max_to_build is not None and scale_diff > scale_diff_max_to_build): assert s...
<filename>sdk/python/pulumi_azure_native/insights/v20210201preview/scheduled_query_rule.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typ...
0x7E0000 - WRAM_START): cmd += b'\xA9' # LDA cmd += bytes([byte]) cmd += b'\x8F' # STA.l cmd += bytes([ptr & 0xFF, (ptr >> 8) & 0xFF, (ptr >> 16) & 0xFF]) cmd += b'\xA9\x00\x8F\x00\x2C\x00\x68\xEB\x68\x28\x6C\xEA\xFF\x08' PutAddress_Request['Space'] = 'CMD' PutAddress_Request['Operands'] = ["2C00", hex(len(cmd...
from string import letters, digits from random import choice from django.shortcuts import render_to_response from django.http import HttpResponseRedirect, HttpResponse from django.template import RequestContext from django.utils.translation import ugettext_lazy as _ import json from instance.models import Instance fr...
3.0] # only check ratios that are feasible for buying leveraged ETFs (i.e., there are only 2X and 3X funds) param_sweep_function = lambda use_sat_utility, utility_param: param_sweep_exp_util_M_t( \ THETA_VALUES_FOR_SWEEP, default_market.annual_margin_interest_rate, \ default_market.annual_mu, default_investor.years_...
25: return 2 else: return 4 else: return 2 else: if f4 <= 13: if f4 <= 10: if f4 <= 1: return 2 else: if f4 <= 6: return 3 else: if f4 <= 8: return 2 else: return 3 else: return 2 else: if f4 <= 30: if f4 <= 27: if f4 <= 23: if f5 <= 10: if f5 <= 1: return 3 else: if f4 <= 19: if f4 <= 17:...
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.496534, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime ...
+ u"vous devez indiquer l'heure de départ et l'heure d'arrivée") return if h_from > h_to: QMessageBox.critical(self, u"Error - InterNotes", u"Pour chaque absence, " + u"l'heure de départ doit être inférieur à l'heure d'arrivée") return if 'away_id' in away_data[a]: self.updateOldAway(away_data[a]['away_id...
None: sp = stellar_spectrum('G2V') # Just for good measure, make sure we're all in the same wave units bp_lim.convert(bp.waveunits) sp.convert(bp.waveunits) # Renormalize to 10th magnitude star (Vega mags) mag_norm = 10.0 sp_norm = sp.renorm(mag_norm, 'vegamag', bp_lim) sp_norm.name = sp.name # Set up an o...
help_n # Unimacro User directory and Editor or Unimacro INI files----------------------------------- def do_o(self, arg): arg = self.stripCheckDirectory(arg) # also quotes if not arg: return self.config.setUnimacroUserDir(arg) def do_O(self, arg): self.message = "Clearing Unimacro user directory, and disabl...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import json import random import uuid import werkzeug from odoo import api, exceptions, fields, models, _ from odoo.exceptions import AccessError from odoo.osv import expression from odoo.tools import is_html_empty cl...
[u'k'] , u'㢁' : [u'c'] , u'夀' : [u's'] , u'綃' : [u'x', u's'] , u'騂' : [u'x'] , u'䄐' : [u'q'] , u'斓' : [u'l'] , u'舒' : [u'y', u's'] , u'椠' : [u'q'] , u'亥' : [u'h'] , u'莧' : [u'x', u'w', u'h'] , u'刲' : [u'k'] , u'皵' : [u'q'] , u'霴' : [u'd'] , u'㥀' : [u'd'] , u'穂' : [u's'] , u'叇' : [u'd'] , u'铉' : [u'x'] , u'扒' : [u'p', u...
process itself, useful for various things (such as attaching a remote debugger).""", filename="/mp/simics-3.0/src/core/common/generic_commands.py", linenumber="1894") # # -------------------- readme -------------------- # def readme_cmd(): print SIM_readme() new_command("readme", readme_cmd, [], type = ["Help"], ...
given fields # # Maybe set the field's values as defaults. # # Set as primary key the index_column (if given); this will # normally be the RunID and there is a limitation in that it # can't be an unlimited length SQL type; hence we set it in # self.sql_types_by_field to be a vachar(255) (if anyone sets # a RunI...
print 'conx.type_size_dic.has_key(SQL_TYPE_DATE)' sql_type = SQL_TYPE_DATE buf_size = self.connection.type_size_dic[SQL_TYPE_DATE][0] ParameterBuffer = create_buffer(buf_size) col_size = self.connection.type_size_dic[SQL_TYPE_DATE][1] else: # SQL Sever <2008 doesn't have a DATE type. sql_type = SQL_TYPE_TIMEST...
*/ 0x0089: 2, /* FWRITELN */ 0x008A: 2, /* FWRITE */ 0x008C: 1, /* DATEVALUE */ 0x008D: 1, /* TIMEVALUE */ 0x008E: 3, /* SLN */ 0x008F: 4, /* SYD */ 0x00A2: 1, /* CLEAN */ 0x00A3: 1, /* MDETERM */ 0x00A4: 1, /* MINVERSE */ 0x00A5: 2, /* MMULT */ 0x00AC: 1, /* WHILE */ 0x00AF: 2, /* INITIATE */ 0x00B0: 2, /...
# -*- coding: utf-8 -*- """Provides utility functions, classes, and constants. Useful functions are put here in order to prevent circular importing within the other files. The functions contained within this module ease the use of user-interfaces, selecting options for opening files, and working with Excel. @author:...
<reponame>nicoguillier/gdal<filename>autotest/pyscripts/test_gdal_calc.py #!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### # $Id: test_gdal_calc.py 25549 2013-01-26 11:17:10Z rouault $ # # Project: GDAL/OGR Test Suite # Purpose: gdal_calc.py t...
from visad.python.JPythonMethods import * # A collection of Utilities for Mapes IDV Collection #Author: <NAME>, <EMAIL> ############################TIME UTILS############################################ def getSamplesAtTimes(grid,year=None,season=None,mon=None,day=None,hour=None,min=None,sec=None,ms=None): """ Sample...
nsample_ratios = standardize_sample_ratios( nhf_samples, nsample_ratios) gamma = get_variance_reduction(get_rsquared_mfmc, cov, nsample_ratios) log10_variance = np.log10(gamma)+np.log10(cov[0, 0])-np.log10( nhf_samples) return nhf_samples, np.atleast_1d(nsample_ratios), log10_variance def allocate_samples_mlmc...
''' MIT License Copyright (c) 2016 <NAME> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distri...
xlplatform.get_worksheet_name(self.xl_sheet) @name.setter def name(self, value): xlplatform.set_worksheet_name(self.xl_sheet, value) @property def index(self): """Returns the index of the Sheet.""" return xlplatform.get_worksheet_index(self.xl_sheet) @classmethod def active(cls, wkb=None): """Returns the a...
<filename>proxy.py # Copyright (c) 2016-2019, <NAME> # All rights reserved. # # 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 above copyright notice, this # lis...
<gh_stars>1-10 # -*- coding: utf-8 -*- ########################################################################### ## Python code generated with wxFormBuilder (version Oct 26 2018) ## http://www.wxformbuilder.org/ ## ## PLEASE DO *NOT* EDIT THIS FILE! ###################################################################...
= [state.get(v) for v in self.variables_in_history] # block all ranks until rank 0 has created the folder(s) mpitools.barrier() # let be very cautious assert os.path.isdir(self.output_directory) # Create the history file and save the initial state self.create_history_file(grid, variables) #self.write_history_f...
import requests import json from base64 import b64encode """ Documentation of the API: https://developer.infusionsoft.com/docs/rest/ """ class Client: api_base_url = "https://api.infusionsoft.com/crm/rest/v1/" header = {"Accept": "application/json, */*", "content-type": "application/json"} def __init__(self, cl...
supported (00000000-0000-0000-0000-000000000000). """ parent = _messages.StringField(1, required=True) preview = _messages.MessageField('Preview', 2) requestId = _messages.StringField(3) class DeleteInput(_messages.Message): r"""Input parameters for preview of delete operation. Fields: deployment: Required. ...
# test_patch.py -- tests for patch.py # Copyright (C) 2010 <NAME> <<EMAIL>> # # Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU # General Public License as public by the Free Software Foundation; version 2.0 # or (at your option) any later version. You can redistribute it and/or # modify it u...
# Copyright (c) 2016 Uber Technologies, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publ...
document. :type id: str :param entities: Recognized well-known entities in the document. :type entities: list[~azure.ai.textanalytics.LinkedEntity] :param statistics: If show_stats=true was specified in the request this field will contain information about the document payload. :type statistics: ~azure.ai.texta...
<filename>Launcher.py import sqlite3 import time import hashlib from os import system, name import getpass import re import traceback import random import string connection = None cursor = None LoggedUser = None LoggedUserName = None def randomString(stringLength=10): """Generate a random string of fixed length ""...
from bs4 import BeautifulSoup import requests from datetime import datetime from selenium import webdriver from time import sleep from dateutil.parser import parse __author__ = '<NAME>' class Tracker(object): ''' This class contains the common features of each of the below trackers Each has the following Attribu...
new_dbval) NOT_FOUND = object() for attrs in obj._composite_keys_: for attr in attrs: if attr in avdict: break else: continue vals = [ get_val(a.name, NOT_LOADED) for a in attrs ] currents = tuple(vals) for i, attr in enumerate(attrs): new_dbval = avdict.get(attr, NOT_FOUND) if new_dbval is NOT_FOUND: contin...
<reponame>billbrod/spatial-frequency-model #!/usr/bin/python """2d tuning model """ import pandas as pd import numpy as np import matplotlib.pyplot as plt import torch import warnings import itertools import re from scipy import stats MODEL_ORDER = ['constant_donut_period-iso_amps-iso', 'scaling_donut_period-iso_amps-...
(str | None): Destination file or folder overwrite (bool | None): True: replace existing, False: fail if destination exists, None: no destination check fatal (type | bool | None): True: abort execution on failure, False: don't abort but log, None: don't abort, don't log logger (callable | bool | None): Logger to use...
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from dataclasses import dataclass, field import torch from fairseq import utils from fairseq.dataclass import ChoiceEnum from fairseq.tasks im...
(not IPM regions), by default None remove_ny_z_j : bool, optional If the IPM region NY_Z_J (NYC) should be removed, by default False Returns ------- gpd.GeoDataFrame [description] """ _metro_areas_gdf = metro_areas_gdf.copy() _metro_areas_gdf["geometry"] = _metro_areas_gdf["center"] # metro_ipm_gdf = gpd.sjo...
#!/usr/bin/env python # Density_Sampling/Density_Sampling.py # Author: <NAME> for the GC Yuan Lab # Affiliation: Harvard University # Contact: <EMAIL>, <EMAIL> """For a data-set comprising a mixture of rare and common populations, density sampling gives equal weights to selected representatives of those distinct p...
""" The StochasticNoiseOp class and supporting functionality. """ #*************************************************************************************************** # Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS). # Under the terms of Contract DE-NA0003525 with NTESS, the U.S...
# --- # jupyter: # jupytext: # formats: ipynb,py:percent # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.4.2 # kernelspec: # display_name: bio_time_series # language: python # name: bio_time_series # --- # %% # %load_ext autoreload # %autoreload 2 # %matplo...
<reponame>koson/hal_stm32 #!/usr/bin/python """ SPDX-License-Identifier: Apache-2.0 Copyright (c) 2019 STMicroelectronics. This script define Stm32SerieUpdate class to be used by update_stm32_package.py """ import os import stat import shutil import subprocess import re from pathlib import Path import logging STM32_C...
context ({0},{1}) ' 'versus expected ({2},{3})'.format( egs_left_context, egs_right_context, left_context, right_context)) # the condition on the initial/final context is an equality condition, # not an inequality condition, as there is no mechanism to 'correct' the # context (by subtracting context) while copyi...
import os import sys import json import numpy as np from sklearn import linear_model from sklearn.model_selection import train_test_split from sklearn.preprocessing import MinMaxScaler from sklearn.metrics import mean_squared_error import matplotlib.pyplot as plt from collections import Counter from sklearn.model_selec...
<reponame>ForestFighters/PiWars2020 #!/usr/bin/env python # coding: Latin-1 # Load library functions we want import time import sys import gpiozero import numpy as np import cv2 as cv #import picamera.array from PIL import Image from camera import Camera from robot import Robot from approxeng.input.selectbinder impor...
<filename>bane/ddos.py import requests, cfscrape, socks, os, sys, urllib, socket, random, time, threading, ssl import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) # import the dependencies for each python version if sys.version_info < (3, 0): # Python 2.x import httplib import urllib2...
<filename>nirlin.py #!/usr/bin/env python # 2007 Aug 27 - <NAME> - alpha version # 2007 Aug 28 - AWS - beta version # 2007 Sep 20 - AWS - new coefficients based on spectroscopic flats # 2008 Feb 12 - AWS - handle coadds & nprepared data # 2008 Feb 12 - AWS - default output naming to match Gemini IRAF convention # 2008...
380 ppm fCO2 = 1.0 - 0.387 * np.log(CO2 / 380.0) # leaf level light-saturated gs (m/s) gs = np.minimum(1.6*(1.0 + g1 / np.sqrt(D))*Amax / 380. / rhoa, 0.1) # large values if D -> 0 # canopy conductance Gc = gs * fQ * Rew * fCO2 * fPheno Gc[np.isnan(Gc)] = eps """ --- transpiration rate --- """ Tr = penman_mo...
<reponame>ashutoshsuman99/Web-Blog-D19 # # The Python Imaging Library. # $Id$ # # PIL raster font management # # History: # 1996-08-07 fl created (experimental) # 1997-08-25 fl minor adjustments to handle fonts from pilfont 0.3 # 1999-02-06 fl rewrote most font management stuff in C # 1999-03-17 fl take pth files into ...
<ydk.models.ietf.ietf_event_notifications.DeleteSubscription.Input>` .. attribute:: output **type**\: :py:class:`Output <ydk.models.ietf.ietf_event_notifications.DeleteSubscription.Output>` """ _prefix = 'notif-bis' _revision = '2016-10-27' def __init__(self): super(DeleteSubscription, self).__ini...
present) and subsequently used for tessellation. :type: int """ value = c_int() gl.glGetIntegerv(gl.GL_PATCH_VERTICES, value) return value.value @patch_vertices.setter def patch_vertices(self, value: int): if not isinstance(value, int): raise TypeError("patch_vertices must be an integer") gl.glPatchParamet...
are displayed side-by-side in different viewing panes. surf : str freesurfer surface mesh name (ie 'white', 'inflated', etc.) title : str title for the window cortex : str, tuple, dict, or None Specifies how the cortical surface is rendered. Options: 1. The name of one of the preset cortex styles: ``'classic'...
contains any data and throws exception otherwise. :return: bool :raise ToolError: """ self.retcode = self.process.poll() if self.retcode is not None: if self.retcode != 0: raise ToolError("JMeter exited with non-zero code: %s" % self.retcode, self.get_error_diagnostics()) return True return False def shut...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import ...
" diff. wrt. population B = %s" % diff_wrt_pop thresh = 0.07 if diff_wrt_pop > thresh: print("*** (> %s)" % thresh, colored(text, 'red')) else: print(text) # Check distance of estimate's score and pop. score diff_scores = estimate_score - pop_score text = " diff. wrt. to pop score = %s - pop. score = %s" % ( d...
""" __author__ = <NAME> """ import attr import numpy as np import pandas as pd from attr.validators import instance_of from pysight.nd_hist_generator.movie import Movie, FrameChunk from collections import deque, namedtuple from typing import Tuple, Union from numba import jit, uint8, int64 @attr.s(slots=True) class C...