input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<gh_stars>0
from crits.core.crits_mongoengine import EmbeddedObject
from cybox.common import String, PositiveInteger, StructuredText
from cybox.objects.account_object import Account
from cybox.objects.address_object import Address
from cybox.objects.api_object import API
from cybox.objects.artifact_object import Arti... | |
# -*- encoding: utf-8 -*-
import os
import threading
import time
import timeit
import pytest
from ddtrace.vendor import six
from ddtrace.profiling import _nogevent
from ddtrace.profiling import collector
from ddtrace.profiling import profiler
from ddtrace.profiling import recorder
from ddtrace.profiling import _serv... | |
a list with nodes
:param nodes: the list with nodes to start
:type nodes: list(:class:`fkie_node_manager.node_tree_model.NodeItem`)
:param bool force: force the start of the node, also if it is already started.
:param str force_host: force the start of the node at specified host.
'''
cfg_choices = dict()
cfg_no... | |
an array of queries.
:param queries: array of queries "key op value" where op can be
http://docs.sqlalchemy.org/en/rel_0_7/core/expression_api.html
#sqlalchemy.sql.operators.ColumnOperators
"""
hosts_query = model_query(models.ComputeHost, get_session())
oper = {
'<': ['lt', lambda a, b: a >= b],
'>': ['gt',... | |
<gh_stars>0
# -*- coding: utf-8 -*-
'''
zwQuantToolBox 2016
zw量化开源工具箱系列软件
http://www.ziwang.com,Python量化第一品牌
文件名:zwQTBox.py
说明:import zwQTBox as zwx
常用zwQuant量化工具函数集
'''
import sys, os
import numpy as np
import tushare as ts
import pandas as pd
#import pandas_datareader.data as web
from numba import *... | |
# encoding: utf-8
# module Wms.RemotingImplementation.DataSetTableAdapters calls itself DataSetTableAdapters
# from Wms.RemotingImplementation,Version=1.23.1.0,Culture=neutral,PublicKeyToken=null
# by generator 1.145
# no doc
# no important
from __init__ import *
# no functions
# classes
class PurchaseOrde... | |
<reponame>josephsnyder/VistA-1
#---------------------------------------------------------------------------
# Copyright 2014 The Open Source Electronic Health Record Agent
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | |
: (u'IS', u'1', u'Collimator Left Vertical Edge', False, u'collimator_left_vertical_edge'),
"0025xx35" : (u'IS', u'1', u'Collimator Right Vertical Edge', False, u'collimator_right_vertical_edge'),
"0025xx36" : (u'IS', u'1', u'Collimator Up Horizontal Edge', False, u'collimator_up_horizontal_edge'),
"0025xx37" : (u'I... | |
# Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the follo... | |
<gh_stars>10-100
from datetime import timedelta, datetime
import pytest
from pykusto import Functions as f
from pykusto import column_generator as col, Query
# noinspection PyProtectedMember
from pykusto._src.expressions import _AnyTypeColumn
from test.test_base import TestBase, mock_table as t
class TestExpression... | |
"total")
def uploadedImages(self, total=10):
""" Yield tuples describing files uploaded by this user.
Each tuple is composed of a pywikibot.Page, the timestamp (str in
ISO8601 format), comment (unicode) and a bool for pageid > 0.
Pages returned are not guaranteed to be unique.
@param total: limit result to this ... | |
import os
import torch
import torch.nn as nn
import torch.nn.functional as F
import snip
import numpy as np
# Apply feature pruning methods
def apply_zenprune(args, nets, data_loader):
print('[*] Zen-Prune starts.')
for net in nets:
# net.eval()
net.train()
net.zero_grad()
for layer in net.modules():
snip.add_m... | |
"""chain module.
This module contains information about a depletion chain. A depletion chain is
loaded from an .xml file and all the nuclides are linked together.
"""
from io import StringIO
from itertools import chain
import math
import re
from collections import OrderedDict, defaultdict
from collections.abc import ... | |
#!/usr/bin/env python
import argparse as ap
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors as clr
from hmmlearn.hmm import GaussianHMM
import scipy.stats as scistats
import logging
import pickle
import os, ntpath
import tables
import cooler
from scipy.sparse import csr_matrix, triu, lil_ma... | |
= None
if not fallback and OPTIMIZER != optname:
raise unittest.SkipTest("pyoptsparse is not providing %s" % optname)
return OPT, OPTIMIZER
def format_as_float_or_array(name, values, val_if_none=0.0, flatten=False):
"""
Format array option values.
Checks that the given array values are either None, float, or... | |
<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2021 Cohesity Inc.
import cohesity_management_sdk.models.acropolis_protection_source
import cohesity_management_sdk.models.ad_protection_source
import cohesity_management_sdk.models.aws_protection_source
import cohesity_management_sdk.models.azure_protection_source
impor... | |
**kwargs)
self.set_hue_values(color_kwarg='color', default_color='steelblue')
self.set_scale_values(size_kwarg='s', default_size=5)
self.paint_legend(supports_hue=True, supports_scale=True)
def draw(self):
ax = plot.ax
if len(plot.df.geometry) == 0:
return ax
xs = np.array([p.x for p in plot.df.geometry])
ys... | |
import contextlib
import unittest
from test import support
from itertools import permutations, product
from random import randrange, sample, choice
import warnings
import sys, array, io
from decimal import Decimal
from fractions import Fraction
try:
from _testbuffer import *
except ImportError:
ndarray = None
try:
i... | |
B-Scope (angle-range representation)
Parameters
----------
radar : Radar object
object containing the radar data to plot
field_name : str
name of the radar field to plot
ind_sweep : int
sweep index to plot
prdcfg : dict
dictionary containing the product configuration
fname_list : list of str
list of names ... | |
<gh_stars>1-10
from jnpr.junos import Device
from lxml import etree
import xml.etree.ElementTree
import re
import threading
import paramiko
import time
def make_dict_from_tree(element_tree):
"""Traverse the given XML element tree to convert it into a dictionary.
:param element_tree: An XML element tree
... | |
from functools import partial
from warnings import warn
import numpy as np
from numpy.polynomial.legendre import leggauss
from scipy.special import erf, beta as beta_fn, gammaln
from scipy.linalg import solve_triangular
from numba import njit
from .sys_utilities import hash_array
def sub2ind(sizes, multi_index):... | |
value for *key* if *key* is in the '
'dictionary, else\n'
' *default*. If *default* is not given, it defaults to '
'"None", so\n'
' that this method never raises a "KeyError".\n'
'\n'
' has_key(key)\n'
'\n'
' Test for the presence of *key* in the dictionary. '
'"has_key()"\n'
' is deprecated in favo... | |
import vtk
import numpy as np
from lib.simpleFunctions import simpleObjects as sO
import matplotlib.pyplot as plt
from matplotlib import colors as cl
import os, json
from datetime import datetime as dt
# ---------------------------------------------------------
# Global variables are always bad. However, there
# appe... | |
# -*- coding: utf-8 -*-
from enum import Enum
from lark.lexer import Token
from storyscript.compiler.lowering.Faketree import FakeTree
from storyscript.compiler.lowering.utils import service_to_mutation, \
unicode_escape
from storyscript.parser.Transformer import Transformer
from storyscript.parser.Tree import Tree
... | |
FBC package')
if not objective_id:
objective_id = 'obj_'+'_'.join(reactions)
self.logger.info('Setting objective as '+str(objective_id))
for objective in fbc_plugin.getListOfObjectives():
if objective.getId()==objective_id:
self.logger.warning('The specified objective id ('+str(objective_id)+') already exists')
... | |
<reponame>RandLive/Avito-Demand-Prediction-Challenge<filename>huiqin/keras_cls_vec_v6.py
'''
keras 初始版本
使用词嵌入方式处理输入的文本信息
lb 0.2261
'''
import time
notebookstart = time.time()
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import os
os.environ['TF_CPP_MIN_LOG... | |
self.pos in self.skiprows:
self.pos += 1
line = f.readline()
self.pos += 1
sniffed = csv.Sniffer().sniff(line)
dia.delimiter = sniffed.delimiter
if self.encoding is not None:
self.buf.extend(list(
com.UnicodeReader(StringIO(line),
dialect=dia,
encoding=self.encoding)))
else:
self.buf.extend(list(csv.reader... | |
<reponame>gusbeane/galpy<gh_stars>100-1000
#A 'Binney' quasi-isothermal DF
import warnings
import hashlib
import numpy
from scipy import optimize, interpolate, integrate
from .. import potential
from .. import actionAngle
from ..actionAngle import actionAngleIsochrone
from ..potential import IsochronePotential
from ..p... | |
= getattr(error, "query_job", None)
if query_job is not None:
IPython.get_ipython().push({destination_var: query_job})
else:
# this is the case when previewing table rows by providing just
# table ID to cell magic
print(
"Could not save output to variable '{}'.".format(destination_var),
file=sys.stderr,
)
p... | |
error_msg)
redirect_url = gen_file_get_url(token, file_name)
response = HttpResponse(json.dumps(redirect_url), status=200,
content_type=json_content_type)
response["oid"] = file_id
return response
if op == 'downloadblks':
blklist = []
encrypted = False
enc_version = 0
if file_id != EMPTY_SHA1:
try:
blks =... | |
in enumerate(sequence):
assert i == n.id
assert n.id == (length - 1 if length else 0)
if table_name == "mutations":
# Mutations are not currently sequences, so have no len or idx access
with pytest.raises(TypeError):
len(sequence)
if length != 0:
with pytest.raises(TypeError):
sequence[0]
else:
# Test __len_... | |
type: list
elements: str
track:
description: tracking object
type: int
set:
description: Match source-protocol of route
type: dict
suboptions:
aigp_metric:
description: accumulated metric value
type: dict
suboptions:
value:
description: manual value
type: int
igp_metric:
description: metric value from ... | |
'by', 'this', 'around', 'for', 'of']
days = ['monday', 'tuesday', 'wednesday',
'thursday', 'friday', 'saturday', 'sunday']
months = ['january', 'february', 'march', 'april', 'may', 'june',
'july', 'august', 'september', 'october', 'november',
'december']
monthsShort = ['jan', 'feb', 'mar', 'apr', 'may', 'june', '... | |
<gh_stars>0
# -*- coding: utf-8 -*-
import logging
import calendar
from math import floor
from pyga.entities import Campaign, CustomVariable, Event, Item, Page, Session, SocialInteraction, Transaction, Visitor
import pyga.utils as utils
try:
from urllib import urlencode
from urllib2 import Request as urllib_request
... | |
are successfully collected: FAILED", tid)
@unittest.skipIf(dmverity == 0, "The build does not have dmverity enabled")
def test_REFP_028_Filesystem_Failover(self):
'''Verify that File System Failover process works correctly'''
tid = 'REFP_028'
print('[Test Case ID ]: %s' % tid)
print('[Test Case Name ]: %s' % in... | |
platform_name == 'CPGL336' and node == 'GLIDER' and instrument_class == 'PARAD' and method == 'Telemetered':
uframe_dataset_name = 'CP05MOAS/GL336/05-PARADM000/telemetered/parad_m_glider_instrument'
var_list[0].name = 'time'
var_list[1].name = 'parad_m_par'
var_list[2].name = 'int_ctd_pressure'
var_list[3].na... | |
Settings
returned: always
type: dict
sample: null
contains:
openid_provider_id:
description:
- OAuth authorization server identifier.
returned: always
type: str
sample: null
bearer_token_sending_methods:
description:
- How to send token to the server.
returned: always
type: str
sample: n... | |
<filename>Initial stage/main1.py
# encoding: utf-8
import re
import argparse
import os
import shutil
import socket
import time
import torch
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.nn.parallel
import torch.optim as optim
import torch.utils.data
import torchvision.utils as vutils
from te... | |
3]
color: [B, NUM_POINT, 3]
pc_ins: [B, NUM_GROUP, NUM_POINT_INS, 3], in world coord sys
group_label: [B, NUM_POINT]
group_indicator: [B, NUM_GROUP]
seg_label: [B, NUM_POINT]
bbox_ins: [B, NUM_GROUP, 6]
Returns:
'''
assert mode in ['training', 'inference']
if not config.USE_COLOR:
color = None
if 'SPN' in... | |
TABLE_TYPE IN (0,2,3,6,8,9,10) THEN 'TABLE'
WHEN TABLE_TYPE IN (1,4) THEN 'VIEW'
WHEN TABLE_TYPE IN (5) THEN 'INDEX'
WHEN TABLE_TYPE IN (7) THEN 'MATERIALIZED VIEW'
ELSE NULL END AS OBJECT_TYPE
,CAST(CASE WHEN TABLE_TYPE IN (5) THEN CASE WHEN INDEX_STATUS = 2 THEN 'VALID'
WHEN INDEX_STATUS = 3 THEN 'CHECKING'
WH... | |
# -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import os
import sys
import time
from itertools import product
import numpy as np
from pyomo.core.base import Var, Objective, minimize, Set, Constraint, Expression, Param, Suffix, \
ConstraintList, TransformationFactory, Co... | |
single_offspring=True)
def mutate(self):
super().mutate(self.neat_config.genome_config)
self.atk_mults = mutate_atk_mults(self.atk_mults)
self.age = 0
def clone(self):
child = copy.deepcopy(self)
child.age = 0
return child
def gen_map(self):
#if self.map_arr is not None and self.multi_hot is not None:
# ... | |
intermediate format top_left=x1,y2 and bottom_right=x2,y1 contrary to naming
query_str = "{'and': [], 'or': [], 'query': {'top_left': [0.0, 20.0], 'bottom_right': [20.0, 0.0], 'field': 'index_location', 'index': 'resources_index'}}"
query_obj = eval(query_str)
result1 = self.discovery.query(query_obj, id_only=False)... | |
# Copyright 2016 <NAME>
#
# 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
__all__ = ['APS3']
from .instrument import Instrument, is_valid_ipv4, ... | |
= data['energy']
# get all active neighbors (low to high)
nbrs = [x for x in sorted(self.successors(ni),
key=lambda x: (self.node[x]['energy'], x), reverse=False) if self.node[x]['active']]
if nbrs == []:
break
# lowest neighbor structure and energy
best, been = nbrs[0], self.node[nbrs[0]]['energy']
if bee... | |
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import random
import copy
import uuid
import scipy.stats as stat
from math import log, gamma, exp, factorial, pi, sqrt, erf, atan
from scipy.special import gammainc
from scipy.interpolate import interp1d
import os,sys
def Exponential_rate(t,rat... | |
p->next, i++) {
z[i] = p->data;
}
"""
elif prefix=="fptrunsafe":
sus = "\nint * sus(struct general *x, struct general *y) {\n"
susproto = "\nint * sus(struct general *, struct general *);\n"
foo = "\nint * foo() {\n"
bar = "\nint * bar() {\n"
barbody = foobody = """
struct general *x = malloc(sizeof(struct... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import json
from django.shortcuts import render
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.template.response import TemplateResp... | |
module. Otherwise there's no need for it.
# Python allows "0x", but in reading python-dev it looks like this was
# removed in 2.6/3.0. I don't allow it.
def t_HEX_NUMBER(t):
r"0[xX][0-9a-fA-F]+[lL]?"
t.type = "NUMBER"
value = t.value
if value[-1] in "lL":
value = value[:-1]
f = long
else:
f = int
t.value = ... | |
from opentrons import protocol_api
metadata = {
'protocolName': 'SP3 Protein Cleanup and Digestion',
'author': 'Cody',
'description': 'Digestion protocol with SP3 detergent removal',
'apiLevel': '2.8'
}
def run(protocol: protocol_api.ProtocolContext):
# ---------------------------- CUSTOMIZE HERE ONLY --------... | |
<reponame>oodrive/cinder<filename>cinder/tests/test_huawei_hvs.py
# Copyright (c) 2013 Huawei Technologies Co., Ltd.
# Copyright (c) 2013 OpenStack Foundation
# 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. Yo... | |
from ._util import *
from ._powerCurveConvoluter import *
from ._simulator import *
from reskit.weather.sources import MerraSource, CosmoSource
from reskit.weather.windutil import *
def _batch_simulator(source, landcover, gwa, adjustMethod, roughness, loss, convScale, convBase, lowBase, lowSharp, lctype,
verbose, ex... | |
got_exception = False
try:
_ = iaa.Sometimes(p="foo")
except Exception as exc:
assert "Expected " in str(exc)
got_exception = True
assert got_exception
def test_bad_datatype_for_then_list_fails(self):
got_exception = False
try:
_ = iaa.Sometimes(p=0.2, then_list=False)
except Exception as exc:
assert "Expe... | |
'''
Usage 1: python3 split_and_run.py --dataset [dataset name] --num_split [# of split] --metric [distance measure] --num_leaves [num_leaves] --num_search [num_leaves_to_search] --coarse_training_size [coarse traing sample size] --fine_training_size [fine training sample size] --threshold [threshold] --reorder [reorder... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | |
input data If
"nonnegative", the range is non-negative, regardless of
the input data. Applies only to linear axes.
separatethousands
If "true", even 4-digit integers are separated
showaxeslabels
Sets whether or not this axis is labeled
showbackground
Sets whether or not this axis' wall has a background
color.
... | |
= sources_sc.separation(image_centre).degree
df['dist_from_centre'] = seps
del sources_sc
del seps
return df
def prep_skysrc_df(
images: List[Image],
perc_error: float = 0.,
duplicate_limit: Optional[Angle] = None,
ini_df: bool = False
) -> pd.DataFrame:
'''
Initialise the source dataframe to use in assoc... | |
#!/usr/bin/python2
import sys
import time
#INIT
import os
os.environ['QT_API'] = 'pyqt5'
#/INIT
from PyQt5 import QtGui
from PyQt5.QtCore import pyqtSlot, QTimer, Qt
from PyQt5.QtGui import QColor, QTextCursor
from PyQt5.QtWidgets import QApplication, QMainWindow, QFileDialog, QTreeWidgetItem, QHeaderView
from PyQt5... | |
return
def __repr__(self):
L = ['%s=%r' % (key, value)
for key, value in self.__dict__.items()]
return '%s(%s)' % (self.__class__.__name__, ', '.join(L))
def __eq__(self, other):
return isinstance(other, self.__class__) and self.__dict__ == other.__dict__
def __ne__(self, other):
return not (self == other)
a... | |
max_height=None, tolerance=0.1):
self.heights = heights
self.tolerance = tolerance
self.max_height = (
max_height + tolerance if max_height is not None else sys.float_info.max
)
def _z_coordinate_range(self, vertices):
zc = []
for v in vertices:
zc.append(v.Z)
return max(zc) - min(zc), max(zc)
def vert_fil... | |
II111iiii + O0 / iII111i * ooOoO0o
if 52 - 52: iIii1I11I1II1 / iII111i . O0 * IiII . I1IiiI
def encode ( self ) :
O0ooOo0Oooo = ( LISP_MAP_REPLY << 28 ) | self . record_count
O0ooOo0Oooo |= self . hop_count << 8
if ( self . rloc_probe ) : O0ooOo0Oooo |= 0x08000000
if ( self . echo_nonce_capable ) : O0ooOo0Oooo |=... | |
<reponame>vidkidz/crossbridge<filename>avmplus/build/buildbot/master/custom/buildbot/status/web/baseweb.py<gh_stars>1-10
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
... | |
<reponame>T8T9/paddle_upgrade_tool
from bowler import Query
from bowler.helpers import power_parts, quoted_parts, dotted_parts
from bowler.types import LN, Capture, Filename
from fissix.pytree import Leaf, Node, type_repr
from fissix.fixer_util import Attr, Comma, Dot, LParen, Name, Newline, RParen, KeywordArg, Number... | |
# -*- coding: utf-8 -*-
###############################################################################
###############################################################################
## ##
## _ ___ ___ ___ ___ ___ ##
## | | | __ / \ / __| _ | __| ##
## | |__| __| ( ) | (_ | _|__ \ ##
## |____|___ \___/ \___|_| \___/ ... | |
texture2D(tex, base + 4.0*offset))
+ 0.066341665740259792 * (texture2D(tex, base - 5.0*offset) + texture2D(tex, base + 5.0*offset));
}
vec4 _blur3_r(in sampler2DRect tex, in vec2 base, in vec2 offset) {
return
0.52201146875401894 * texture2DRect(tex, base)
+ 0.23899426562299048 * (texture2DRect(tex, base - offset)... | |
<filename>karmabot/service/slack.py
# Copyright (c) 2019 Target Brands, 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
#
# Unless required... | |
densities relative to somatic densities,
e.g., relative to REFERENCE densities in the table XM13_nacncoop_channels.
and voltage shifts, for different compartments of the specified neuron,
Conductances will be calculated from the Model derived from Xie and Manis 2013 for mouse
------------------------------------------... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
from hangulize import *
class Dutch(Language):
"""For transcribing Dutch."""
__iso639__ = {1: 'nl', 2: 'dut', 3: 'nld'}
__tmp__ = '%,;&'
vowels = 'aeEioOuUyQ'
cs = 'b', 'B', 'c', 'C', 'd', 'D', 'f', 'F', 'g', 'G', 'h', 'j', 'J', \
'k', 'K', 'l', 'm', 'n', 'N', 'p', 'P', ... | |
<reponame>bio-hpc/metascreener<gh_stars>1-10
## Automatically adapted for numpy.oldnumeric Jul 23, 2007 by
#############################################################################
#
# Author: <NAME>
#
# Copyright: <NAME> TSRI 2000
#
#############################################################################
#... | |
Parameters:
_Bf: void const *
_BfL: int const &
__init__(TMIn self, TSIn SIn) -> TMIn
Parameters:
SIn: TSIn &
__init__(TMIn self, char const * CStr) -> TMIn
Parameters:
CStr: char const *
__init__(TMIn self, TStr Str) -> TMIn
Parameters:
Str: TStr const &
__init__(TMIn self, TChA ChA) -> TMIn
Param... | |
[1, 2],
{3: 4},
msgspec.msgpack.Ext(1, b"12345"),
msgspec.msgpack.Ext(1, b""),
],
)
def test_struct_ignore_extra_fields(self, extra):
enc = msgspec.msgpack.Encoder()
dec = msgspec.msgpack.Decoder(Person)
a = enc.encode(
{
"extra1": extra,
"first": "harry",
"extra2": extra,
"last": "potter",
"age": 13,
... | |
= S2D0_DAC[5:0]
self.add((
pr.RemoteVariable(name='PLL_RO_filter2', description='Config15', offset=0x0000100F*addrSize, bitSize=3, bitOffset=2, base=pr.UInt, mode='RW'),
pr.RemoteVariable(name='PLL_RO_divider', description='Config15', offset=0x0000100F*addrSize, bitSize=3, bitOffset=5, base=pr.UInt, mode='RW')))
#... | |
#------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | |
import tensorflow as tf
from tensorflow.keras.layers import *
import tensorflow.keras.backend as K
from tensorflow.keras.utils import multi_gpu_model
from .blocks import *
# from .loss_Function import *
import models.loss_function as loss_function
from .metrics import *
from util import convert_tf_optimizer
import copy... | |
if oute.oute == 0:
depth1.append(moves)
if re.match(r'\+r|r', Wboard.w9c)and Wboard.w6c==''\
and board.s8c+board.s7c=='':
moves = '9c6c'
kaihimore(moves)
if oute.oute == 0:
depth1.append(moves)
if re.match(r'\+r|r', Wboard.w9c)and Wboard.w5c==''\
and board.s8c+board.s7c+board.s6c=='':
moves = '9c5c'
kaihimor... | |
<filename>pyscripts/watsonbeat_promo_06_01_2017.py
import os
import sys
import math
import random
import collections
user = "Richard"
startScript = True
#importDirectory = "/Users/" + user + "/Repo/wbRLRBM/src/"
Kontakt5 = "Kontakt 5 (Native Instruments GmbH) (8 out)"
Kontakt5_16 = "Kontakt 5 (Native Instruments... | |
# Generated by h2py from COMMCTRL.H
WM_USER = 1024
ICC_LISTVIEW_CLASSES = 1 # listview, header
ICC_TREEVIEW_CLASSES = 2 # treeview, tooltips
ICC_BAR_CLASSES = 4 # toolbar, statusbar, trackbar, tooltips
ICC_TAB_CLASSES = 8 # tab, tooltips
ICC_UPDOWN_CLASS = 16 # updown
ICC_PROGRESS_CLASS = 32 # progress
ICC_HOTKEY_CLASS... | |
7), 5754)
def test_normalize_filename(self):
names = set(chess.syzygy.filenames())
for name in names:
self.assertTrue(
chess.syzygy.normalize_filename(name) in names,
"Already normalized {0}".format(name))
w, b = name.split("v", 1)
swapped = b + "v" + w
self.assertTrue(
chess.syzygy.normalize_filename(swapp... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
The polymake backend for polyhedral computations
.. NOTE::
This backend requires polymake.
To install it, type :code:`sage -i polymake` in the terminal.
AUTHORS:
- <NAME> (2017-03): initial version
"""
#******************************************************************... | |
#!/usr/bin/python3
import argparse
import subprocess
import requests
import sys
import time
import yaml
import pytoml as toml
from jose import jwt
from urllib.parse import urlparse
from zeroos.orchestrator.sal.Node import Node
from zerotier import client as ztclient
class ZerotierAuthorizer:
def __init__(self, token)... | |
"""
Provides a default QA configuration for the projects, by reading the configuration file and the environment variables.
"""
import os
import sys
import datetime
from getpass import getuser
from pathlib import Path, PurePosixPath
from typing import Dict, Any, Tuple, List, Optional, Union
import yaml
import click
fr... | |
Required. An array of upstream node references within the topology to be used as
inputs for this node.
:type inputs: list[~video_analyzer.models.NodeInput]
"""
_validation = {
'type': {'required': True},
'name': {'required': True},
'inputs': {'required': True},
}
_attribute_map = {
'type': {'key': '@type', ... | |
# -*- coding:utf8 -*-
"""
pipetask负责循环体调度:
起始作业
while循环:
下一个node直到结束
"""
from db.typing import PipeTaskInfo, PipeLineInfo, PipeNodeInfo
from utils.log import get_logger
from utils.utils import PipeTaskStatus, new_id
from pipeline.pipeline import PipeLine
logger = get_logger(__name__)
class PipeTask(object):
"""... | |
<filename>choir/evaluation/fast_eval_api.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import copy
import numpy as np
import time
import datetime
import pycocotools.mask as mask_utils
from collections import defaultdict
from pycocotools.cocoeval import COCOeval
from choir import _C
from lvis... | |
<filename>evok/neuron.py<gh_stars>0
'''
Neuron primitive devices (DI, DO, AI, AO)
------------------------------------------
'''
import struct
import time
import datetime
#import atexit
from math import isnan, floor
from tornado import gen
from tornado.ioloop import IOLoop
from modbusclient_tornado import ModbusCli... | |
from zcrmsdk.src.com.zoho.crm.api.currencies import *
from zcrmsdk.src.com.zoho.crm.api.currencies import Currency as ZCRMCurrency
from zcrmsdk.src.com.zoho.crm.api.util import Choice
class Currency(object):
@staticmethod
def get_currencies():
"""
This method is used to get all the available currencies in your ... | |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 8 15:45:21 2021
@author: Liam
"""
import aiosqlite
import discord
from datetime import datetime
import sqlite3
import math
from init import sourceDb, guild_ids
from database import Utilisateur, Quiz, Instance, Reponse, Statistiques
from discord_slash import cog_ext
from ... | |
<reponame>jrood-nrel/percept
import sys
sys.path.insert(0,"../build/build.dir/packages/PyTrilinos/src/stk/PyPercept")
from math import *
from numpy import *
import unittest
import time
import print_table
from PerceptMesh import *
class StringFunctionUnitTests(unittest.TestCase):
def setUp(self):
self.testpoints... | |
# -*- coding: utf-8 -*-
"""
ENERPI - CLI methods & argument parser
"""
import datetime as dt
import os
import re
import sys
from enerpi import PRETTY_NAME, DESCRIPTION, __version__
from enerpi.base import (IMG_TILES_BASEPATH, DATA_PATH, CONFIG, SENSORS, CONFIG_FILENAME, SENSORS_CONFIG_JSON_FILENAME,
FILE_LOGGING, LOG... | |
``nest_spec``.
Returns:
nested Distribution or Tensor:
"""
def _to_dist(spec, params):
if isinstance(spec, DistributionSpec):
return spec.build_distribution(params)
elif isinstance(spec, TensorSpec):
return params
else:
raise ValueError(
"Only DistributionSpec or TensorSpec is allowed "
"in nest_spec, got ... | |
<reponame>interaction-lab/HARMONI<filename>harmoni_core/harmoni_pattern/nodes/sequential_pattern.py
#!/usr/bin/env python3
# Common Imports
import rospy
import roslib
from harmoni_common_lib.constants import State
from harmoni_common_lib.service_server import HarmoniServiceServer
from harmoni_common_lib.service_manag... | |
SPECIFIC SUBCLASSES? AND REFERENCE THOSE HERE
FIX: EXAMPLE OF FULL SPECIFIATION (BY PORT AND PORT'S FUCNTION'S PARAMETER NAME)
The following example uses a parameter's name to specify
>>> my_mech = ProcessingMechanism(function=Logistic)
>>> ctl_mech = ControlMechanism(monitor_for_control=my_mech,
... control_signals... | |
if not isinstance(image, Image):
raise TypeError('Need to pass a list of Image objects')
file_params['images[%i]' % counter] = (image.collection_filepath, image.data)
counter += 1
return self._request('extract_image_colors', params, file_params, **kwargs)
def extract_image_colors_url(
self, urls, ignore_backgro... | |
<reponame>JayjeetAtGithub/coffea
from ..util import awkward
from ..util import numpy as np
import os
import sys
import warnings
try:
import cStringIO as io
except ImportError:
import io
# for later
# func = numbaize(formula,['p%i'%i for i in range(nParms)]+[varnames[i] for i in range(nEvalVars)])
def _parse_jme_f... | |
or point",
},
"OT": {
"code": "OT",
"type": "Late To Close",
"description": "System was not armed on time",
"concerns": "User number",
},
"OU": {
"code": "OU",
"type": "Output State – Trouble",
"description": "An output on a peripheral device or NAC is not functioning",
"concerns": "Output number",
},
"OV... | |
import base64
import json
from time import sleep
import requests
import shutil
from unittest.mock import patch
from django.core import mail
from django.test import SimpleTestCase
from rest_framework.reverse import reverse
from rest_framework.test import APIClient
from config.settings.base import (OSF_UPLOAD_TEST_US... | |
ctypes.cast(ctypes.addressof(transfer_value), ctypes.POINTER(self.ctype))
elif not supported_scalar(type(item)) and not isinstance(item, types.MethodType):
# struct, has to be the last check because everything is an
# object in Python
item = wrapValue(item).transfer_value
setattr(transfer_value, name, item)
def ... | |
<reponame>JBlaschke/lcls2<gh_stars>0
"""
Smalldata (v2)
Parallel data analysis with MPI send/recv
Analysis consists of two different process types:
1. clients
> these perform per-event analysis
> are associted with one specific server
> after processing `batch_size` events, send a
dict of data over to their serv... | |
<filename>abs_templates_ec/serdes/rxpassive.py
# -*- coding: utf-8 -*-
from typing import Dict, Any, Set
from bag.layout.template import TemplateBase, TemplateDB
from bag.layout.routing import TrackID, WireArray
from bag.layout.util import BBox
from ..resistor.core import ResArrayBase
from ..analog_core import Analo... | |
<reponame>stovecat/DataOptimization<filename>pair_influence.py<gh_stars>1-10
import random
import pickle
import math
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
#from tqdm.notebook import tqdm
from tqdm import tqdm
import scipy
import sklearn
sns.set(color_codes=True)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.