input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
not have data in it. The error_subtype holds a array of all the missing fields')
errors_mapping[('NOT_FOUND', None)] = NotFound('The node or destination can not be found')
query_data = {
'api': self._api,
'url': '/node/progress/add',
'request_data': request_data,
'errors_mapping': errors_mapping,
'required_sid':... | |
= FAILURE
else:
address4 = TreeNode9(self._input[index4:self._offset], index4, elements2)
self._offset = self._offset
if address4 is not FAILURE:
elements1.append(address4)
remaining0 -= 1
if remaining0 <= 0:
address3 = TreeNode(self._input[index3:self._offset], index3, elements1)
self._offset = self._offset
... | |
_attr_T3, "N", _attr_N,
"device_ordinal", device_ordinal, "combiners", combiners)
_result = _execute.execute(b"EnqueueTPUEmbeddingSparseBatch", 0,
inputs=_inputs_flat, attrs=_attrs, ctx=ctx,
name=name)
_result = None
return _result
def enqueue_tpu_embedding_sparse_tensor_batch(sample_indices, embedding_indices,... | |
Aj,
signed char const [] Ax, npy_int32 [] Bp, npy_int32 [] Bi, signed char [] Bx)
csr_tocsc(npy_int32 const n_row, npy_int32 const n_col, npy_int32 const [] Ap, npy_int32 const [] Aj,
unsigned char const [] Ax, npy_int32 [] Bp, npy_int32 [] Bi, unsigned char [] Bx)
csr_tocsc(npy_int32 const n_row, npy_int32 const... | |
<filename>tinyBT/dht.py
"""
The MIT License
Copyright (c) 2014-2015 <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, cop... | |
<reponame>keithoffer/pylinac
"""The Winston-Lutz module loads and processes EPID images that have acquired Winston-Lutz type images.
Features:
* **Automatic field & BB positioning** - When an image or directory is loaded, the field CAX and the BB
are automatically found, along with the vector and scalar distance bet... | |
import numpy as np
import numpy.typing as npt
from typing import List, Tuple, Optional, Union
from .config.cfg import SweepConfig
from .run import SweepRun, RunState
from .params import HyperParameter, HyperParameterSet
from sklearn import gaussian_process as sklearn_gaussian
from scipy import stats as scipy_stats
f... | |
<reponame>bknueven/proteuslib
###############################################################################
# WaterTAP Copyright (c) 2021, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National
# Laboratory, National Renewable Energy Laboratory, and National E... | |
context.endswith(' operator++') or context.endswith(' operator--'):
return False
# A single unnamed argument for a function tends to look like old style cast.
# If we see those, don't issue warnings for deprecated casts.
remainder = line[match.end(0):]
if Match(r'^\s*(?:;|const\b|throw\b|final\b|override\b|[=>{),... | |
mask with invalid moves as 0 and valid moves as 1.
"""
mask = transition_mask_np(vocab, span_type, s_idx, e_idx, pad_idx).T
inv_mask = (mask == 0).astype(np.float32)
return mask, inv_mask
def tie_weight(weight, tie_shape):
"""Higher order function to share weights between two layers.
Tensorflow will take a cus... | |
= os.path.join(constants.seeds_dir, 'repos', 'WasAPlayer')
# multicall.multicall_directories(path_name, fuzzer='quickfuzz', validator=validate)
# def test_repos_WeApp_Workflow():
# path_name = os.path.join(constants.seeds_dir, 'repos', 'WeApp-Workflow')
# multicall.multicall_directories(path_name, fuzzer='quickfuzz',... | |
import math
import datetime
__all__ = [
"JulianDate",
"GregorianDate",
"julian_day_to_julian",
"julian_day_to_gregorian",
"datetime_to_gregorian",
"datetime_to_julian",
"datetime_to_julian_day",
"datetime_to_mayadate",
]
class JulianDate:
"""Basic class to handle (proleptic) Julian calendar dates and conver... | |
26, "show": true, "order": "raise",
"label": {"offset": [0, 1], "name_type": "abbreviated_with_passage_type", "size": 32}}
],
"? INFORMATION": "======================================================================",
"CDC_vaccines_information": [
{"N": "antigens", "select": {"vaccine": {"type": "current", "passa... | |
"""
This is a wrapper around sys._debugmallocstats which writes to C stderr.
We capture this and can diff two calls to sys._debugmallocatats.
sys._debugmallocatats Implementation (Python 3.9)
=================================================
``sys__debugmallocstats_impl(PyObject *module)``
Calls:
``_PyObject_DebugM... | |
<reponame>nilsbore/rbpf_mtt
import numpy as np
import math
import copy
from cartesian import cartesian_inds
def gauss_pdf(y, m, P):
d = y - m
#print y
dim = len(y)
det = np.linalg.det(P)
if det < 0.0000001:
return 0.
denom = math.sqrt((2.*math.pi)**dim*np.linalg.det(P))
if denom < 0.00001:
print "DENOM TOO SM... | |
<gh_stars>0
# Copyright (c) 2019 Agenium Scale
#
# 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, pu... | |
def makeAdditionalElements(self, panel=None):
if panel is None:
panel = self.getLayH().getPanel()
flags = wx.ALIGN_CENTER | wx.ALL # | wx.EXPAND
buttons = []
buttons.append({"element": wx.Button(panel, size=(self.getLayH().butt_w,-1), label="Expand"),
"function": self.view.OnExpandSimp})
buttons[-1]["element"].... | |
artérias cerebrais'),
('I63.6', 'Infarto cerebral devido a trombose venosa cerebral não-piogênica'),
('I63.8', 'Outros infartos cerebrais'),
('I63.9', 'Infarto cerebral não especificado'),
('I64', ' Acidente vascular cerebral, não especificado como hemorrágico ou isquêmico'),
('I65.0', 'Oclusão e estenose da artér... | |
"""
network_hotspot
~~~~~~~~~~~~~~~
Implements, to a good approximation, the "network prospective hotspot"
algorithm as described in:
- Rosser et al. "Predictive Crime Mapping: Arbitrary Grids or Street Networks?"
Journal of Quantitative Criminology 33 (2017) 569--594,
DOI: 10.1007/s10940-016-9321-x
By setting the... | |
shift
:return: WireVector of same length as bits_to_shift
This function returns a new WireVector of length equal to the length
of the input `bits_to_shift` but where the bits have been shifted
to the right. An arithemetic shift is one that treats the value as
as signed number, meaning the sign bit (the most signi... | |
server will use the default value of "GAST"
selection (str): [optional]
area (str): [optional] if omitted the server will use the default value of "free"
pagelength (str): [optional] if omitted the server will use the default value of "100"
language (str): [optional] if omitted the server will use the default value... | |
from .dialogUtils import DialogStatus, Action, DialogGoal
import random
import numpy as np
import copy
from .. import UMSimulator
from .. import UserModel
from utils import DiaAct, ContextLogger
logger = ContextLogger.getLogger('')
class SGDUserSimulator(UMSimulator.UMSimulator):
def __init__(self, dstring, change_... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
""" This modules handles the CCD based images """
"""
// Full usage of ccd functionalities requires: shapely, astrobject, pynverse (all pipable) //
// ccd-x axis is refered to as 'i', y as "j".
show: plot the ccd as imshow.
show_traceindex: plot the ccd using `show()... | |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.protocols.tls}.
"""
try:
from twisted.protocols.tls import TLSMemoryBIOProtocol, TLSMemoryBIOFactory
except ImportError:
# Skip the whole test module if it can't be imported.
skip = "pyOpenSSL 0.10 or newer required for... | |
# Enable view memorization for testing by default
if opts.actorType == 'demo_sidekick': # Not enabling demo_sidekick training for AgentSupervised (that's not needed, doesn't make sense)
_, rec_errs, _, _, _, _, visited_idxes, decoded_all, _ = agent.gather_trajectory(state, eval_opts={'greedy': opts.greedy, 'memorize_... | |
u('\u798f\u5efa\u7701\u5b81\u5fb7\u5e02')},
'861815017':{'en': '<NAME>', 'zh': u('\u798f\u5efa\u7701\u53a6\u95e8\u5e02')},
'861815016':{'en': '<NAME>', 'zh': u('\u798f\u5efa\u7701\u53a6\u95e8\u5e02')},
'861815015':{'en': '<NAME>', 'zh': u('\u798f\u5efa\u7701\u53a6\u95e8\u5e02')},
'861815014':{'en': '<NAME>', 'zh': ... | |
1)
self.RegProcessPathLineEdit = QtWidgets.QLineEdit(self.doRegistrationGroupBox)
self.RegProcessPathLineEdit.setEnabled(True)
self.RegProcessPathLineEdit.setReadOnly(True)
self.RegProcessPathLineEdit.setObjectName("RegProcessPathLineEdit")
self.gridLayout.addWidget(self.RegProcessPathLineEdit, 1, 1, 1, 4)
self.R... | |
not np.nan \
else r.monotonities
convexities = [r.engine_convexity] * (len(Inds)-1) if r.engine_convexity is not np.nan else r.convexities
m = PythonSum(ind_.size for ind_ in Inds)
inds, rr = [], []
from Interval import defaultIntervalEngine
for j, ind in enumerate(Inds[:-1]):
if ind.size != 0:
tmp = de... | |
from ncclient import manager
from socket import gaierror
import collections
import datetime
import xmltodict
import time
class Netconf:
"""A collection of methods that allows a Network Engineer to collect interface data"""
def __init__(self):
self.session = None
self.interfaces = {}
self.int... | |
IsPinvokeImpl = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsPinvokeImpl(self: FieldInfo) -> bool
"""
IsPrivate = property(lambda self: object(), lambda self, v: None, lambda self: None) # default
"""Get: IsPrivate(self: FieldInfo) -> bool
"""
IsPubl... | |
<reponame>dyvantage/pkt<gh_stars>0
import os
import sys
import requests
import json
import globals
import reports
import time
import ssh_utils
from encrypt import Encryption
class PacketCloud:
"""Interact with Packet Cloud"""
def __init__(self, token, project_id):
self.token = token
self.project_id = project_id
... | |
data = {'content': message,
'username': str(name),
'avatar_url': str(avatar_url)}
requests.post(new_hook.url, data=data)
return
for hook in hooks:
if hook.name == 'temptress':
data = {'content': message,
'username': str(name),
'avatar_url': str(avatar_url)}
requests.post(hook.url, data=data)
return
async d... | |
",text_color = color2,text_x = 130, text_y = 3)
text = ""
project_name_disp.rect.x = 280
project_name_disp.rect.y = b1
button_list.add(project_name_disp)
run_label = Block([230,230,230],425,25, text = "RUN SPECIFICATIONS",text_color = color2,text_x = 130, text_y = 3)
label_font = 18
run_label1_text = "COLS:"+str(grid_c... | |
<filename>Project Codebase/main.py
#===============================================================================
# Developer: <NAME>
# Email: <EMAIL>
#===============================================================================
# File Description: Main Executable
#=================================================... | |
from django.shortcuts import render
from django.utils.crypto import get_random_string
from django.conf import settings
from shapely.wkt import loads as wkt_loads
from shapely.geometry import mapping
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
import json
import r... | |
assert "sessionId=test" in body
body = server.calls[1].request.body.split("&")
assert "CommandType=1" in body
assert "ElementsClass=9" in body
assert "ElementsIndexes=4" in body
assert "sessionId=test" in body
def test_client_arm_fails_missing_lock(server, client):
"""arm() should fail without calling the endpo... | |
<reponame>eribean/girth
import unittest # pylint: disable=cyclic-import
import numpy as np
from scipy.special import roots_legendre
from scipy import integrate, stats
from girth import (create_synthetic_irt_dichotomous,
irt_evaluation, trim_response_set_and_counts,
convert_responses_to_kernel_sign,
validate_estim... | |
= cur
i = i + 1
return result
def firstMissingPositive(self, nums):
l = len(nums)
vector = [0] * l
for i in nums:
if i <= l and i >= 1:
vector[i - 1] = 1
j = 0
while j < l:
if vector[j] == 0:
return j + 1;
j = j + 1
return l + 1
def myPow(self, x, n):
if n == 1:
return x
if n == 0:
return 1
if n ... | |
# for making it an executable
import sys
import platform
from os import path
# tkinter
import tkinter as tk
from tkinter import ttk
# import tkinter.font as font
# pynput
from pynput.keyboard import Listener as KeyboardListener
from pynput.mouse import Listener as MouseListener
# for windows
import ctypes
# because... | |
#!/usr/bin/python -u
#
# create STAR files for "production" validator
#
#
#
from __future__ import absolute_import
import sys
import os
import sqlite3
import ConfigParser
import re
import pprint
if __package__ is None :
__package__ = "nmr-star-dictionary-scripts"
sys.path.append( os.path.abspath( os.path.join( os.p... | |
# Automatically aligns/registers one model/dense point cloud to another one.
#
# This is useful for alignment of two independently photogrammetry-reconstructed models/dense point clouds, or two LIDAR clouds with good overlap.
#
# Also this should work in case of registration between LIDAR points clouds and photogrammet... | |
import operator
import socket
from json import dumps
from kubernetes import client, config
import os, sys, configparser
from sys import exit
import logging
import logging.handlers
from kubernetes.client import V1DeleteOptions
from kubernetes.client.rest import ApiException
from utils.exception import ExecuteExcept... | |
<filename>CCDiag_uds_isotp_zlg.py
# -*- coding:utf-8 -*-
# zlgcan_CCDiag.py
#
# ~~~~~~~~~~~~
#
# Leapmotor development based on ZLGCAN USBCANFD Demo
#
# ~~~~~~~~~~~~
#
# ------------------------------------------------------------------
# Author : <NAME>
# Last change: 22.10.2020
#
# Language: Python 3.6
# -----------... | |
for record
integrity for next parameter change (after CCS),
gets current state
"""
return self._writeState.encryptThenMAC
@encryptThenMAC.setter
def encryptThenMAC(self, value):
self._pendingWriteState.encryptThenMAC = value
self._pendingReadState.encryptThenMAC = value
@property
def blockSize(self):
"""Re... | |
while lower <= upper:
middle=(lower+upper)//2
if x > L[middle]:
lower=middle+1
elif x < L[middle]:
upper=middle-1
elif x == L[middle]:
indx = middle
return indx
tmp = L[lower:upper+1] # 뭔가 이 과정에서 시간을 많이 잡아 먹는 다는 생각이 들었고, 최종 lower와 upper 만을 사용하여 , tmp 리스트를 구하면 될것같았다.
if x not in tmp:
return indx
#L=L[l... | |
in self.args)
def as_relational(self, symbol):
"""Rewrite a Union in terms of equalities and logic operators. """
if all(isinstance(i, (FiniteSet, Interval)) for i in self.args):
if len(self.args) == 2:
a, b = self.args
if (a.sup == b.inf and a.inf is S.NegativeInfinity
and b.sup is S.Infinity):
return And(Ne(... | |
large enough will cause the value of
# that channel to *not* be the central value, and it will have d_sq > 0.
# Factor of .456 is to put mod-z scores on same scale as standard deviation.
sig = np.sqrt(flagged_filter(d_sq, size=size, kind="median", flags=flags) / 0.456)
# don't divide by zero, instead turn those e... | |
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
import numpy as np
from sklearn.utils import shuffle
import input_data
random_numer = 42
np.random.seed(random_numer)
def ReLu(x):
mask = (x > 0) * 1.0
return mask * x
def d_ReLu(x):
mask = (x > 0) * 1.0
return mask
def arctan(x):
retur... | |
<gh_stars>1-10
from typing import List, Dict
from collections import defaultdict
from heapq import heappush, heappop
def canJump(nums: List[int]) -> bool:
# the intuition is to use 2 pointers
j = 0
t = len(nums) - 1
for i in range(t + 1):
j = max(nums[i], j)
if nums[i] == 0 and j == 0:
return False
if j >= t -... | |
<filename>scripts/arl15del2_b6ntac_exp_0002_paper_figures.py
"""
This file is part of Cytometer
Copyright 2021 Medical Research Council
SPDX-License-Identifier: Apache-2.0
Author: <NAME> <<EMAIL>>
"""
# script name to identify this experiment
experiment_id = 'klf14_b6ntac_exp_0002_paper_figures'
# cross-platform home... | |
.. note::
To revert changes, only set to ``(0, 0)``.
.. note::
This is applied only to the base Menu (not the currently displayed,
stored in ``_current`` pointer); for such behaviour apply to
:py:meth:`pygame_menu.menu.Menu.get_current` object.
:param x: +X in px
:param y: +Y in px
:return: None
"""
asser... | |
<filename>lime/tests/test_lime_tabular.py
import collections
import unittest
import numpy as np
import sklearn # noqa
import sklearn.linear_model # noqa
from lime.discretize import QuartileDiscretizer, DecileDiscretizer, EntropyDiscretizer
from numpy.testing import assert_array_equal
from sklearn.datasets import load_... | |
branch_name)
print("Deploying ", branch_name)
await self.run_subprocess(
["./"+DEPLOYMENTS_CMD, "deployregions", branch_name],
logfile_name="deploy-server",
error_mesg="Deployment error!",
success_mesg=("Deployed release %s" % branch_name))
# check on the deployment every 5 minutes
while not await self.check_d... | |
"""
sphinx.domains.python
~~~~~~~~~~~~~~~~~~~~~
The Python domain.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import builtins
import inspect
import re
import typing
import warnings
from inspect import Parameter
from typing import Any, Dict, Itera... | |
<filename>tsupy/go.py<gh_stars>1-10
# python wrapper for package go within overall package tsubasa
# This is what you import to use the package.
# File is generated by gopy. Do not edit.
# gopy gen -output=tsupy -vm=python3 github.com/js061/tsubasa
#
# the following is required to enable dlopen to open the _go.so file... | |
that is going to represent the data
# to be sent, this tuple should contain the data itself
# the target address (for datagram) and the callback
data = (data, address, callback)
# retrieves the identifier of the current thread and then
# verifies if it's the same as thread where the event loop
# is being ... | |
<reponame>markusrobertjonsson/learning_simulator
import LsUtil
import LsWorld
import LsMechanism
from LsOutput import ScriptOutput
from LsSimulation import ScriptRun
from LsExceptions import LsParseException
from LsConstants import *
import copy
import ast
import csv
import matplotlib.pyplot as plt
PLOT_PROPS = {'run... | |
Sediment concentration
Returns
---------
e_w : ndarray
Entrainment coefficient of ambient water
"""
Ri = np.zeros(U.shape[1])
e_w = np.zeros(U.shape[1])
U_abs = np.abs(U[0, :] - U[1, :])
flow_exist = np.where((h[1, :] > self.h_init * 10) & (U_abs > 0))
Ri[flow_exist] = (
self.R
* self.g
* C[1, flow_exi... | |
<filename>python/neural_nets/feedforward/pmnn/PMNN.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""Created on Wed Apr 10 15:00:00 2017
@author: gsutanto
"""
import scipy.io as sio
import numpy as np
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
sys.path.append(os.path.join(... | |
dZ_e, Rxc, Rxs, Ryc, Rys, Rzc, Rzs)) /(2*epsilon)
dRx_Sd = (Sd_6Dof(dX, dY, dZ, Rxce, Rxse, Ryc, Rys, Rzc, Rzs) -
Sd_6Dof(dX, dY, dZ, Rxc_e, Rxs_e, Ryc, Rys, Rzc, Rzs)) /(2*epsilon)
dRy_Sd = (Sd_6Dof(dX, dY, dZ, Rxc, Rxs, Ryce, Ryse, Rzc, Rzs) -
Sd_6Dof(dX, dY, dZ, Rxc, Rxs, Ryc_e, Rys_e, Rzc, Rzs)) /(2*epsilon... | |
telebot.apihelper.ApiException:
print('cant send message to ' + get_id(message.chat.id))
logging.error('cant send message to ' + get_id(message.chat.id))
elif message.text.lower() == 'вкл. все уведомления':
ind = get_id(message.chat.id)
ids[ind].notify_game = 1
ids[ind].notify_admin = 1
upd_b()
try:
bot.send_m... | |
<reponame>vsajip/pagesign
# -*- coding: utf-8 -*-
#
# Copyright (C) 2021-2022 Red Dove Consultants Limited
#
import base64
import functools
import hashlib
import json
import logging
import os
import re
import shutil
# import stat
import subprocess
import sys
import tempfile
import threading
__version__ = '0.1.1.dev0'
... | |
except:
print("ERROR: can not convert covModel2D from python to C ('alpha' not compatible with simulation grid)")
return covModel_c, False
im = Img(nx=nx, ny=ny, nz=nz,
sx=sx, sy=sy, sz=sz,
ox=ox, oy=oy, oz=oz,
nv=1, val=param)
covModel_c.angle1Image = img_py2C(im)
# angle2
covModel_c.angle2 = 0.0
# angle3
c... | |
<filename>src/load_so_data.py
#!/usr/bin/env python
import os
from collections import namedtuple
from urllib.request import urlopen
import pickle
import torch
import numpy as np
import json
from tqdm import tqdm
from sklearn.preprocessing import MinMaxScaler
ACTIONS = ['Answers', 'Questions', 'Comments', 'Edits', ... | |
<gh_stars>1-10
import re
import os
import json
import hashlib
import jsonlines
import numpy as np
import pandas as pd
from tqdm import tqdm
from typing import List, Dict, Tuple, Union, Optional, Set
from joblib import Parallel, delayed
from collections import Counter
from ..base_utils import BaseProcessor
class Outli... | |
<reponame>vnep-approx/vnep-approx
import pytest
from alib import datamodel
from vnep_approx.extendedcactusgraph import ExtendedCactusGraph, ExtendedCactusGraphError
class TestExtendedCactusGraph:
def setup(self):
self.substrate = datamodel.Substrate("paper_example_substrate")
self.substrate.add_node("u", ["univer... | |
#!/usr/bin/env python
"""
module for performing simple extract-load operations from mssql to redshift
"""
import csv
import os
import gzip as gz
import json
import argparse
import time
from time import sleep
from datetime import datetime
from dateutil import parser
from cocore.config import Config
from cocore.Logger i... | |
# -*- coding: utf-8 -*-
from django.template import RequestContext,Context
from django.shortcuts import render, redirect, get_object_or_404,render_to_response,HttpResponseRedirect,HttpResponse
from django.template.loader import render_to_string,get_template
from django.views.generic import TemplateView,ListView,CreateV... | |
import translate
model_guess = dashboard['model_guess'] # guess surely exists
ntot = sum([len(model_guess[k]['pardicts']) for k in range(len(model_guess))])-1 # minus alpha
lmin = [] # initialize the minuit parameter index of dashboard function indices
nint = -1 # initialize the number of internal parameters
nm... | |
Available")
flow.prop(edit, "use_auto_keying", text="Enable in New Scenes")
class USERPREF_PT_animation_fcurves(AnimationPanel, CenterAlignMixIn, Panel):
bl_label = "F-Curves"
def draw_centered(self, context, layout):
prefs = context.preferences
edit = prefs.edit
flow = layout.grid_flow(row_major=False, colum... | |
someName, theColor):
"""
Applies a coloring to a single part of some object if it contains multiple parts.
Args:
someName (str): the name of the subpart of the object to be colored.
theColor (tuple): tuple of length 4 which defines the RGBA color.
"""
selectOnly([someName])
C.view_layer.objects.active = D.obje... | |
composition = stellar_evolution.particles[0].get_chemical_abundance_profiles()
outer_radii = stellar_evolution.particles[0].get_radius_profile()
outer_radii.prepend(0.0 | units.m)
midpoints = (outer_radii[:-1] + outer_radii[1:]) / 2
temperature = stellar_evolution.particles[0].get_temperature_profile()
mu = stella... | |
RoleAssignmentFailureTestCase(RoleAssignmentBaseTestCase):
"""Class for testing invalid query params on /v3/role_assignments API.
Querying domain and project, or user and group results in a HTTP 400 Bad
Request, since a role assignment must contain only a single pair of (actor,
target). In addition, since filterin... | |
os.listdir(originalDir)
# Loop over the content of the demo directory
for item in listDir:
if not os.path.isdir(item):
# Not a directory, continue
continue
dirFile = os.listdir(item)
# See if a file called "name" is there
if name in dirFile:
return os.path.join(item, name)
# We must return a string...
retur... | |
if match_space_maker is not None:
assert "batchDir" not in kwargs, "Can't combine batchDir with match_space_maker yet"
model_type = kwargs.get("model_type", "retrospective")
N = Y.shape[0]
fit_units = _get_fit_units(model_type, control_units, treated_units, N)
X_v = X[fit_units, :]
Y_v = Y[fit_units,:]
def _fit_... | |
#!usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import json
import xlwt
sys.path.append('..')
import common.alloc as alloc
import logger
train_json = logger.Logger()
trace_json = logger.Logger()
show_json = logger.Logger()
#from argument.dqnArgs import args
from argument.argManage import args
levin_debug =... | |
<filename>alibi_detect/cd/fet_online.py
from tqdm import tqdm
import numpy as np
from typing import Any, Callable, List, Optional, Union
from alibi_detect.cd.base_online import BaseUniDriftOnline
from alibi_detect.utils.misc import quantile
from scipy.stats import hypergeom
import numba as nb
import warnings
class FE... | |
n_workers = luigi.IntParameter(
description="How many threads to simultaneously run overlap-computation; if --debug-single-thread, uses 1",
default=multiprocessing.cpu_count())
# n_splits = luigi.IntParameter(description=textwrap.dedent("""
# Overlap-computation is parallelized by \"splitting\" into n-splits, and p... | |
#!/usr/bin/env python
__doc__ = """binaryBHexp
========
The binary Black Hole explorer.
Generates visualizations of a precessing binary black hole merger and the
final remnant black hole.
Example usage:
./binaryBHexp --q 2 --chiA 0.2 0.7 -0.1 --chiB 0.2 0.6 0.1
By clicking and dragging on the movie as it plays, you... | |
"""
system.py
Handles the system class for openMM
"""
# Global imports
import openmm
import openmm.app
from simtk import unit
import numpy as np
import pandas
import sklearn.decomposition
import configparser
import prody
import scipy.spatial.distance as sdist
from . import utils
__author__ = '<NAME>'
__version__ = ... | |
"""
Unit tests for decaydata.py functions, classes and methods.
"""
import unittest
import numpy as np
from scipy import sparse
from sympy import Integer, log, Matrix
from sympy.matrices import SparseMatrix
from radioactivedecay import decaydata, icrp107_ame2020_nubase2020
class TestFunctions(unittest.TestCase):
""... | |
<gh_stars>1-10
import unittest
import os
import shutil
import subprocess
import tempfile
import pdb
import pytest
from sys import stdout
import nzpy
class testnzpy(unittest.TestCase):
def setUp(self):
self.setupDb()
self.conn = nzpy.connect(user="admin", password="password",host='localhost', port=54... | |
it will call for
pprint() on each of them, printing them out in detail.
"""
idx = 0
current = self._head
show_details = False
if kwargs:
if 'show_details' in kwargs:
show_details = True if kwargs['show_details'] else False
print('*' * 80)
print('MSCDLL GLOBAL INFORMATION'.center(80), '\n')
print('MSCDLL n... | |
<filename>test/user1_time.py<gh_stars>0
from roundup import date
def import_data_1 (db, user) :
dr = db.daily_record.create \
( user = user
, date = date.Date ('2006-01-23')
)
dr = db.daily_record.create \
( user = user
, date = date.Date ('2006-01-24')
)
dr = db.daily_record.create \
( user = user
, date =... | |
text_units == 'cmu_phonemes' or 'voice_activity':
self.path_to_text = os.path.join(self.data_set_root, 'val/text_cmu_phonemes/')
self.vocabulary_size = 44
if text_units == 'ones':
self.path_to_text = os.path.join(self.data_set_root, 'val/text_cmu_phonemes/')
self.vocabulary_size = 44
self.path_to_audio = os.path... | |
# Copyright 2013 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | |
<filename>clone_scanner.py<gh_stars>0
# -*- coding: utf-8 -*-
#
# Clone Scanner, version 1.3 for WeeChat version 0.3
# Latest development version: https://github.com/FiXato/weechat_scripts
#
# A Clone Scanner that can manually scan channels and
# automatically scans joins for users on the channel
# with multiple nick... | |
<reponame>tchamabe1979/exareme
# -*- coding: utf-8 -*-
# *****************************************************************************
# Copyright (C) 2003-2006 <NAME>.
# Copyright (C) 2006 <NAME>. <<EMAIL>>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as pa... | |
otherwise False
# sets self.blade_flg and returns value
if self.blade_flg is not None:
return self.blade_flg
else:
if self.is_versor():
if self.i_grade is not None:
self.blade_flg = True
else:
self.blade_flage = False
else:
self.blade_flg = False
return self.blade_flg
def is_versor(self): # Test for verso... | |
<reponame>Humbedooh/pypubsub<gh_stars>1-10
#!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under ... | |
in the order to use when saving"""
return [self.input_type,
self.input_object_name,
self.image_name,
self.objects_name, self.object_extension,
self.file_name_method, self.file_image_name,
self.wants_file_name_suffix,
self.file_name_suffix, self.file_format,
self.pathname, self.bit_depth,
self.overwrite, self.w... | |
"""
unidad secuencial de cálculo # S[0:31] OK (USC2)
direccionamiento de memoria
[inherente, inmediato, directo, indexado] # S[31:35] CC
condicionales de ramificación 1
[brc, brv, brn, brz, bnc, bnv, brp, bnz, bri] # S[35:44] OK (LR)
condicionales de ramificación 2
[bma, bmi, bme, bni, bsu, bsi, bin, bii] # S[44:52]... | |
# -*- coding: utf-8 -*-
# coding: utf-8
# -----------------------------------------------------------------------------
# Copyright 2012-2017 <NAME>. 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 obta... | |
= 1 / h
# Least-squares terms
a = delta_0 * inner(u + grad(p), v + grad(q)) * dx
a += delta_1 * div(u) * div(v) * dx
a += delta_2 * inner(curl(u), curl(v)) * dx
# Edge stabilizing terms
# ** Badia-Codina based (better results) **
a += eta_u * avg(delta_3) * (jump(u, n) * jump(v, n)) * dS
a += eta_p * avg(delta... | |
[
'meningism',
'agitated',
'restlessness',
],
'sd_leakage': [
'ascites',
'overload',
'oedema_pulmonary',
'respiratory_distress',
],
'sd_bleeding': [
'bleeding_gi',
'bleeding_urine',
],
'sd_organ_impairment': [
'cns_abnormal',
'liver_abnormal',
'kidney_abnormal'
],
'ventilation': [
'ventilation_type... | |
# Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Internal bot API handlers."""
import base64
import json
import logging
import urlparse
import six
import webob
import webapp2
from google.ap... | |
Kameido Ekimae Store' : '10815',
'H1-119.Enokido Lumber Co., LTD' : '10831',
'H1-12.Ohedo Onsen Monogatari' : '10103',
'H1-120.Toyosu 5 Chome' : '10847',
'H1-121.Minamisuna 5-Chome' : '10848',
'H1-122.Higashisuna Sports Center' : '10859',
'H1-123.Daiwa Roynet Hotel Tokyo-Ariake' : '10860',
'H1-124.Seven-Eleven K... | |
<reponame>TranQuangDuc/SceneMover
import numpy as np
import queue
from math import *
from copy import deepcopy
import time
from queue import PriorityQueue as PQ
import pickle
_x = [-1,1,0,0]
_y = [0,0,-1,1]
class ENV_scene_new_action_pre_state_penalty_conflict_heuristic: # if current state happened before, give a pen... | |
# -*- coding: utf-8 -*-
#@+leo-ver=5-thin
#@+node:ekr.20150323150718.1: * @file leoAtFile.py
#@@first
# Needed because of unicode characters in tests.
"""Classes to read and write @file nodes."""
#@+<< imports >>
#@+node:ekr.20041005105605.2: ** << imports >> (leoAtFile)
import leo.core.leoGlobals as g
import leo.core... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from .base import DataReaderBase
from ..tools import COL, _get_dates, RemoteDataError, to_float
from pandas.util.testing import _network_error_classes
import pandas as pd
from six.moves import cStringIO as StringIO
import logging
import traceback
import datetime
# Items... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.