input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
and a bottom wall forming an acoustic chamber.
A flexible adhesive-backed flange is disposed on the periphery of the ear coupler. The flange attaches to the subject's head, firmly holding the ear coupler in place over the ear.
The annular side wall has a port for the placement of a transducer assembly, and also has ... | |
import csv
from pathlib import Path
from collections import Counter
from gender_novels import common
from gender_novels.novel import Novel
class Corpus(common.FileLoaderMixin):
"""The corpus class is used to load the metadata and full
texts of all novels in a corpus
Once loaded, each corpus contains a list of N... | |
first :math:`K_2` will be used. If any columns of ``sigma`` are fixed at zero,
only the first few columns of these nodes will be used.
The convenience function :func:`build_integration` can be useful when constructing custom nodes and weights.
.. note::
If ``nodes`` has multiple columns, it can be specified as a... | |
<reponame>Tesla2fox/MPDA_Preliminary<filename>Decode/decodeNew.py
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 4 10:12:55 2018
this decode can save the decode status
@author: robot
"""
import os,sys
AbsolutePath = os.path.abspath(__file__)
#将相对路径转换成绝对路径
SuperiorCatalogue = os.path.dirname(AbsolutePath)
#相对路径的上级路径
... | |
plane X
dist_origin_x = px - ox
dist_edge_x = ex - px
dx = 0
if dist_origin_x < dist_edge_x:
dx = dist_origin_x # 1
p_xyz[0] = 1
else:
dx = dist_edge_x # -1
p_xyz[0] = -1
if dx < cutoff and dx != 0:
pass
else:
p_xyz[0] = 0
# distance plane Y
doy = py - oy
dey = ey - py
dy = 0
if doy < dey:
dy = doy #... | |
"(nn::applet::AppletResourceUserId,long)", "pid": True, "outbytes": 0, "name": "SetNpadHandheldActivationMode"},
"68": {"inbytes": 16, "args": "(nn::sf::Out<bool,void>,nn::applet::AppletResourceUserId,nn::hid::SixAxisSensorHandle)", "pid": True, "outbytes": 1, "name": "IsSixAxisSensorFusionEnabled"},
"201": {"inb... | |
# -*- coding: UTF-8 -*-
# Copyright 2011-2018 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
import six
import sys
from datetime import datetime
from django.db.models import Q
from django.conf import settings
from django.db.models import Count
from django.contrib.humanize.templatetags.humanize import n... | |
<gh_stars>1-10
#!/usr/local/bin/python3
# Functions related to abdominal cavity segmentation
import shutil
import sys
import subprocess
import argparse
import numpy as np
from pathlib import Path
import SimpleITK as sitk
from cinemri.utils import get_patients
from data_extraction import extract_frames, merge_frames
fr... | |
"""
Developed by ThaumicMekanism [<NAME>.] - all credit goes to him!
"""
import contextlib
import sys
from typing import Callable, List
from tqdm.contrib import DummyTqdmFile
import examtool.api.download
from examtool.api.gradescope_upload import APIClient
from examtool.api.extract_questions import (
extract_groups,... | |
<reponame>renaudll/maya-mock
"""
Session class which hold informations about current nodes, ports and connections.
"""
import collections
import itertools
import logging
import re
import string
import six
from maya_mock.base import naming
from maya_mock.base.connection import MockedConnection
from maya_mock.base.cons... | |
expected_new_tensor[2, 0:2, :] = tensor[2, 1:3, :]
assert_array_almost_equal(new_tensor.data.numpy(), expected_new_tensor.data.numpy())
expected_new_mask = torch.from_numpy(numpy.array([[0, 0, 0], [1, 1, 1], [1, 1, 0]])).bool()
assert (new_mask.data.numpy() == expected_new_mask.data.numpy()).all()
def test_add_po... | |
<gh_stars>1-10
import copy
from math import ceil
from typing import List
from matplotlib import pyplot as plt
import numpy as np
import scipy.stats
from baselines.ga.multi_pop_ga.multi_population_ga_pcg import MultiPopGAPCG, SingleElementFitnessFunction, SingleElementGAIndividual
from games.game import Game
from games... | |
+ ", ".join(tracking_cols)
sql_code = f"SELECT \n{select_block_s} \n" \
f"FROM {name}"
add_to_col_trans(selection_map=selection_map, code_ref=code_ref, sql_source=name)
# cte_name, sql_code = singleton.sql_logic.finish_sql_call(sql_code, op_id, res_for_map,
# tracking_cols=tracking_cols,
# non_tracking_cols=al... | |
method."""
cmd = "show statistics"
lines = self.device.send_command(cmd)
lines = lines.split('\n')
counters = {}
for line in lines:
port_block = re.match('\s*PORT (\S+) Counters:.*', line)
if port_block:
interface = port_block.group(1)
counters.setdefault(interface, {})
elif len(line) == 0:
continue
else:
... | |
# SVMs for Food Experiment Data
import matplotlib
import numpy as np
import matplotlib.pyplot as pp
import optparse
import unittest
import random
import itertools
from sklearn import decomposition
from sklearn import svm
from sklearn.neighbors import KNeighborsClassifier
from sklearn.model_selection import StratifiedK... | |
<filename>apps/tcp/tests/run_tests.py
"""
<Program>
run_tests.py
<Author>
<NAME>
<Started>
July 3rd, 2008
<Edits>
<NAME> - Updated so that it works with the new way of specifying
ports dynamically. Also changed how it is run, it now assumes you are
running it in a directory generated by running preparetest.py... | |
help="Place mass pts along spokes uniform in volume (if omitted placement will be random and uniform in volume")
parser.add_argument("--linear-spoked", action="store_true", help="Place mass pts along spokes linear in radial distance (if omitted placement will be random and uniform in volume")
parser.add_argument("--gri... | |
#!/usr/bin/env python3
# Copyright 2018 Mitsubishi Electric Research Labs (<NAME>)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import torch
import numpy as np
import six
class CTCPrefixScoreTH(object):
"""Batch processing of CTCPrefixScore
which is based on Algorithm 2 in WATANABE et al.
"HYBRID ... | |
# -*- coding: utf-8 -*-
from __future__ import print_function, division
import numpy as np
from .params import Params
import re
import copy
import types
from PyAstronomy.pyaC import pyaErrors as PE
from .nameIdentBase import ModelNameIdentBase
from PyAstronomy import pyaC
from time import time as timestamp
from .fufDS ... | |
<reponame>MiCHiLU/google_appengine_sdk
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# ... | |
<gh_stars>0
#!/usr/bin/env python
# coding: utf-8
# In[1]:
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import panel as pn
pn.extension("katex")
# # Tutorial 3 - Darcy Law and Conductivity #
#
# _(The contents presented in this section were re-developed principally by Dr. <NAME>. The o... | |
"""Competitions for parameter tuning using Monte-carlo tree search."""
from __future__ import division
import operator
import random
from heapq import nlargest
from math import exp, log, sqrt
from gomill import compact_tracebacks
from gomill import game_jobs
from gomill import competitions
from gomill import competi... | |
import torch
import torch.nn as nn
from torch.autograd import Variable
import torch.nn.functional as F
def conv2d(in_planes, out_planes, kernel_size, stride, pad, dilation):
return nn.Sequential(
nn.Conv2d(
in_planes,
out_planes,
kernel_size=kernel_size,
stride=stride,
padding=dilation if dilation > 1 else pad... | |
# Copyright 2019 ZTE corporation. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
# pylint: disable=C0103, R0914, W1203, E0401, E0611, W0601
""" Train"""
import os
import time
import math
import random
import logging
import argparse
from test import test
import yaml
import torch
from torch import nn
import... | |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
import numpy as np
import cv2
from tensorpack import dataflow
from tensorpack.dataflow.base import RNGDataFlow, ProxyDataFlow
try:
import ipdb as pdb
except Exception:
impo... | |
return ff_type,ff_number,entry_data,entry_values,i
def store_ffio_data(self, ff_type, ff_number, entry_data, entry_values):
self.stored_ffio_data[ff_type] = dict()
self.stored_ffio_data[ff_type]['ff_type'] = ff_type
self.stored_ffio_data[ff_type]['ff_number'] = ff_number
self.stored_ffio_data[ff_type]['entry_dat... | |
"""
Created on Tuesday 9 July 2019
@author: s0899345
"""
import matplotlib.pyplot as plt
import iris
import iris.coord_categorisation as iriscc
import iris.plot as iplt
import iris.analysis.cartography
import numpy as np
import calendar
import cf_units
from cf_units import Unit
#this file is split in... | |
:alt: alternate text
:align: center
Returns
-------
res : fig or None
Either a figure if file_path is not specified or nothing.
"""
assert not (df_devs is None and df_tcorr is None)
title = "Triggercount with sliding window of " + t_window
color = 'trigger count'
cbarlabel = 'counts'
if df_tcorr is None:
... | |
+ m.s1s412 + m.s1s413 == 0)
m.c262 = Constraint(expr= - m.b208 + m.s1s414 + m.s1s415 + m.s1s416 + m.s1s417 + m.s1s418 + m.s1s419 + m.s1s420 == 0)
m.c263 = Constraint(expr= - m.b209 + m.s1s421 + m.s1s422 + m.s1s423 + m.s1s424 + m.s1s425 + m.s1s426 + m.s1s427 == 0)
m.c264 = Constraint(expr= - m.b210 + m.s1s428 + m.s1s... | |
<filename>tests/spark/test_harness.py
# Copyright 2019 Yelp
# Copyright 2020 Affirm, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | |
<filename>src/jpg2pdf.py
import datetime
import json
import os
import sys
import webbrowser
from PIL import Image
from PyQt5 import QtCore, QtGui
from PyQt5.QtCore import QProcessEnvironment, QUrl, QSettings
from PyQt5.QtGui import QPixmap, QGuiApplication, QIcon, QDesktopServices
from PyQt5.QtWidgets import QApplicati... | |
<filename>itests/test_server.py
import json
import os
import shutil
from base64 import urlsafe_b64encode
from urllib.parse import unquote
from uuid import uuid4
import pytest
import yaml
from .client_fixtures import get_static_path
from .server_fixtures import * # NoQA
from .utils import assert_files_equals, ensure_s... | |
<reponame>bgoli/stochpy<gh_stars>10-100
#! /usr/bin/env python
"""
StochPyTools
============
Written by <NAME>, Amsterdam, The Netherlands
E-mail: <EMAIL>
Last Change: June 08, 2015
"""
import re,sys,copy
from stochpy import model_dir as stochpy_model_dir
from ..modules.PyscesMiniModel import PySCeS_Connector
try:
... | |
#
# Copyright 2018-2021 Elyra Authors
#
# 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 writ... | |
- m.x6158 == 0)
m.c3416 = Constraint(expr= - 3.5161*m.x4284 + m.x4684 - m.x6156 - m.x6157 - m.x6158 == 0)
m.c3417 = Constraint(expr= - 3.1062*m.x4285 + m.x4685 - m.x6156 - m.x6157 - m.x6158 == 0)
m.c3418 = Constraint(expr= - 2.611*m.x4286 + m.x4686 - m.x6156 - m.x6157 - m.x6158 == 0)
m.c3419 = Constraint(expr= - 5.... | |
1
self.index = {}
self.header = []
for k, v in values.items():
for col in v:
if col not in self.index:
self.index[col] = len(self.index)
self.header.append(col)
self.values = [[None for h in self.header] for k in range(mx)]
for k, v in values.items():
for col, to in v.items():
self.values[k][self.index[col]]... | |
variable=keys['values'],
index=(i + idx_offset)), v_copy,
name_base=('%s_prop%d' % (name_base, i)),
use_generic=use_generic)
else:
keys['nitems'] = 0
keys['keys'] = cls.function_param['null']
keys['values'] = cls.function_param['null']
elif datatype['type'] in ['ply', 'obj']:
pass
elif datatype['type'] == '1d... | |
<gh_stars>1-10
import unicodedata
tests = {
"bidirs": {
"BN": "0000",
"S": "0009",
"B": "000A",
"WS": "000C",
"ON": "0021",
"ET": "0023",
"ES": "002B",
"CS": "002C",
"EN": "0030",
"L": "0041",
"NSM": "0300",
"R": "05BE",
"AN": "0600",
"AL": "0608",
"LRE": "202A",
"RLE": "202B",
"PDF": "202C",
"LRO":... | |
current subscriber count.
for key in [key for key in dictionary_milestones if key > current_subscribers]:
del dictionary_milestones[key]
# Form the Markdown table from our dictionary of data. We also add
# a first entry for the founding of the sub.
header = (
"### Milestones\n\n\n"
"| Date Reached | Sub... | |
<reponame>ksmit799/POTCO-PS
# File: C (Python 2.4)
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
from direct.directnotify import DirectNotifyGlobal
from pirates.economy import EconomyGlobals
from pirates.economy.EconomyGlobals import *
from pirates.pi... | |
import gc
import math
import multiprocessing
import shutil
from os.path import join
from tempfile import mkdtemp
from typing import Sequence, Optional
import numpy
from catboost import CatBoostRegressor, CatBoostError, Pool
from aydin.regression.base import RegressorBase
from aydin.regression.cb_utils.callbacks import... | |
<reponame>vkotronis/artemis
import datetime
import json as classic_json
import multiprocessing as mp
import time
from typing import Dict
from typing import NoReturn
import redis
import requests
import ujson as json
from artemis_utils import get_hash
from artemis_utils import get_logger
from artemis_utils.constants imp... | |
{'k1': '2065', 'k2': '739,19'},
{'k1': '2066', 'k2': '733,28'},
{'k1': '2067', 'k2': '727,41'},
{'k1': '2068', 'k2': '721,59'},
{'k1': '2069', 'k2': '715,82'},
{'k1': '2070', 'k2': '710,1'},
{'k1': '2071', 'k2': '704,41'},
{'k1': '2072', 'k2': '698,78'},
{'k1': '2073', 'k2': '693,19'},
{'k1': '2074', 'k2': '68... | |
generic wrapper.
"""
if enabled:
return functor(*args, **kwargs)
return NoOpContextManager()
class ContextManagerStack(object):
"""Context manager that is designed to safely allow nesting and stacking.
Python2.7 directly supports a with syntax generally removing the need for
this, although this form avoids in... | |
<reponame>london-escience/libhpc-cf<gh_stars>1-10
# Copyright (c) 2015, Imperial College London
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain... | |
= rightx_current - self.lanewidth_estimated_pixels
if window > 0 :
leftx_current = np.int((rightx_current - self.lanewidth_estimated_pixels) * alfa + leftx_current * ( 1 - alfa ))
if left_window_minpix_ok == False or right_window_minpix_ok == False:
keep_looking_ahead = False
if((len(non_zero_rect_intersects_ri... | |
median
def by_weighted_median(self, container, inputs):
for n in range(0,9):
#first lien weighted median block
#print inputs[self.purchaser_first_lien_rates[n]], inputs[self.purchaser_first_lien_weight[n]]
if len(inputs[self.purchaser_first_lien_rates[n]]) >0 and len(inputs[self.purchaser_first_lien_weight[n]]) >... | |
)
gr.gridWdg (
label = 'Z Spacing',
dataWdg = self.fpZCurrWdg,
units = 'steps',
cfgWdg = self.fpZUserWdg,
cat = self.EtalonCat,
)
self.model.fpZ.addROWdg(self.fpZCurrWdg)
self.model.fpZ.addROWdg(self.fpZUserWdg, setDefault=True)
# Detector widgets
# detector image header; the label is a toggle button
# ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""diskover - Elasticsearch file system crawler
diskover is a file system crawler that index's
your file metadata into Elasticsearch.
See README.md or https://github.com/shirosaidev/diskover
for more information.
Copyright (C) <NAME> 2017-2019
diskover is released under th... | |
<gh_stars>0
import json
from datetime import datetime, timedelta
from textwrap import dedent
from typing import Type, Any, Union, cast, List
import pytest
from deepdiff import DeepDiff
from networkx import DiGraph
from core.cli.model import CLIContext
from core.console_renderer import ConsoleRenderer, ConsoleColorSys... | |
import sys
from typing import List, Tuple
import numpy as np
import pandas as pd
def get_valid_gene_info(
genes: List[str],
release=102,
species='homo sapiens'
) -> Tuple[List[str], List[int], List[int], List[int]]:
"""Returns gene locations for all genes in ensembl release 93 --S Markson 3 June 2020
Parameter... | |
#!/usr/bin/env python3
"""
Phonon
Only harmonic Phonon subroutines implemented
All numerically heavy computations are in f90 (f_phonon.f90)
"""
#import os
#from itertools import islice, product
from ..util.tool import my_flatten
#from ..util.string_utils import fn_available
from ..symm_kpts import HighSymmKpath
from... | |
"""
Set of programs to read and interact with output from Bifrost
"""
import numpy as np
import os
from glob import glob
from . import cstagger
class BifrostData(object):
"""
Reads data from Bifrost simulations in native format.
"""
def __init__(self, file_root, snap=None, meshfile=None, fdir='.',
verbose=True... | |
<gh_stars>1-10
import numpy as np
import pandas as pd
import os, errno
import datetime
import uuid
import itertools
import yaml
import subprocess
import scipy.sparse as sp
from scipy.spatial.distance import squareform
from sklearn.decomposition.nmf import non_negative_factorization
from sklearn.cluster import KMeans
... | |
Util.getdims(expected) == 1 else [t[ind] for t in expected if len(t) > ind]
if len(actual_temp) == 0:
continue
p, _, base = self.get_assert_greater_bound(actual_temp, expected_temp, threshold)
bounds.append(p)
base_bounds.append(base)
return np.min(bounds), np.min(expected), np.min(base_bounds) # max probability ... | |
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019, 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | |
import torch
import numpy as np
import pickle
#from torchsummary import summary
from collections import OrderedDict
from torch.utils.tensorboard import SummaryWriter
import datetime
import time
import copy
import torchvision.datasets as datasets
import sys
sys.path.append('../Utils')
from DE.DNN import DNN
class JADE_... | |
<gh_stars>1-10
#!/usr/bin/env python3
"""Train with 1000"""
from __future__ import annotations
import argparse
import functools
import logging
import pathlib
import random
import typing
import albumentations as A
import cv2
import horovod.tensorflow.keras as hvd
import numpy as np
import scipy
import sklearn.metrics
... | |
dict):
self._property_changed('trading_pnl')
self.__trading_pnl = value
@property
def collateral_value_required(self) -> dict:
return self.__collateral_value_required
@collateral_value_required.setter
def collateral_value_required(self, value: dict):
self._property_changed('collateral_value_required')
self.... | |
if self.Value is not None:
namespaceprefix_ = self.Value_nsprefix_ + ':' if (UseCapturedNS_ and self.Value_nsprefix_) else ''
showIndent(outfile, level, pretty_print)
outfile.write('<%sValue>%s</%sValue>%s' % (namespaceprefix_ , self.gds_format_decimal(self.Value, input_name='Value'), namespaceprefix_ , eol_))
def ... | |
<reponame>WithPrecedent/rankings_remix
"""
rankings_remix: US News Law School Rankings Done Better
<NAME> <<EMAIL>>
Copyright 2020-2021, <NAME>
License: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0)
"""
from __future__ import annotations
import pathlib
from typing import (Any, Callable, ClassVar, Dict, Hash... | |
from tieler.tile_cpp import fill_mesh
from tieler.periodicity import compute_vertex_periodicity
from dolfin import Mesh, info, Timer, CompiledSubDomain
from collections import namedtuple
from copy import deepcopy
import numpy as np
try:
from itertools import izip
except ImportError:
izip = zip
# MAIN IDEA:
# We ... | |
CountryRegion.objects.all()
country_regions = {cr.id: cr.region for cr in country_regions}
# values
for r, obj in enumerate(query.all()):
c = 0
for fld in obj._meta.fields:
attr = fld.attname
if attr == 'country':
v = countries.alpha3(obj.country.code)
elif attr == 'country_region_id':
v = country_regions[o... | |
dataloader, index_file, config, checkpoint_save_path):
global loss_train, loss_test
global loss_mag_train, loss_mag_test, loss_phase_train, loss_phase_test, loss_angle_train, loss_angle_test
global global_step, global_epoch
n_epoch = config["training"]["n_epoch"]
loss_best = 100
loss_mag_best = 100
if config["d... | |
sample
c_neg (list): categorical values from C- sample
"""
suffixes = [
"{}{}".format(i, j)
for i in string.ascii_lowercase
for j in string.ascii_lowercase]
c_pos = ["{}A".format(s) for s in suffixes][:int(cardinality / 2)]
c_neg = ["{}B".format(s) for s in suffixes][:int(cardinality / 2)]
return c_pos, c_neg
... | |
type == 'none':
self.map_data[ps[4]] = type
for p in ps:
self.map_data_cover[p] = 'none'
def RasterisePath(self, path, points, type):
#draw_locs = []
ms = self.Options['map_size']
for i in xrange(len(path)-1):
p1 = path[i]
x1 = points[p1][0]
y1 = points[p1][1]
p2 = path[i+1]
x2 = points[p2][0]
y2 = p... | |
1 PRBS_DIRECTION_CHECKER = 2', required=False, default="0", type=click.Choice(["0", "1", "2"]))
@clicommon.pass_db
def enable(db, port, target, mode_value, lane_mask, prbs_direction):
"""Enable PRBS mode on a port args port target mode_value lane_mask prbs_direction
example sudo config mux prbs enable Ethernet48 0 3 ... | |
<filename>src/sardana/pool/poolacquisition.py
#!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you c... | |
N.array([1,0,0])
trans_den = N.array([2,1,1])
transformations.append((rot, trans_num, trans_den))
rot = N.array([1,0,0,0,0,1,0,1,0])
rot.shape = (3, 3)
trans_num = N.array([1,0,0])
trans_den = N.array([2,1,1])
transformations.append((rot, trans_num, trans_den))
rot = N.array([1,0,0,0,1,0,0,0,1])
rot.shape = (3, 3)
tran... | |
= download(name)
base_dir = os.path.dirname(fname)
data_dir, ext = os.path.splitext(fname)
if ext == '.zip':
fp = zipfile.ZipFile(fname, 'r')
elif ext in ('.tar', '.gz'):
fp = tarfile.open(fname, 'r')
else:
assert False, 'Only zip/tar files can be extracted.'
fp.extractall(base_dir)
return os.path.join(base_d... | |
"""
Base classes for collections of samples.
| Copyright 2017-2020, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import inspect
import logging
import os
import random
import string
import eta.core.serial as etas
import eta.core.utils as etau
from fiftyone.core.aggregations import Aggregation
import fi... | |
_preload_content=params.get('_preload_content', True),
_request_timeout=params.get('_request_timeout'),
collection_formats=collection_formats)
def search_device_datafiles(self, uri, **kwargs): # noqa: E501
"""Search device datafiles descriptions # noqa: E501
# noqa: E501
This method makes a synchronous HTTP req... | |
#!/usr/bin/env python2
from __future__ import print_function
import pygame
from pygame.locals import *
import sys
import random
import copy
WINDOW_WIDTH = 640
WINDOW_HEIGHT = 480
BOARD_WIDTH = 7
BOARD_HEIGHT = 7
ROTATE_TIME = 3
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
RED = (250, 0, 0)
GREEN = (0, 255, 0)
BLUE = (... | |
new_ws_nab.cell(row=1, column=31).value = "JustifyIfResultisInvalid"
# create a counter for keep track on row number for the new xlsx file
row_counter = 2
for file_name in file_list:
valid_spreadsheet = []
sample_number = []
# cur_wb = load_workbook(file_name, read_only=True, data_only=True)
cur_wb = load_work... | |
hash)
def get_sample_hash(self):
known = list(self.iter_known_hashes())
return self.getRandom().choice(known)
def check_verify(self, secret, hash, msg=None, negate=False):
result = self.do_verify(secret, hash)
self.assertTrue(result is True or result is False, 'verify() returned non-boolean value: %r' % (result... | |
makeNewUvloop(me, "Uvloop", True)
n = 0
for uvface in uvfaces:
for uv in uvface:
uvloop.data[n].uv = uv
n += 1
for mat in mats:
me.materials.append(mat)
for fn,mn in enumerate(mnums):
f = me.polygons[fn]
f.material_index = mn
f.use_smooth = True
vgnames = [vgrp.name for vgrp in ob.vertex_group... | |
y_arr, ls=dic['ls'], lw=dic['lw'], color=dic['color'],
# # label='{}'.format(sim.replace('_', '\_')))
# # else:
# # ax.plot(x_arr, y_arr, ls=dic['ls'], lw=dic['lw'], color=dic['color'])
# del(x_arr)
# else:
# raise NameError("plot type dic['dtype'] is not recognised (given: {})".format(dic["dtype"]))
#
# def pl... | |
import glob
import gzip
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import tarfile
import time
import psutil
import requests
import rpmfile
import tenacity
import yaml
from docker import APIClient
__tarantool_version = None
STATUS_NOT_STARTED = 'NOT STARTED'
STATUS_RUNNI... | |
self.center, self.radius, 5)
def get_center(self):
return self.center
def get_radius(self):
return self.radius
def is_alive(self):
return self.alive
# Define max shield HP
SHIELD_HP_MAX = 5
# Shield Class
class Shield(object):
def __init__(self, center, width, height):
self.center = center
self.x, self.y =... | |
#!/usr/bin/env python
# coding: utf-8
# The Receiver Operating Characteristic "ROC" illustrates the performance of the binary classifier by plotting the false alarm probability ($P_{FA}$) on the horizontal axis and the detection probability ($P_D$) on the vertical axis. The area under the ROC-curve (AUC) is used to pr... | |
'M05872',
'M05879',
'M0589',
'M059',
'M0600',
'M06011',
'M06012',
'M06019',
'M06021',
'M06022',
'M06029',
'M06031',
'M06032',
'M06039',
'M06041',
'M06042',
'M06049',
'M06051',
'M06052',
'M06059',
'M06061',
'M06062',
'M06069',
'M06071',
'M06072',
'M06079',
'M0608',
'M0609',
'M061',
'M0620',
... | |
<reponame>MacHu-GWU/cottonformation-project
# -*- coding: utf-8 -*-
"""
This module implements the core component CloudFormation Template. Many
black magic features are provided.
"""
import json
import attr
import typing
from collections import OrderedDict
from toposort import toposort
from .model import (
_Addable... | |
from typing import Union, List, Optional
from pyspark.sql.types import (
StructType,
StructField,
StringType,
ArrayType,
DateType,
BooleanType,
DataType,
TimestampType,
)
# This file is auto-generated by generate_schema so do not edit it manually
# noinspection PyPep8Naming
class ActivityDefinitionSchema:
"... | |
-9.874839418843413,
'单体': -12.359746068631413,
'军报': -12.359746068631413,
'全社会': -11.261133779963304,
'学成': -12.359746068631413,
'槐': -12.359746068631413,
'筑起': -12.359746068631413,
'选': -10.973451707511522,
'监听': -10.567986599403358,
'引入': -10.567986599403358,
'范本': -12.359746068631413,
'教育史': -11.261133779963304,
'阴'... | |
# This file is part of Viper - https://github.com/botherder/viper
# See the file 'LICENSE' for copying permission.
import os
import time
import getopt
import fnmatch
import tempfile
import shutil
from zipfile import ZipFile
from viper.common.out import *
from viper.common.objects import File
from viper.common.network... | |
<reponame>mdabrowski1990/uds
import pytest
from mock import patch
from uds.can.consecutive_frame import CanConsecutiveFrameHandler, \
InconsistentArgumentsError, CanDlcHandler, DEFAULT_FILLER_BYTE
from uds.can import CanAddressingFormat
class TestCanConsecutiveFrameHandler:
"""Unit tests for `CanConsecutiveFrameHa... | |
to method delete_conversations_email_messages_draft_attachment" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'conversation_id' is set
if ('conversation_id' not in params) or (params['conversation_id'] is None):
raise ValueError("Missing the required parameter `conversation_id` w... | |
import os
import shutil
import fnmatch
import tarfile
import subprocess
from pathlib import Path
from datetime import datetime
from collections import namedtuple
import time
import logging
import concurrent.futures
from ..handler import add_handler
from ..radiometry import BRDF, LinearAdjustments, RadTransforms, lands... | |
<filename>tail/analysis/likelihood.py
from .container import Spectra, get_idx, get_idxs, FSky
from .foreground import DUST_AMP, DUST_AMP_STD
import sys
import numpy as np
import pandas as pd
from numba import jit, float64, bool_, int32, complex128, prange
from scipy.optimize import minimize
from scipy.stats import ch... | |
num_voters
and num_candidates > obj.votes_allowed
)
if obj.publish_state != obj.PublishStates.ELECTION_NOT_DECENTRALIZED:
txt = ''
icon = DoneIcon()
else:
txt = _('Choose the blockchain you want to deploy your election smart contract to')
icon = TodoIcon()
try:
has_contract = obj.electioncontract is not None... | |
# Copyright (c) 2019-2020 <NAME>
# License: MIT License
# Created 2019-03-06
from typing import TYPE_CHECKING, Iterable, Sequence
import array
import copy
from itertools import chain
from contextlib import contextmanager
from ezdxf.math import Vector
from ezdxf.lldxf.attributes import DXFAttr, DXFAttributes, DefSubclas... | |
"""
path = self.phrasesPath
languages = []
for i in os.listdir(path):
if lang in i:
languages.append(i)
return len(languages)
def getstatus(self):
# print the status of the test and ask for confirmation
while True:
print_square("LANGUAGE: %s\n"
"RUNNING: %s\n"
"STATUS: %s/%s" % (self.lang, self.status, sel... | |
of Health Sciences"),
("Mercy College of Ohio","Mercy College of Ohio"),
("Mercy College","Mercy College"),
("Mercy Hospital School of Nursing","Mercy Hospital School of Nursing"),
("Mercy Hospital School of Practical Nursing-Plantation General Hospital","Mercy Hospital School of Practical Nursing-Plantation Genera... | |
<reponame>starius/gohere
#!/usr/bin/env python
""" Install Go into a local directory. """
import argparse
import errno
import hashlib
import logging
import os
import platform
import re
import shutil
import subprocess
import sys
import tarfile
import tempfile
import textwrap
try:
import urllib2
except:
# Python 3
i... | |
# This is a port of the ruby zabbix api found here:
# http://trac.red-tux.net/browser/ruby/api/zbx_api.rb
#
#LGPL 2.1 http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
#Zabbix API Python Library.
#Original Ruby Library is Copyright (C) 2009 <NAME> nelsonab(at)pobox(removethisword)(dot)com
#Python Library is ... | |
"""formatting.py unit tests."""
from unittest.mock import Mock
import pytest
from pypyr.formatting import RecursionSpec, RecursiveFormatter
# region recursion_spec
def test_recursion_spec_empty():
"""Empty recursion spec initializes defaults."""
r = RecursionSpec('')
r.has_recursed = False
r.is_flat = False
r.i... | |
GraphicLayerSequence = int('00700060', 16)
GraphicLayerOrder = int('00700062', 16)
GraphicLayerRecommendedDisplayGrayscaleValue = int('00700066', 16)
GraphicLayerRecommendedDisplayRGBValue = int('00700067', 16)
GraphicLayerDescription = int('00700068', 16)
ContentLabel = int('00700080', 16)
ContentDescription = i... | |
import numpy as np
from scipy import ndimage
import tifffile as tiff
import matplotlib.pyplot as plt
import pandas as pd
from enum import Enum
from skimage.transform import resize
# Worldview-3 - Panchromatic (3349, 3338): 400nm - 800nm
# Worldview-3 RGB (3350, 3338)
# Worldview-3 - 8 Multispectral bands (838, 835):... | |
# designing footer and header
def draw_canvas(self, page_count):
page = "Page %s of %s" % (self._pageNumber, page_count)
self.saveState()
self.setStrokeColorRGB(0, 0, 0)
self.setLineWidth(0.5)
self.setFont('Times-Roman', 10)
self.drawString(10, 10, page)
self.drawString(55, 720, "DATE")
self.drawString(200, 72... | |
<reponame>anilyil/funtofem
#!/usr/bin/env python
# This file is part of the package FUNtoFEM for coupled aeroelastic simulation
# and design optimization.
# Copyright (C) 2015 Georgia Tech Research Corporation.
# Additional copyright (C) 2015 <NAME>, <NAME> and <NAME>.
# All rights reserved.
# FUNtoFEM is licensed ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.