input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
testFileC]
for filesetFile in testFilesetC.files:
assert filesetFile in goldenFiles, \
"ERROR: Unknown file in fileset"
goldenFiles.remove(filesetFile)
assert len(goldenFiles) == 0, \
"ERROR: Fileset is missing files"
myThread.transaction.rollback()
testFilesetB.loadData()
testFilesetC.loadData()
assert l... | |
load balancers must use ipv4 .
:rtype: dict
:return: {
'LoadBalancers': [
{
'LoadBalancerArn': 'string',
'DNSName': 'string',
'CanonicalHostedZoneId': 'string',
'CreatedTime': datetime(2015, 1, 1),
'LoadBalancerName': 'string',
'Scheme': 'internet-facing'|'internal',
'VpcId': 'string',
'State': {
'Code': ... | |
<reponame>PennyHow/PyTrx<filename>DEM.py
#PyTrx (c) by <NAME>, <NAME>, <NAME>
#
#PyTrx is licensed under a MIT License.
#
#You should have received a copy of the license along with this
#work. If not, see <https://choosealicense.com/licenses/mit/>.
"""
The DEM module contains functionality for handling DEM dat... | |
import sys
import time
import tensorflow as tf
import numpy as np
from data_utils import SeqBatcher, Batcher
from cnn import CNN
from bilstm import BiLSTM
from bilstm_char import BiLSTMChar
from cnn_char import CNNChar
import eval_f1 as evaluation
import json
import tf_utils
from os import listdir
import os
import logg... | |
(other, distance) pairs that with all the
known objects at distance less or equal than near_distance to obj,
except obj itself.
Notice that it includes the ones colliding with obj.
obj is not required to be a known object
If the game logic wants the list ordered by ascending distances, use
ranked_objs_near instea... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
class opts(object):
def __init__(self):
self.parser = argparse.ArgumentParser()
# basic experiment setting
self.parser.add_argument('--task', default='gnn_mot', help='mot')
self... | |
pixel_value_offset = image_mean
image = tf.math.subtract(image, pixel_value_offset)
image = tf.math.divide(image, pixel_value_scale, name=scope)
# image = math_ops.div(image, pixel_value_scale, name=scope)
return image
def upsample_simple(images, shape_out, up, numClasses):
filter_up = tf.constant(1.0, shape=[u... | |
<gh_stars>1-10
"""
TODO: replaces previous versions 161110
Plots Accuracy for labeling for various learning and propagation methods
Since graph creation takes most time, especially for large graphs, saves graphs to a file format, then loads them later again.
First version: Nov 10, 2016
This version: Jan 26, 2020
"""
... | |
# This file was generated automatically by generate_protocols.py
from nintendo.nex import notification, rmc, common, streams
import logging
logger = logging.getLogger(__name__)
class RankingOrderCalc:
STANDARD = 0
ORDINAL = 1
class RankingMode:
GLOBAL = 0
GLOBAL_AROUND_SELF = 1
SELF = 4
class RankingStatF... | |
of this class.
"""
return '%s:%s' % (exp_id, state_name)
@classmethod
def get_state_reference_for_question(cls, question_id):
"""Generate the state_reference for the state in the question.
Args:
question_id: str. The id of the question.
Returns:
str. The state_reference for a new instance of this class.
""... | |
import itertools
import os
import sys
import pandas
from geopandas import GeoDataFrame, sjoin
from pandas import DataFrame
from shapely.geometry import Polygon
import numpy as np
import math
from gtfspy.util import wgs84_width, wgs84_height, df_to_utm_gdf, ut_to_utc_datetime, makedirs, wgs84_distance
import random
imp... | |
if mit_param(k):
return res
if kwargs.get('d'):
return float(res)
return res
except ZeroDivisionError:
print("agla: Division durch Null (Krümmung)")
return
print("agla: nur einen Parameterwert angeben")
return
else:
if len(wert) != 1:
print("agla: einen Punkt in der Ebene angeben")
return
gl = s... | |
<reponame>davidt/rbtools<gh_stars>0
from __future__ import print_function, unicode_literals
import fnmatch
import logging
import marshal
import os
import re
import six
import socket
import stat
import string
import subprocess
from rbtools.clients import SCMClient, RepositoryInfo
from rbtools.clients.errors import (Am... | |
test_failure=SHARED["netfac_r_ok"].id)
# re-create deleted netfac
r_data = self.assert_create(self.db_org_admin, "netfac", data)
# re-delete
self.assert_delete(self.db_org_admin, "netfac",
test_success=SHARED["netfac_id"])
##########################################################################
def test_org... | |
<filename>performance/driver/classes/observer/marathonevents.py<gh_stars>1-10
import json
import requests
import threading
import time
from .utils import CurlSSE, CurlSSEDisconnectedError
from .utils import RawSSE, RawSSEDisconnectedError
from datetime import datetime
from performance.driver.core.classes import Obser... | |
:param password:
:param port_override:
:param port:
"""
__slots__ = [
'id',
'name',
'healthy',
'tags',
'secret_store_id',
'egress_filter',
'hostname',
'username',
'password',
'port_override',
'port',
]
def __init__(
self,
id=None,
name=None,
healthy=None,
tags=None,
secret_store_id=None,
e... | |
"""finds bad channels."""
import mne
import numpy as np
from mne.channels.interpolation import _make_interpolation_matrix
from psutil import virtual_memory
from scipy import signal
from scipy.stats import iqr
from statsmodels import robust
from pyprep.removeTrend import removeTrend
from pyprep.utilities import filter_... | |
+= A[k, d] * np.conj(B[c - k, d])
return suma
def helm_coefficients_josep(Ybus, Yseries, V0, S0, Ysh0, pq, pv, sl, pqpv, tolerance=1e-6, max_coeff=30, verbose=False):
"""
Holomorphic Embedding LoadFlow Method as formulated by <NAME> in 2020
THis function just returns the coefficients for further usage in other ro... | |
= copy.copy(orig)
for k, v in test_failures["perms"].items():
data_perms[k] = v
with self.assertRaises(PermissionDeniedException) as inst:
db.update(typ, **data_perms)
# we test failure to update readonly fields
if "readonly" in test_failures:
data_ro = copy.copy(orig)
b_data = self.assert_get_handleref(db, t... | |
import io
import tempfile
import unittest
import numpy
from gensound.sound import *
from gensound.sound import _repeat_array
class SoundUtilsTest(unittest.TestCase):
def test_repeat_array_single_channel(self):
array = numpy.array([[1, 2, 3]]).T
repeated = [1, 2, 3] * 3
self.assertEqual(tuple(_repeat_array(arra... | |
<gh_stars>1000+
"""
Execution of data pipelines.
Uses forking (multiprocessing processes) for parallelism and message queues for inter-process communication.
"""
import datetime
from datetime import timezone as tz
import functools
import multiprocessing
import os
import sys
import signal
import atexit
import time
impo... | |
f.SetGeometry(ogr.CreateGeometryFromWkt('POLYGON ((0 0,0 1,1 1,1 0,0 0))'))
lyr.CreateFeature(f)
f = None
ds = None
# Split features
layer = QgsVectorLayer(u'{}'.format(tmpfile) + "|layername=" + "test", 'test', u'ogr')
self.assertTrue(layer.isValid())
self.assertTrue(layer.isSpatial())
self.assertEqual([f for... | |
import math
import random
import geomstats.backend as gs
from geomstats.geometry.spd_matrices import SPDMatrices
from tests.data_generation import _OpenSetTestData, _RiemannianMetricTestData
SQRT_2 = math.sqrt(2.0)
LN_2 = math.log(2.0)
EXP_1 = math.exp(1.0)
EXP_2 = math.exp(2.0)
SINH_1 = math.sinh(1.0)
class SPDMat... | |
<reponame>athaun/Python-ai-assistant<gh_stars>1-10
""" Persistent cache storage for web ressources, with different cache eviction strategies, and optional compression. """
__version__ = "1.1.0"
__author__ = "desbma"
__license__ = "LGPLv2"
import bz2
import collections
import enum
import functools
import inspect
impor... | |
self.stormIsInPrint('List[0]=1, List[-1]=4', msgs)
self.stormIsInPrint('List size is now 4', msgs)
self.stormIsInPrint('Sum is now 10', msgs)
self.stormIsInPrint('elst size is 0', msgs)
# Convert primitive python objects to List objects
q = '$v=(foo,bar,baz) [ test:str=$v.index(1) test:int=$v.length() ]'
nodes =... | |
'1626443':{'en': 'El Monte, CA'},
'1626444':{'en': 'El Monte, CA'},
'1626445':{'en': 'Arcadia, CA'},
'1626446':{'en': 'Arcadia, CA'},
'1626447':{'en': 'Arcadia, CA'},
'1626448':{'en': 'El Monte, CA'},
'1626449':{'en': 'Pasadena, CA'},
'1626452':{'en': 'El Monte, CA'},
'1626453':{'en': 'El Monte, CA'},
'1626454... | |
+ 130653.05862079248 * self.t)
X1 += 0.00000000006 * math.cos(6.20953170755 + 110.45013870291 * self.t)
X1 += 0.00000000007 * math.cos(1.43696950392 + 77631.16950289288 * self.t)
X1 += 0.00000000006 * math.cos(1.84528711156 + 53131.16220727349 * self.t)
X1 += 0.00000000006 * math.cos(4.02329719726 + 26013.365360490... | |
from app.utils import splitDict
from app.service.charts import Charts
class groupsCharts(Charts):
def __init__(self, bddCon):
super().__init__(bddCon)
def charts(self, form):
charts = list()
recall = dict()
error = False
# Variables input
date = self.pickDate(form, recall)[0]
groupName = form.groups.data
r... | |
<filename>Akitrix.py
import json
import os
import threading
import time
import urllib.error
import urllib.request
import discord
import pymysql
from PIL import Image, ImageEnhance
from discord.ext import commands
import AkitrixDB
import Image_Edit
'''Unique token for bot to connect with Discord API'''... | |
3 doubles: X, Y, Z, representing the
| coordinates in model space of the X axis of the axis system.
|
|
| Example:
| The following example retrieves in XAxisCoord the coordinates of the X
| axis of the axisSystem axis system:
|
| Dim XAxisCoord(2)
| axisSystem.GetXAxis XAxisCoord
:param tuple o_x_axis:
:... | |
TCTAGG 123456 AS:i:77',
]).replace(' ', '\t')
dm = DistanceMatrix()
with dataFile(data) as filename:
dm.addFile(filename, scoreTag='AS')
self.assertEqual(
{
'ref1': {
'query1': 77.0,
},
},
dm.scores)
self.assertEqual(77.0, dm.score('ref1', 'query1'))
def testOneQueryMappedWithScoreTagFloat(self):
"""
... | |
file, then _set_state is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_state() directly.
"""
if hasattr(v, "_utype"):
v = v._utype(v)
try:
t = YANGDynClass(v,base=six.text_type, is_leaf=True, yang_name="state", parent=self, path_helper=self._path... | |
of the time series (useful when multiple time series are run simultaneously),
and the predictive model used.
"""
assert (
model in self.available_models
), f"Requested model {model} not currently supported. Please choose one from: {self.available_models}"
if model_parameters is None:
model_parameters = self.pa... | |
<reponame>fpjnijweide/clrs
# Copyright 2021 DeepMind Technologies Limited. 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
#
# http://www.apache.org/licenses/LICENSE-2.0
... | |
to the workflow\'s output folder)')
parser_update_stage.set_defaults(func=workflow_cli.update_stage)
register_parser(parser_update_stage, subparsers_action=subparsers_update, categories='workflow')
parser_update_member = subparsers_update.add_parser("member", help="Update the membership of a user in an org", descripti... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Network Control Theory Tutorial
@author: Johannes.Wiesner
"""
import json
import numpy as np
import pandas as pd
import networkx as nx
import dash
import dash_cytoscape as cyto
import dash_html_components as html
from dash.dependencies import Input, Output, State
import dash_co... | |
# MIT License
#
# Copyright (c) 2020-2021 CNRS
#
# 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... | |
# Copyright 2015 The TensorFlow 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | |
<reponame>viveklam/beep
# Copyright 2019 Toyota Research Institute. All rights reserved.
"""Unit tests related to cycler run data structures"""
import json
import os
import subprocess
import unittest
import boto3
import numpy as np
import pandas as pd
from botocore.exceptions import NoRegionError, NoCredentialsError
... | |
the Astrophysical factor (GeV**2/cm**5)
to compute the dm flux
Parameters
----------
jfactor : Astrophysical factor J (GeV**2/cm**5)
"""
if jfactor < 1.e-40 :
raise ValueError('\nValue of jfactor must be greater than 1.e-40.')
# Set the jfactor
self._jfactor = jfactor
# Return
return
@property
def dfac... | |
= 60 + coef
if intelligence == 3:
x = 40 + coef
if intelligence == 4:
x = 20 + coef
if x >= 90:
x = 90
if random.randint(1, 100) <= x:
cardplayers.remove(ids[1])
else:
cardplayers.remove(ids[0])
i = 10
except:
try:
print('try3')
int(ids[1])
index = 0
coef = 0
user = users.find_one({'id': ids[1]})
if... | |
<reponame>Haiiliin/PyAbaqus<gh_stars>1-10
import typing
from abaqusConstants import *
from ..BasicGeometry.Cell import Cell
from ..BasicGeometry.Edge import Edge
from ..BasicGeometry.Face import Face
from ..BasicGeometry.InterestingPoint import InterestingPoint
from ..BasicGeometry.Vertex import Vertex
from ..Datum.Da... | |
<reponame>shivaathreya/ibis<filename>lib/ingest/tests/test_parquet_opt_ddl_time.py
"""Tests for parquet_opt_ddl_time.py"""
import difflib
import os
import unittest
from mock import patch, MagicMock
from lib.ingest.parquet_opt_ddl_time import ConnectionManager, DDLTypes, main
BASE_DIR = os.path.dirname(os.path.abspath... | |
tube
scores = (D[action,q[te]] - D[action,q[ts]]) / (te - ts)
label = [action for _ in range(len(ts))]
total_score = np.ones(len(ts)) * D[p[-1],q[-1]] / len(p)
return ts,te,scores,label,total_score
def actionPathSmoother4oneVideo(video_paths,alpha,num_action):
final_tubes = {}
final_tubes['starts'] = {}
final_... | |
# Every crownstone creates its ResultMap and no result is published in order to not influence the way that the testdata
# is created for every crownstone. A confidence Map with the probabilities that correspond to each labelroom is created as well.
from simulator.simulatorBases.CrownstoneCore import CrownstoneCore
fr... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2019-08-21 at 12:28
@author: cook
"""
from astropy.table import Table
from astropy import constants as cc
from astropy import units as uu
import numpy as np
import os
from scipy.optimize import curve_fit
import warn... | |
TimeDistributed(Dense(4096, activation="relu", kernel_regularizer=l2_reg), name="frcnn_fc1")(output)
output = TimeDistributed(Dense(4096, activation="relu", kernel_regularizer=l2_reg), name="frcnn_fc2")(output)
frcnn_cls_predictions = TimeDistributed(Dense(cfg.NUM_CLASSES, activation="softmax", kernel_regularizer=l2_... | |
* square_sum) ** beta)
expect(expected, onp.nn.lrn(onp.array(x), size=nsize))
@pytest.mark.parametrize("type_a", [np.float32])
def test_lrn(type_a):
alpha = 0.0002
beta = 0.5
bias = 2.0
nsize = 3
x = np.random.randn(5, 5, 5, 5).astype(type_a)
square_sum = np.zeros((5, 5, 5, 5)).astype(type_a)
for n, c, h, w ... | |
0x81E6
Animation231 = 0x81E7
Animation232 = 0x81E8
Animation233 = 0x81E9
Animation234 = 0x81EA
Animation235 = 0x81EB
Animation236 = 0x81EC
Animation237 = 0x81ED
Animation238 = 0x81EE
Animation239 = 0x81EF
Animation240 = 0x81F0
Animation241 = 0x81F1
Animation242 = 0x81F2
Animation243 = 0x81F3
Animation244 ... | |
#!/usr/bin/env python
"""
Copyright (c) 2015, <NAME> <<EMAIL>>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTH... | |
<filename>htc-api/api/htc_api.py
#!flask/bin/python
from flask import Flask, jsonify, request, abort, g, send_from_directory
from flask_cors import CORS
from flask.ext.autodoc import Autodoc
from flask_cache import Cache
import logging
import re
#need simplejson to deal with Postgres Decimal types
import simplejson a... | |
"""
return (source, target) in self._arcs
def sources(self) -> Set[Node]:
"""
Get all nodes in the graph that have no parents.
Return
------
List[node]
Nodes in the graph that have no parents.
Example
-------
>>> from graphical_models import DAG
>>> g = DAG(arcs={(1, 2), (1, 3), (2, 3)})
>>> g.sources()... | |
<reponame>event-driven-robotics/models<filename>nxsdk_modules_ncl/dnn/src/data_structures.py<gh_stars>10-100
#
# Copyright © 2020 Intel Corporation.
#
# This software and the related documents are Intel copyrighted
# materials, and your use of them is governed by the express
# license under which they were provided to ... | |
'Sales', 53000, 2009, 53000),
('Wilkinson', 'IT', 60000, 2011, 60000),
('Johnson', 'Marketing', 40000, 2012, 40000),
('Moore', 'IT', 34000, 2013, 50000),
('Adams', 'Accounting', 50000, 2013, 50000),
], lambda row: (row.name, row.department, row.salary, row.hire_date.year, row.max_salary_year))
def test_cume_dist... | |
jointsolutions]) and len(jointsolutions)>0:
return [AST.SolverSolution(var.name,jointeval=jointsolutions,isHinge=self.isHinge(var.name))]
solutions = []
if len(eqns) > 1:
neweqns = []
listsymbols = []
symbolgen = cse_main.numbered_symbols('const')
for e in eqns:
enew, symbols = self.groupTerms(e.subs(varsym.su... | |
this case is given by the column **Attrition** which contains categorical variables therefore requires numerical encoding. We numerically encode it by creating a dictionary with the mapping given as 1 : Yes and 0 : No
# In[ ]:
# Define a dictionary for the target mapping
target_map = {'Yes':1, 'No':0}
# Use the pand... | |
exit()
if adrs:
s = [str(c.index), effect.name]
else:
s = [str(c.index), effect.id_]
for x in metrics:
if value <= x[1]:
effect_dct[(effect, count)][x] += 1.0
s.append('1')
else:
s.append('0')
if continuous:
s.append(str(value))
else:
s.append(str(int(value)))
ss.append(s)
break
self.accuracies = eff... | |
# Copyright (c) 2012 NTT DOCOMO, INC.
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
import hashlib
import os
import subprocess
import sys
import tempfile
import warnings
from copy import deepcopy
from datetime import datetime
from logging import getLogger
from time import time, sleep
from typing import Optional, Mapping, Sequence, Any, Callable, Union
from pathlib2 import Path
from ..backend_api imp... | |
"""
Mostly copied from wandb client code
Modified "next_sample" code to do the following:
-accepts a 'failure_cost' argument
-if failure cost 'c' is nonzero, modifies expected improvement of each
sample according to:
e' = p e / (p (1-c) + c)
where 'p' is probability of success and 'e' is unmodified expected improvem... | |
else:
return ['*Simple* %s' % item[1]]
if allTypeDict.has_key(item[1]):
if item[1] not in alreadyListed:
alreadyListed.append(item[1])
strList.extend(self.recurseTypeList(allTypeDict,
allTypeDict[item[1]], level+1, alreadyListed))
return strList
class PartWriter:
"""Generates a string representati... | |
1
)
# 3 texts for the choice
self.assertEqual(
len(item._my_map['question']['choices'][region_name][0]['texts']),
3
)
self.assertEqual(
item._my_map['question']['choices'][region_name][0]['id'],
choice_identifier
)
self.assertIn(self._str_txt(self._english()), item._my_map['question']['choices'][region_name]... | |
postCellId="../DA9/0/"/>
</projection>
<projection id="NC_PDA_DA9_Serotonin" postsynapticPopulation="DA9" presynapticPopulation="PDA" synapse="">
<connection id="0" preCellId="../PDA/0/" postCellId="../DA9/0/"/>
</projection>
<projection id="NC_PDA_DD6_Serotonin" postsynapticPopulation="DD6" presynapticPopulation=... | |
elif token == 'DISASM_INTEL':
self.disasm_intel = rest
elif token == 'DISASM_ATTSV': # AT&T System V
self.disasm_att = rest
elif token == 'UNAME':
self.uname = rest
if viclass():
msgb("UNAME", rest)
elif token == 'IFORM':
if filling_extra:
if len(self.extra_iforms_input) == 0:
die("Need to have a PATTERN li... | |
<filename>CodeGenX64/legalize.py<gh_stars>100-1000
import collections
import dataclasses
import sys
from typing import List, Dict, Optional, Tuple
from Base import canonicalize
from Base import ir
from Base import liveness
from Base import lowering
from Base import opcode_tab as o
from Base import optimize
from Base ... | |
"""
Copyright (c) 2017 Matterport, Inc.
Copyright (C) 2019 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license
(https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
import os
import random
import itertools
import numpy as np
from skimage.measure import find_contours
import ... | |
import os
from copy import deepcopy
from pathlib import Path
import numpy as np
import pytest
from qualang_tools.bakery.bakery import baking
from qualang_tools.bakery.randomized_benchmark_c1 import c1_table, c1_ops
def gauss(amplitude, mu, sigma, length):
t = np.linspace(-length / 2, length / 2, length... | |
<reponame>catubc/MOTION
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import cv2, os, sys, glob
import scipy
import sklearn
import imageio
import matplotlib.cm as cm
import matplotlib
import time
from sklearn import decomposition, metrics, manifold, svm
from tsne import bh_s... | |
+= 0.00000000021 * math.cos(2.63713620085 + 13656.10430865991 * self.t)
X2 += 0.00000000020 * math.cos(4.83742385337 + 33326.8225506577 * self.t)
X2 += 0.00000000018 * math.cos(1.65998530501 + 52156.38033973211 * self.t)
X2 += 0.00000000023 * math.cos(4.13597342584 + 41962.7645544209 * self.t)
X2 += 0.00000000018 *... | |
import os
from pathlib import Path
from io import BytesIO
import time
import re
import hashlib
import threading
from functools import wraps
import logging
import mimetypes
import urllib.request as request
import http.cookiejar as http_cookiejar
from http import HTTPStatus
# import ssl
# ssl._create_default_https_contex... | |
# The MIT License (MIT)
# Copyright (c) 2018 - Universidad del Cauca, <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
# t... | |
#!/usr/bin/python3
'''
Summary
-------
This application derives the parameter mirror_reflection_random_angle \
(mirror roughness, also called rnda here) \
for a given set of measured D80 of individual mirrors. The mean value of the measured D80 \
in cm is required and its sigma can be given optionally but will o... | |
<gh_stars>0
import os
from pathlib import Path
import json as stable_json # use in case then orjson failed
import orjson as json # faster
import numpy as np
import pandas as pd
from tqdm import tqdm_notebook as tqdm
import yaml
from yaml import Loader as Loader
import re
from sklearn.metrics import (
accuracy_score,
... | |
import logging, json
from threading import Thread
from django.conf import settings
from docker import Client
from docker.errors import APIError
from backend.models import Image
from backend.utils import (fetch_digest_from_response, get_optimal_docker_host,
remove_file_from_disk)
from backend.schedule import DockerSc... | |
of 1/10 of QRS amplitude
noise_amp = qrs_amp / 10
# Get R-R intervals of consecutive beats, if any.
rr_intervals = np.diff(qrs_inds)
rr_intervals = rr_intervals[rr_intervals < self.rr_max]
if rr_intervals.any():
rr_recent = np.mean(rr_intervals)
else:
rr_recent = self.rr_init
# If an early QRS was detected, ... | |
r"""
Spheres smoothly embedded in Euclidean Space
Let `E^{n+1}` be a Euclidean space of dimension `n+1` and `c \in E^{n+1}`. An
`n`-sphere with radius `r` and centered at `c`, usually denoted by
`\mathbb{S}^n_r(c)`, smoothly embedded in the Euclidean space `E^{n+1}` is an
`n`-dimensional smooth manifold together with ... | |
# -*- coding: utf-8 -*-
"""Utility functions for manipulating data
"""
# Author: <NAME> <<EMAIL>>
# Author: <NAME> <<EMAIL>>
# License: BSD 2 clause
from __future__ import division
from __future__ import print_function
from warnings import warn
import numpy as np
from sklearn.datasets import make_blobs
from sklearn.... | |
"""
Process results
This script process results for the final report of SCOOP
"""
# ==============================================================================
# Imports
# ==============================================================================
import pandas as pd
from matplotlib import pyplot as plt
... | |
<reponame>yamizi/taskaugment
### THis file is moved to eval.py, not use this anymore
import models.drn as drn
from models.DRNSeg import DRNSeg
from models.FCN32s import FCN32s
import data_transforms as transforms
import json
import math
import os
from os.path import exists, join, split
import threading
import time, d... | |
AKISetSectionUserDefinedCost2(*args):
return _AAPI.AKISetSectionUserDefinedCost2(*args)
AKISetSectionUserDefinedCost2 = _AAPI.AKISetSectionUserDefinedCost2
def AKISetSectionUserDefinedCost3(*args):
return _AAPI.AKISetSectionUserDefinedCost3(*args)
AKISetSectionUserDefinedCost3 = _AAPI.AKISetSectionUserDefinedC... | |
<gh_stars>0
"""
Comparison with a gtlike model
"""
import os, glob
import pickle
import numpy as np
import pylab as plt
import matplotlib.gridspec as gridspec
import matplotlib.ticker as ticker
import pandas as pd
from skymaps import SkyDir
#from uw.utilities import makepivot
from uw.like import Models
from . impor... | |
response = self.client.get(self.facet_url, data)
self.assertEqual(response.status_code, status.HTTP_200_OK)
department_facets = response.data["fields"]["department"]
department_projects_after_filtering = 0
for value in department_facets:
if department == value["text"]:
department_projects_after_filtering = value... | |
#!/usr/bin/env python
#
# Copyright 2018 VMware, Inc.
# SPDX-License-Identifier: BSD-2-Clause OR GPL-3.0-only
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FO... | |
<reponame>WeilerWebServices/PostgreSQL<filename>pgAdmin/browser/server_groups/servers/pgagent/schedules/__init__.py
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under th... | |
the type of object this is. Should always . # noqa: E501
:param category_id: The category_id of this BlogPost. # noqa: E501
:type: int
"""
if self.local_vars_configuration.client_side_validation and category_id is None: # noqa: E501
raise ValueError("Invalid value for `category_id`, must not be `None`") # noqa: E... | |
from dataclasses import dataclass
from typing import List
import numpy as np
import scipy.spatial
import matplotlib.pyplot as plt
from spherical_geometry.polygon import SingleSphericalPolygon
from .celeri_util import sph2cart
def angle_between_vectors(v1, v2, v3):
"""
Compute the angle between the vector (v2, v3)... | |
Hub operations. It contains a list of operations and a URL link to get the next set of results.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar value: List of IoT Hub operations supported by the Microsoft.Devices resource provider.
:vartype value: list[~azure.mgmt.ioth... | |
% ",".join(memeber_set))
class DescribeHttpStatusInfoListResponse(AbstractModel):
"""DescribeHttpStatusInfoList返回参数结构体
"""
def __init__(self):
r"""
:param DataInfoList: 播放状态码列表。
:type DataInfoList: list of HttpStatusData
:param RequestId: 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str
""... | |
class driver session, it may return
interchangeability warnings generated by the IVI class driver as well as
interchangeability warnings generated by the IVI specific driver. The IVI
class driver determines the relative order in which the IVI class driver
warnings are returned in relation to the IVI specific driver... | |
on the client system.
"""
if self.tf is None:
logging.debug('Unable to execute "tf help": skipping TFS')
return None
workfold = self._run_tf(['workfold', os.getcwd()])
m = re.search('^Collection: (.*)$', workfold, re.MULTILINE)
if m:
return unquote(m.group(1))
logging.debug('Could not find the collection f... | |
separated values."""
return "\t".join(self.getHeaders())
def __str__(self):
"""return string representation of data."""
if self._mode == "int":
format_vals = "%i"
format_median = "%.1f"
else:
format_vals = self._format
format_median = self._format
return "\t".join(("%i" % self.counts,
format_vals % self.m... | |
# 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
# distributed under the Li... | |
<gh_stars>1-10
# File for plotting utilities
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import os
from utils.sim import *
from utils.data import *
# Included functions with descriptions:
# plot_flight_time: Plots flight time vs rollout
# plot_traine... | |
<gh_stars>0
# -*- coding: utf-8 -*-
from pysignfe.corr_unicode import *
from pysignfe.xml_sped import *
from pysignfe.nfe.manual_401 import ESQUEMA_ATUAL
from pysignfe.nfe.manual_300 import nfe_110
import os
from lxml.etree import tounicode
from pysignfe.nfe.webservices_3 import ESTADO_SVC_CONTINGENCIA
from pysignfe.... | |
<filename>nuitka/codegen/CodeGeneration.py
# Copyright 2021, <NAME>, mailto:<EMAIL>
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in c... | |
(unless the underlying
feature importances are categorical, in which a list of DataFrames
will be returned.)
If mean=True, then a pandas Series (or in the case of
underlying categorical feature importances, list of)
will be returned, with the mean value from each fold
and all features with a value of 0 excluded.... | |
import itertools
import numpy as np
from PartSegCore.segmentation.border_smoothing import IterativeVoteSmoothing, OpeningSmoothing, VoteSmoothing
from PartSegCore.segmentation.watershed import NeighType
class TestVoteSmoothing:
def test_cube_sides(self):
data = np.zeros((50, 50, 50), dtype=np.uint8)
data[2:-2, 2... | |
"emigrate",
"knighthood",
"kathie",
"desai",
"migrated",
"dominus",
"octavian",
"matsuda",
"namesake",
"weepy",
"shiner",
"grifter",
"basking",
"opa",
"adolfo",
"sagittarius",
"'look",
"smurfs",
"censored",
"wares",
"memorizing",
"seabed",
"weasels",
"councilwoman",
"nationalism",
"hsu",
"tech... | |
<filename>netforce_service/netforce_service/models/job.py
# Copyright (c) 2012-2015 Netforce Co. Ltd.
#
# 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... | |
for k, v in mapping.iteritems()))
@staticmethod
def gds_encode(instring):
if sys.version_info.major == 2:
if ExternalEncoding:
encoding = ExternalEncoding
else:
encoding = 'utf-8'
return instring.encode(encoding)
else:
return instring
@staticmethod
def convert_unicode(instring):
if isinstance(instring, str... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.