input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
self.config.version:
warn_msg = (
"Found a different version {other_version} of dataset {name} in "
"cache_dir {cache_dir}. Using currently defined version "
"{cur_version}.".format(
other_version=str(other_version),
name=self.name,
cache_dir=self._cache_dir_root,
cur_version=str(self.config.version),
)
)
lo... | |
update_mutations)
return res['mutate_response'][0]['id']
@utils.enforce_id_param
def delete_playlist(self, playlist_id):
"""Deletes a playlist and returns its id.
:param playlist_id: the id to delete.
"""
# TODO accept multiple?
mutate_call = mobileclient.BatchMutatePlaylists
del_mutations = mutate_call.bu... | |
import pickle
from collections import defaultdict, namedtuple
import numpy as np
import argparse
import os
import model.config as config
import preprocessing.util as util
from termcolor import colored
import tensorflow as tf
class VocabularyCounter(object):
"""counts the frequency of each word and each character in... | |
<filename>bdgraph/graph.py<gh_stars>1-10
#!/usr/bin/python3
''' bdgraph.py
Author:
<NAME>
Description:
Reads an input markup file containing definitions, dependencies, and graph
options, and writes a corresponding output graphviz dot file
Usage:
python3 bdgraph.py input_file [output_file]
'''
import bdgraph
imp... | |
#!/usr/bin/env python
# Copyright 2016 Criteo
#
# 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... | |
<filename>compiler/front_end/symbol_resolver.py<gh_stars>0
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
from torch.distributions import Normal
from .base_network import BaseNetwork
class BaseMDN(BaseNetwork):
r"""Base class for Mixture Density Networks (we use Gaussian mixture).
This class ... | |
#!/usr/bin/python
import pdb_util as util
from copy import deepcopy
import os, itertools
import collections
class simplepdb:
'''
Parses and writes PDB files, and exposes limited functionality for
manipulating their contents with a particular focus on the kinds of
manipulations required for setting up MD simulation... | |
0x18, 0x49, 0x8c,
0x61, 0x82, 0x81, 0x89, 0x22, 0x46, 0x32, 0x18,
0xcb, 0x82, 0x8b, 0x12, 0x2c, 0x22, 0x06, 0x38,
0xc6, 0x82, 0x62, 0x22, 0x32, 0x24, 0x18, 0xa9,
0xa2, 0x12, 0x83, 0x21, 0xf1, 0x32, 0xc8, 0x12,
0x2b, 0x52, 0x18, 0x1a, 0x0c, 0x8c, 0x28, 0xb2,
0xc9, 0xb1, 0x18, 0xb4, 0x82, 0x65, 0x82, 0xa2,
0x83, 0... | |
<gh_stars>0
"""This module implements plugin base."""
import os
import sys
import glob
from collections import namedtuple
import logging
import types
import time
from queue import Empty, Full
from swak.config import get_exe_dir
from swak.exception import UnsupportedPython
from swak.const import PLUGINDIR_PREFIX
from ... | |
= 'gmrerr',
format = 'E',
array = numpy.sqrt(2)*0.1*numpy.ones(100))
clean = pyfits.Column(name = 'Clean', format = 'K', array = numpy.ones(100))
backgr = pyfits.Column(name = 'SEx_BackGr', format = 'E', array = numpy.ones(100))
maxval = pyfits.Column(name = 'SEx_MaxVal', format = 'E', array = numpy.ones(100)... | |
<reponame>nursix/rlpptm
# -*- coding: utf-8 -*-
"""
Infection test result reporting for RLPPTM template
@license: MIT
"""
import base64
import datetime
import hashlib
import json
import requests
import secrets
import sys
import uuid
from gluon import current, Field, IS_EMPTY_OR, IS_IN_SET, SQLFORM, URL, \
BUTTON... | |
+\
method_name_length * 2 + 8 + 8 +\
public_key_algorithm_name_length * 2 + 8 +\
public_key_blob_length * 2]
resultlist.append(("public_key_blob_length",
str(public_key_blob_length)))
resultlist.append(("public_key_blob",
self.get_ascii(\
public_key_blob)))
if boolean != 0:
public_key_to_be_used_for_authentic... | |
per image. You can adjust this
number if expecting more objects. You can use -1 to return all detections.
pos_iou_thresh : float, default is 1.0
IOU threshold for true anchors that match real objects.
'pos_iou_thresh < 1' is not implemented.
ignore_iou_thresh : float
Anchors that has IOU in `range(ignore_iou_thre... | |
<reponame>Regnareb/StreamManager<gh_stars>0
import os
import sys
import copy
import ctypes
import socket
import logging
import threading
import functools
import webbrowser
logger = logging.getLogger(__name__)
import keyboard
from PySide2 import QtCore, QtWidgets, QtGui, QtWebEngineWidgets
# TODO
# Be able to import a ... | |
= vault_id
file_path = None
try:
success, message, file_info = phantom_rules.vault_info(vault_id=vault_id)
if not file_info:
return RetVal3(action_result.set_status(phantom.APP_ERROR, EWSONPREM_ERR_VAULT_INFO), None, None)
file_path = list(file_info)[0].get('path')
except Exception:
return RetVal3(action_resul... | |
position embeddings
self.relative_pos_embeddings = nn.Linear(config.hidden_size, self.num_buckets * self.num_attn_heads)
# for onnx runtime
self.onnx_trace = False
def _reshape(self, tensor, first_dim, batch_size):
return tensor.reshape(first_dim, batch_size * self.num_attn_heads, self.head_dim).transpose(0, 1)
... | |
If needed, please reach out to tool support at: <EMAIL>, with your report and log file. \033[0;0m'.format(log_file_path))
log_file_logger.exception('{}\n'.format(e))
#07:Check:vManage:Validate all services are up
print(' #07:Checking:vManage:Validate all services are up')
log_file_logger.info('#07:Check:... | |
<filename>jamdict/kanjidic2.py
# -*- coding: utf-8 -*-
'''
Python library for manipulating <NAME>'s KanjiDic2
Latest version can be found at https://github.com/neocl/jamdict
This package uses the [EDICT][1] and [KANJIDIC][2] dictionary files.
These files are the property of the [Electronic Dictionary Research ... | |
'connectivity_func1':
g = geosclassic.MPDSOMPImageConnectivityFunction1
elif stat_type == 'connectivity_func2':
g = geosclassic.MPDSOMPImageConnectivityFunction2
elif stat_type == 'covariance_not_centered':
g = geosclassic.MPDSOMPImageCovarianceNotCentred
elif stat_type == 'transiogram':
g = geosclassic.MPDSOMPI... | |
self.kidsWithPerson(a)
if a.house.town == b.house.town:
peopleToMove = [b]
peopleToMove += [x for x in b.children if x.dead == False and x.house == b.house and
x.justMarried == None and x.independentStatus == False]
newOcc = len(peopleToMove)
oldOcc = len(a.house.occupants)
pReloc = self.relocationProb... | |
import math
import torch.nn as nn
import torch.nn.functional as F
from collections import OrderedDict
from collections.abc import Iterable
from ..initializer import initialize_from_cfg
from ...extensions import DeformableConvInOne
from ..normalize import build_norm_layer, parse_deprecated_bn_style
from ...utils.check... | |
<reponame>cmadjar/datalad-crawler
# emacs: -*- mode: python; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright an... | |
<reponame>pulumi/pulumi-alicloud<filename>sdk/python/pulumi_alicloud/config/outputs.py
# 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.runt... | |
import sys
import os
import os.path as osp
import time
import shutil
import pandas as pd
from collections import deque
import torch
import codecs
import imgviz
import argparse
from pathlib import Path
import functools
from qtpy import QtCore
from qtpy.QtCore import Qt
from qtpy import QtWidgets
from qtpy import QtGui
f... | |
# import ptvsd
# ptvsd.enable_attach(address = ('172.16.71.13', 3000))
# ptvsd.wait_for_attach()
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
import torch.nn.functional as F
import torch.optim as opt
import collections
import logging
import argparse
from modules import *
im... | |
<filename>pognlp/vader_lexicon.py
"""The VADER default lexicon as a string
VADER doesn't seem to import its default lexicon in a way that PyInstaller
# can package. This is a cheap hack so we can pass it to our custom lexicon
# loader.
"""
VADER_LEXICON = """$: -1.5 0.80623 [-1, -1, -1, -1, -3, -1, -3, -1, -2, -1]
%)... | |
import codecs
import tempfile
from django.test import SimpleTestCase
from StringIO import StringIO
from corehq.util.spreadsheets.excel import WorkbookJSONReader
from couchexport.export import export_raw
from couchexport.models import Format
from corehq.apps.app_manager.const import APP_V2
from corehq.apps.app_manager... | |
at normal incidence averaged over the visible spectrum range
| of solar radiation.
| Units: dimensionless
| value < 1.0
Args:
value (float): value for IDD Field `Front Side Slat Beam-Diffuse Visible Transmittance`
Raises:
ValueError: if `value` is not a valid value
Returns:
float: the value of `front_side_s... | |
import numpy as np
import copy
import warnings
from bnpy.util.StateSeqUtil import calcContigBlocksFromZ
from bnpy.data.XData import XData
def proposeNewResp_randBlocks(Z_n, propResp,
origK=0,
PRNG=np.random.RandomState,
Kfresh=3,
minBlockSize=1,
maxBlockSize=10,
**kwargs):
''' Create new value of resp matrix ... | |
<reponame>marcdemers/py_vollib_vectorized<filename>py_vollib_vectorized/greeks.py
import numpy as np
import pandas as pd
from ._numerical_greeks import numerical_delta_black, numerical_theta_black, \
numerical_vega_black, numerical_rho_black, numerical_gamma_black
from ._numerical_greeks import numerical_delta_black_... | |
import tkinter as tk
from p_types import PokemonType
from moves import Move
from pokemon import Pokemon
from battle import Battle
class Game:
def __init__(self):
self.battle_num = 0
self.max_battles = 3
self.current_battle = None
def startBattle(self):
self.battle_num += 1
self.current_battle = B... | |
0)
if self.useProgrammerScale:
self.loadScaleOld()
else:
self.loadScaleNew()
def __debugScale(self):
prosecutionPanPos = self.prosecutionPanNodePath.getPos()
origin = Point3(0, 0, 0)
prosecutionPanRelPos = self.scaleNodePath.getRelativePoint(self.prosecutionPanNodePath, origin)
panRenderPos = render.getRelati... | |
from input channels to output chanels.
bias: Boolean, whether the layer uses a bias vector.
Input shape:
3D tensor with shape: `(batch_size, steps, input_dim)`
Output shape:
3D tensor with shape: `(batch_size, new_steps, filters)`
`steps` value might have changed due to padding or strides.
"""
self.in_channels ... | |
# coding: utf-8
"""
DocumentStateApi.py
Copyright 2016 SmartBear Software
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 applic... | |
0:
if self.hdr.rhr_xcsi >= 0:
ndims += 1
if self.hdr.rhr_ycsi >= 0:
ndims += 1
if self.hdr.rhr_zcsi >= 0:
ndims += 1
if ndims == 2:
is2D = True
return is2D
@property
def is_chop_on(self):
""" Is data chopped? """
chop = False
nex = self.hdr.rhi_nex
necho = self.hdr.rhi_numecho
if ( math.ceil(nex... | |
the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.recoveryservicessiterecovery.models.ReplicationProtectedItem]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_... | |
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
import json
import random
import argparse
# our
import copy
import gc
from src.slurm import init_signal_handler, init_distri... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
{\n'
' nextToken\n'
' }\n'
' }\n'
' }\n',
'getconnectors': '\n'
' query GetConnectors($id: ID!) {\n'
' getConnectors(id: $id) {\n'
' id\n'
' createdAt\n'
' updatedAt\n'
' category\n'
' name\n'
' owner\n'
' description\n'
' detaileddescription\n'
' iconPath\n'
' version\n'
' md5\n'
' source\n'
' conf... | |
= dr
, start = '16:00'
, end = '18:30'
, work_location = '1'
, wp = '8'
)
dr = db.daily_record.create \
( user = user
, date = date.Date ('2010-01-27')
)
db.time_record.create \
( daily_record = dr
, start = '13:30'
, end = '14:00'
, work_location = '1'
, wp = '10'
)
db.time_record.create \
( daily_re... | |
<reponame>d-amien-b/simple-getwordpress<filename>Collections-a-installer/community-general-2.4.0/plugins/modules/gitlab_user.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, <NAME> (<EMAIL>)
# Copyright: (c) 2015, <NAME> (<EMAIL>)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.or... | |
x_ac.shape[1]
x_af = torch.zeros(B*N_a, dim).cuda()
idx_a = idx_a.reshape(-1,1).repeat(1,dim)
x_af.scatter_(dim=0, index=idx_a, src=self.linear_a(x_a.F))
x_af = x_af.reshape([B, N_a, dim])
x_bc, mask_b, idx_b = separate_batch(x_b.C)
B = x_bc.shape[0]
N_b = x_bc.shape[1]
x_bf = torch.zeros(B*N_b, dim).cuda()
i... | |
# Databricks notebook source
# MAGIC %md
# MAGIC # Putting it all together: Managing the Machine Learning Lifecycle
# MAGIC
# MAGIC Create a workflow that includes pre-processing logic, the optimal ML algorithm and hyperparameters, and post-processing logic.
# MAGIC
# MAGIC ## Instructions
# MAGIC
# MAGIC In this co... | |
(i.e. RichIPythonWidget +
our additions = SMIPythonWidget), which becomes the ipywidget attribute
of this class. We are doing this for several reasons:
1. To add more variables and methods needed to connect the widget to other
Spyder plugins and also increase its funcionality.
2. To make it clear what has b... | |
engineer=6)),
("cm_buy_nephrite_earrings",spr_buy_item_flags(17),"nephrite_earrings","bo_pw_weapon_small", spr_buy_item_triggers("itm_nephrite_earrings", resources=["itm_gold_nugget"], engineer=6)),
("cm_buy_black_pearl_earrings",spr_buy_item_flags(18),"black_pearl_earrings","bo_pw_weapon_small", spr_buy_item_trigg... | |
<gh_stars>0
#!/usr/bin/env python
"""
LPU output visualization.
"""
import collections
from collections import OrderedDict
import itertools
import os
import h5py
from future.utils import itervalues, iteritems
import matplotlib
from matplotlib import cm
from matplotlib.colors import Normalize
import matplotlib.pyplot... | |
""" @package forcebalance.parser Input file parser for ForceBalance jobs. Additionally, the location for all default options.
Although I will do my best to write good documentation,
for many programs the input parser becomes the most up-to-date
source for documentation. So this is a great place to write
lots of commen... | |
1
if counter > 10:
raise Exception('Not all velocity vectors are able to be fixed to origin. Are the all joints linked?')
def fix_acceleration(self):
"""
Fixes the accelerations of all the joints assuming that all vectors are defined locally, meaning that the
vector's length, angle, r_dot, omega, r_ddot, and alp... | |
= Var(within=Binary,bounds=(0,1),initialize=0)
m.b598 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b599 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b600 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b601 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b602 = Var(within=Binary,bounds=(0,1),initialize=0)
m.b... | |
<gh_stars>1-10
import numpy as np
import os, sys
import copy
#from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
#import palettable as pal
from matplotlib import cm
from astroML.plotting import hist
from scipy import stats, special
#from visualize import *
import mcmc
#set seed so we get predicta... | |
import numpy as np
import ast
import eccpy.tools as tools
def judge_fit(dfe, sLet, settings):
''' Analyses the fit of the experimental data to a sigmoidal curve.
Parameters
----------
dfe : pandas dataframe
Dataframe for evaluation of a single curve.
The index is a long list of parameter names, e.g. EC50, hill_... | |
<reponame>columbia-robovision/dsr
import os.path as osp
import collections
import math
import os
import shutil
import cv2
import imageio
import numpy as np
import dominate
from dominate.tags import *
import queue
import threading
# Get rotation matrix from euler angles
def euler2rotm(theta):
R_x = np.array([[1, 0, ... | |
flag):
cnt += 1
flag, scattered_o, scattered_d, scattered_tm = scatter(m, ray(scattered_o, scattered_d, scattered_tm), p, normal, front_face, u, v)
res *= get_albedo(material_kind[m], material_extra[m], material_albedo[m], u, v, p)
t, p, front_face, normal, u, v, m = bvh_hit(ray(scattered_o, scattered_d), 0.001, fl... | |
data = ReturnData(a_return)
return data.species
return None
class ReturnFactory(object):
'''
An Abstract Factory interface that declares a method to create a Return.
'''
__metaclass__ = abc.ABCMeta
@abc.abstractmethod
def create_return(self, request, licence, selected_activity) -> Return:
'''
Method to c... | |
here are the same
as those passed to "__prepare__").
This class object is the one that will be referenced by the zero-
argument form of "super()". "__class__" is an implicit closure
reference created by the compiler if any methods in a class body refer
to either "__class__" or "super". This allows the zero argument fo... | |
<gh_stars>10-100
#__docformat__ = "restructuredtext en"
# ******NOTICE***************
# from optimize.py module by <NAME>
#
# You may copy and use this module as you see fit with no
# guarantee implied provided you keep this notice in all copies.
# *****END NOTICE************
#
# Modified by <NAME> to support bounded m... | |
<filename>pax/plugins/io/WaveformSimulator.py
"""
Plugins to interface with the integrated waveform simulator (FaX)
This is I/O stuff only: truth file writing, instruction reading, etc.
There is no physics here, all that is in pax.simulation.
Added by Qing: Sorry there's a little physics (S2 after pulses)
is implemente... | |
0.06
3 1.47e+06 255.28 | 247.30 0.0 1000 0 | 0.10 0.15 131.86 0.07
3 1.49e+06 255.28 | 246.46 0.0 1000 0 | 0.10 0.13 132.77 0.06
3 1.50e+06 255.28 | 235.29 0.0 1000 0 | 0.10 0.13 133.17 0.08
3 1.52e+06 255.28 | 92.90 0.0 1000 0 | 0.08 0.15 140.81 0.08
3 1.54e+06 255.28 | -8.49 0.0 1000 0 | 0.02 0.17 144.82 0.10
3 1.56e... | |
if not hel_config is None:
raise CurrentImplementationError(
self.name() + " does not support helicity assignment." )
if Q is None:
raise CurrentImplementationError(
self.name() + " requires the total mapping momentum Q." )
# Retrieve alpha_s and mu_r
model_param_dict = self.model.get('parameter_dict')
alpha_s... | |
(M[0x1BBC] == 0x0B) ], "LD (IY+0CH),L"],
[ [ A(0x0B), IY(0x1BB0) ], [ 0xFD, 0x77, 0x0C ], 19, [ (PC == 0x3), (M[0x1BBC] == 0x0B) ], "LD (IY+0CH),A"],
[ [ BC(0xCAFE) ], [ 0xED, 0x43, 0xBC, 0x1B ], 22, [ (PC == 0x4), (M[0x1BBC] == 0xFE), (M[0x1BBD] == 0xCA) ], "LD (1BBCH),BC" ],
[ [ DE(0xCAFE) ], [ 0xED, 0x53, 0xBC, ... | |
"bris",
"koto",
"ursa",
"plop",
"defi",
"tans",
"seis",
"grog",
"mell",
"runt",
"cede",
"teem",
"bonk",
"duos",
"suet",
"lich",
"inky",
"hewn",
"alga",
"vole",
"ands",
"syne",
"puna",
"flan",
"axed",
"jags",
"mumm",
"quip",
"shod",
"dels",
"iffy",
"kiva",
"saki",
"wove",
"bide",
"bevy... | |
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QPixmap, QImage, QPainter, QColor, QPen, QPalette, QFont
from PyQt5.QtWidgets import QLabel, QWidget, QApplication
from ..infer.inference_wrapper_single_line import InferenceWrapper... | |
<reponame>benkiel/batchRoboFontExtension
import os
import tempfile
import shutil
from AppKit import *
import string
import re
import time
from vanilla import *
from defconAppKit.windows.baseWindow import BaseWindowController
from fontTools.ttLib import TTFont
from fontTools.pens.boundsPen import BoundsPen
from com... | |
info was a hack anyway :-(
args = 0
for arg in arguments:
params.append(
code.Parameter(
"arg_"+str(args),
code.ObjectType(arg.info.name)
)
)
args += 1
# turn matchers into list of conditions
[condition, suffix] = self.transform_matchers_into_condition(matchers, arguments)
name += suffix
# construct body... | |
# coding: utf8
import abc
from os import path
import numpy as np
import pandas as pd
import torch
import torchvision.transforms as transforms
from torch.utils.data import Dataset
from clinicadl.utils.inputs import FILENAME_TYPE, MASK_PATTERN
#################################
# Datasets loaders
#####################... | |
self.mem['KLAMPO9']['V'] == 1: self.add_list_signal('Reactor trip')
if self.mem['KLAMPO6']['V'] == 1: self.add_list_signal('SI valve open')
if self.mem['KLAMPO4']['V'] == 1: self.add_list_signal('Containment ISO')
if self.mem['KLAMPO2']['V'] == 1: self.add_list_signal('Feedwater ISO')
if self.mem['KLAMPO3']['V'] ==... | |
import argparse
import io
import unittest
from io import StringIO
from unittest.mock import Mock, patch, MagicMock, call
import allel
import zarr
from ddt import ddt, data
from scripts.vector_genotype_concordance import ConcordanceResult, classify, classify_sample, classify_chromosome, \
compute_hom_alt_mismatch, HO... | |
name = read_scalars(folds_file, True, True)
>>> fold_number = 4
>>> indices = [i for i,x in enumerate(folds) if x == fold_number]
>>> edge_indices = extract_edge(indices, neighbor_lists)
>>> (len(indices), len(edge_indices))
(1151, 111)
Write results to vtk file and view (skip test):
>>> from mindboggle.mio.pl... | |
<filename>cuhpy.py
'''
cuhpy - A python implementation of the Colorado Urban Hydrograph Procedure (2.0.0)
Version P2.0.0
by <NAME> / RESPEC
June 2017
Code converted from CUHP 2.0.0 VBA / Excel
Requires math & numpy - Download windows binaries from (http://www.lfd.uci.edu/~gohlke/pythonlibs/)
Requires cuhpd... | |
"""User resources unit tests."""
import unittest
import common
from notelist.responses import (
METHOD_NOT_ALLOWED, MISSING_TOKEN, INVALID_TOKEN, OK,
ERROR_METHOD_NOT_ALLOWED, ERROR_INVALID_CREDENTIALS, ERROR_MISSING_TOKEN,
ERROR_INVALID_TOKEN, ERROR_VALIDATION)
from notelist.views.authentication import (
USER_L... | |
right_shift = 2 * (node.get_descendant_count() + 1)
return space_target, level_change, left_right_change, parent, right_shift
def _close_gap(self, size, target, tree_id):
"""
Closes a gap of a certain ``size`` after the given ``target``
point in the tree identified by ``tree_id``.
"""
self._manage_space(-size,... | |
<reponame>thewahome/msgraph-cli
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRes... | |
integers. For the transfer function for a single channel pass it's index as integer.
n_bins (None): number of bins in the transfer function (determines frequency resolution).
If None, use the maximum number of bins.
show (bool): whether to show the plot right after drawing.
axis (matplotlib.axes.Axes | None): axis ... | |
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import open
from builtins import int
from future import standard_library
standard_library.install_aliases()
import os
import json
import requests
import typ... | |
from rpython.jit.backend.aarch64 import registers as r
from rpython.jit.backend.aarch64 import locations
from rpython.jit.backend.arm import conditions as c
from rpython.jit.backend.aarch64.arch import WORD, JITFRAME_FIXED_SIZE
from rpython.jit.metainterp.history import (Const, ConstInt, ConstFloat,
ConstPtr,
INT, ... | |
pd.concat.
def concat(
objs: List[Union[DataFrame, Series]],
axis: Axis = 0,
join: str = "outer",
ignore_index: bool = False,
sort: bool = False,
) -> Union[Series, DataFrame]:
"""
Concatenate pandas-on-Spark objects along a particular axis with optional set logic
along the other axes.
Parameters
----------
... | |
from __future__ import absolute_import
import pathlib
import subprocess
import tempfile
from io import BytesIO
from typing import Generator
from unittest.case import TestCase
from unittest.mock import (
MagicMock,
Mock,
call,
mock_open,
patch,
)
import pytest
from sagemaker.processing import ProcessingInput, P... | |
singular simple past subjunctive of",
"second-person singular simple present form of",
"simple past and past participle of",
"simple past of",
"simple past plural of",
"simple past singular of",
"simple past tense and past participle of" ,
"simple past tense of",
"singular of",
"spurious plural of",
"superlat... | |
<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# # 2019 MolSSI Summer School QM project: semiempirical model of Argon
#
# ## 1. Introduction
#
# In this project, we will simulate a cluster of Argon atoms using quantum mechanics (QM). First-principles (a.k.a. ab initio) QM simulations are complicated and expensive... | |
def getFactorizedArea(self, factorize, invertband = True):
factorizedArea = []
nonfactorizedArea = []
self.soundArea = []
if(factorize == True):
factor = (REF307200/(self.resolution[0]*self.resolution[1]))
else:
factor = 1
for contour in self.contours:
area = cv2.contourArea(contour)
if 'defDebug' in globals... | |
# -*- coding: utf8 -*-
import pytest
from unittest.mock import Mock
from pandas import DataFrame
import pandas as pd
from scipy import sparse
from sklearn.datasets import load_iris
from sklearn.pipeline import Pipeline
from sklearn.model_selection import cross_val_score
from sklearn.svm import SVC
from sklearn.feature... | |
= bottom + (top - bottom) / 2.0
verts = [
(left, top),
(right, top),
(right, bottom),
(left, bottom),
(right, middle),
(very_right, middle)
]
codes = [Path.MOVETO,
Path.LINETO,
Path.LINETO,
Path.LINETO,
Path.MOVETO,
Path.LINETO
]
path = Path(verts, codes)
patch = patches.PathPatch(path, lw=1, faceco... | |
(6 тонн)':1,
'|---Производство 6-тонных автокранов (на базе военного грузовика)':1,
'-Длина колонны обеспечения (метров)':50,
}
metadict_detail['Военный грузовик (бурильная машина)'] = {
# http://saper.isnet.ru/texnica/bgm.html
'Платформа военного грузовика':1,
'Оборудование бурильной машины':1,
'|---Производст... | |
<reponame>bbbboom/nonebot-plugin
# -*- coding: utf-8 -*-
import os
import random
import aiofiles
import ujson
from . import Utils2plus
from .customException import GrailExcept
# Non fatal error type
error = 'error'
ok = 'ok'
insufficient = 'insufficient'
async def takeTheNameOfThePerson(bot, userQQ, userGroup):
nic... | |
return data
class AddAgeFeature(MapTransformation):
"""
Adds an 'age' feature to the data_entry.
The age feature starts with a small value at the start of the time series
and grows over time.
If `is_train=True` the age feature has the same length as the `target` field.
If `is_train=False` the age feature has ... | |
#!/usr/bin/python
# Code for generating and reading graphrat mazes
# Parameters:
# k: Grid size will be k * k nodes
# Type:
# u : uniform
# t : tiled
# v : vertical slices
# h : horizontal slices
# p : parquet
# i : irregular
import getopt
import sys
import math
import string
import datetime
import rutil
def usage... | |
<gh_stars>0
'''
Backends
--------
NDB stores all the records in an SQL database. By default it uses
the SQLite3 module, which is a part of the Python stdlib, so no
extra packages are required::
# SQLite3 -- simple in-memory DB
ndb = NDB()
# SQLite3 -- file DB
ndb = NDB(db_provider='sqlite3', db_spec='test.db')
... | |
when failed.
References
----------
>>> oModule.DeleteReports
"""
self.oreportsetup.DeleteReports([PlotName])
return True
@aedt_exception_handler
def rename_report(self, PlotName, newname):
"""Rename a plot.
Parameters
----------
PlotName : str
Name of the plot.
newname : str
New name of the plot.
R... | |
":is_savearea", pos57, pos59),
(val_add, ":var2", 1),
(assign, ":distance", 10),
(val_mul, ":distance", ":var2"),
(le, ":is_savearea", ":distance"),
(assign, ":safe_zone", 1),
(set_trigger_result, 0),
(try_end),
#(else_try), # check if damage should bleed through the armor due to unmet requirements
# (agent_sl... | |
<filename>traffic_control/tests/test_additional_sign_real_api.py<gh_stars>1-10
import datetime
import pytest
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from rest_framework import status
from rest_framework_gis.fields import GeoJsonDict
from traffic_control.models import Add... | |
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Copyright (c) 2018, Lawrence Livermore National Security, LLC.
Produced at the Lawrence Livermore National Laboratory
Written by <NAME>, <EMAIL>.
LLNL-CODE-755518.
All rights reserved.
"""""""""""""""""""""""""""""""""""... | |
<reponame>shadofren/deeposlandia<filename>tests/test_generators.py
"""Unit test related to the generator building and feeding
"""
import pytest
import numpy as np
from deeposlandia import generator, utils
def test_feature_detection_labelling_concise():
"""Test `feature_detection_labelling` function in `generator`... | |
"slack": "https://openmoneyico.slack.com",
"telegram": "https://t.me/joinchat/FDNbh0M079p5fnfOHFEJaw",
"twitter": "https://twitter.com/OpenPlatformICO",
"youtube": ""
}
},
"ZEUS": {
"symbol": "ZEUS",
"name": "ZeusNetwork",
"type": "ERC20",
"address": "0xe7E4279b80D319EDe2889855135A22021baf0907",
"ens_address... | |
<reponame>Riusuky/udacity-full-stack
from redis import Redis
from oauth2client import client, crypt
import time
import sys
import os
from functools import update_wrapper
from flask import request, g, make_response
from flask import Flask, jsonify, render_template
from models import User, Category, Image, Item, engin... | |
<reponame>jtyr/ansible-yaml_dynamic_inventory
#!/usr/bin/env python
try:
import ConfigParser as configparser
except:
import configparser
import argparse
import glob
import json
import logging
import os
import re
import sys
import yaml
# Get logger
log = logging.getLogger(__name__)
def create_symlinks(cfg, inv):... | |
<gh_stars>0
load("@bazel_gazelle//:deps.bzl", "go_repository")
def go_dependencies():
go_repository(
name = "co_honnef_go_tools",
importpath = "honnef.co/go/tools",
sum = "h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs=",
version = "v0.0.0-20190523083050-ea95bdfd59fc",
)
go_repository(
name = "com_github_alec... | |
# -*- coding: utf-8 -*-
# Adapted 2016 <NAME>, TU Berlin
# TU cluster specific changes.
# Written (W) 2008-2012 <NAME>
# Written (W) 2008-2010 <NAME>
# Written (W) 2012-2014 <NAME>, <EMAIL>
# Copyright (C) 2008-2012 Max-Planck-Society, 2012-2014 ETS
# This file is part of GridMap.
# GridMap is free software: you can... | |
<reponame>kekraft/contamination_stack<filename>people_tracking/scripts/people_tracker.py
#!/usr/bin/env python
import rospy
import numpy as np
from std_msgs.msg import *
from geometry_msgs.msg import Point, Quaternion, Pose, Vector3
from visualization_msgs.msg import Marker, MarkerArray
from sensor_msgs.msg import Las... | |
# Copyright 2020 - 2021 MONAI Consortium
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.