input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
time):
return len([1 for elem in self._infections_dict.values() if elem.get(CONTRACTION_TIME, np.inf) <= time])
def mean_day_increase_until(self, time):
mean_increase = 0.0
i = 0
for k, v in self._per_day_increases.items():
if k <= time:
mean_increase = (mean_increase * i + v) / (i + 1)
return mean_increase
... | |
commandName):
'''
Return the source legend of an @button/@command node.
'G' leoSettings.leo
'M' myLeoSettings.leo
'L' local .leo File
' ' not an @command or @button node
'''
c = ga.c
if commandName.startswith('@'):
d = c.commandsDict
func = d.get(commandName)
if hasattr(func, 'source_c'):
c2 = func.source_... | |
################################################################################
#
# Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors
#
# This file is a part of the MadGraph5_aMC@NLO project, an application which
# automatically generates Feynman diagrams and matrix elements for arbitrary
# h... | |
#!/usr/bin/env python
from __future__ import division
"""@package etddf
ROS interface script for delta tiering filter
Filter operates in ENU
"""
from etddf.delta_tier import DeltaTier
import rospy
import threading
from minau.msg import ControlStatus
from etddf.msg import Measurement, MeasurementPackage, NetworkEsti... | |
with PSF.
Returns
-------
image : SyntheticImage
'''
stage = 'SyntheticImage: convolve_PSF'
# debugging comments
if isinstance(psf, GaussianPSF):
logger.debug('-' * 70)
logger.debug(stage + 'with GaussianPSF')
logger.debug('-' * 70)
# convolve val with classes GaussianPSF, FilePSF and FunctionPSF
va... | |
# -*- coding: utf-8 -*-
"""
Basic Arithmetic
The functions here are the basic arithmetic operations that you might find on a calculator.
"""
from mathics.version import __version__ # noqa used in loading to check consistency.
import sympy
import mpmath
from mathics.builtin.arithmetic import _MPMathFunction, create... | |
import torch
import logging
from transformers import BertModel, BertTokenizer
from transformers import *
from typing import List
from itertools import chain
import argparse
import torch
import torch.autograd as autograd
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import json
from t... | |
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | |
if inputClass in ("File", "Directory"): # input files
inputDestDir = workflowInputs_destdir
globExplode = None
path_tokens = linearKey.split('.')
# Filling in the defaults
assert len(path_tokens) >= 1
if len(path_tokens) >= 1:
pretty_relname = path_tokens[-1]
if len(path_tokens) > 1:
relative_dir = os.path.jo... | |
``Seek`` can be done. Defaults to 7 days. Cannot be more than 7
days or less than 10 minutes. ALPHA: This feature is part of an alpha
release. This API might be changed in backward-incompatible ways and is
not recommended for production use. It is not subject to any SLA or
deprecation policy.
If a dict is provide... | |
0.9714
Epoch 457/1000
15/15 [==============================] - 0s 3ms/step - loss: 0.0868 - accuracy: 0.9626
Epoch 458/1000
15/15 [==============================] - 0s 3ms/step - loss: 0.0851 - accuracy: 0.9692
Epoch 459/1000
15/15 [==============================] - 0s 3ms/step - loss: 0.0797 - accuracy: 0.9626
Epoch 4... | |
<reponame>Climate-Crisis-AI-Team-Vel-Ice/sea-ice-dataviz<filename>ml_pipeline/refine.py<gh_stars>0
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.model_selection import KFold
from sklearn import metrics
from sklearn import linear_model
import sklearn
from sklearn.preproces... | |
: The association or disassociation succeeded.
* ``FAILED`` : The association or disassociation failed.
* ``IN_PROGRESS`` : The association or disassociation is still in progress.
- **EngineAttributes** *(list) --*
Attributes specific to the node association. In Puppet, the attibute PUPPET_NODE_CERT contains th... | |
+= '\t' + head
toPrint += '\t'+'taxonomy'+'\r'
for taxa in taxaTableFilt:
toPrint += taxa
for val in taxaTableFilt[taxa][0]:
toPrint += '\t' + str(val)
toPrint += '\t' + taxaIDs[taxa]
toPrint += '\r'
OTUtabletoPrint.write(toPrint)
OTUtabletoPrint.close()
os.system('biom convert -i OTUTableText... | |
<gh_stars>10-100
del_items(0x8012BFF0)
SetType(0x8012BFF0, "int NumOfMonsterListLevels")
del_items(0x800A9014)
SetType(0x800A9014, "struct MonstLevel AllLevels[16]")
del_items(0x8012BCD4)
SetType(0x8012BCD4, "unsigned char NumsLEV1M1A[4]")
del_items(0x8012BCD8)
SetType(0x8012BCD8, "unsigned char NumsLEV1M1B[4]")
del_it... | |
right):
from discopy.quantum.gates import CX, H, sqrt, Bra, Match
def cup_factory(left, right):
if left == right == qubit:
return CX >> H @ sqrt(2) @ Id(1) >> Bra(0, 0)
if left == right == bit:
return Match() >> Discard(bit)
raise ValueError
return rigid.cups(
left, right, ar_factory=Circuit, cup_factory=cup_... | |
# Copyright 2016 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 l... | |
t in relation:
basic_tag.append(relation[t][0])
ratio *= relation[t][1]
else:
basic_tag.append(t)
basic_tag = tuple(basic_tag)
# compute identical factor ratio compare to a fully diffent decay
#that we have assume for the basic tag
if len(set(tag)) != len(tag):
for t in set(tag):
ratio /= math.factorial(ta... | |
#!/usr/bin/env python
"""
Electronic structure solver.
Type:
$ ./schroedinger.py
for usage and help.
"""
import os
import os.path as op
from optparse import OptionParser
from math import pi
from scipy.optimize import broyden3
try:
from scipy.optimize import bisect
except ImportError:
from scipy.optimize import b... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""Creates oemof energy system components.
Functions for the creation of oemof energy system objects from a
given set of object parameters.
---
Contributors:
- <NAME> - <EMAIL>
- <NAME> - <EMAIL>
"""
from oemof import solph
import logging
import os
import pandas as pd
from feedinl... | |
"""
Get the is_deleted status and info for the container.
:returns: a tuple, in the form (info, is_deleted) info is a dict as
returned by get_info and is_deleted is a boolean.
"""
if self.db_file != ':memory:' and not os.path.exists(self.db_file):
return {}, True
info = self.get_info()
return info, self._is_de... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest2 as unittest
import json
import datetime as dt
import uuid
import warnings
from nose.tools import * # PEP8 asserts
import pytz
from marshmallow import Serializer, fields, validate, pprint, utils
from marshmallow.exceptions import MarshallingError
from mar... | |
<reponame>YeLyuUT/FastVOD
import random
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision.models as models
import numpy as np
from model.faster_rcnn.resnet import resnet
from model.utils.config import cfg
from model.roi_pooling.modules.roi_pool import _RoIPooling
from model.roi_crop.... | |
to False.
Returns:
list: The lines declaring the variable.
"""
if isinstance(var, str): # pragma: no cover
var = {'name': var}
type_name = cls.get_native_type(**var)
out = [cls.format_function_param('declare',
type_name=type_name,
variable=cls.get_name_declare(var))]
if is_argument:
return out
if definiti... | |
col("R_endOffset")) &
(~((col("L.annotSet") == col("R_annotSet")) &
(col("L.annotType") == col("R_annotType")) &
(col("L.startOffset") == col("R_startOffset")) &
(col("L.endOffset") == col("R_endOffset"))))),"leftouter") \
.filter(col("R_docId").isNull()) \
.select("L.*")
else:
results = left.alias("L").join(... | |
= "n"
global hold_blocker
hold_blocker = 0
score = 0
goal = 5
level = 1
scr.set(str(score))
gl.set(str(goal))
lvl.set(str(level))
delay = base_delay
spawn()
else:
cnt += 1
if nextup == 1:
nextup_t()
elif nextup == 2:
nextup_o()
elif nextup == 3:
nextup_i()
elif nex... | |
#!/usr/bin/env python
import os
import json
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
from scipy.stats import norm
from itertools import product
import anndata
import numpy as np
import pandas as pd
import scanpy as sc
from scipy.sparse import issparse
from sklearn.metrics import calinski_har... | |
self._entity_data:
return self._entity_data.get('damage')
return "0"
@property
def LightningStart(self):
if "LightningStart" in self._entity_data:
return self._entity_data.get('LightningStart')
return ""
@property
def LightningEnd(self):
if "LightningEnd" in self._entity_data:
return self._entity_data.get(... | |
<reponame>atruszkowska/NR-population-revac
# ------------------------------------------------------------------
#
# Module for generation of households in an ABM population
#
# ------------------------------------------------------------------
import math, copy
import random, warnings
# import abm_utils as... | |
from functools import partial
import inspect
import math
from numpy.testing import assert_allclose
import onnx
import os
import pytest
import tempfile
import torch
import torch.nn.functional as F
from onnxruntime import set_seed
from onnxruntime.capi.ort_trainer import IODescription as Legacy_IODescription,\
ModelDes... | |
# Copyright (c) 2017 Shotgun Software Inc.
#
# CONFIDENTIAL AND PROPRIETARY
#
# This work is provided "AS IS" and subject to the Shotgun Pipeline Toolkit
# Source Code License included in this distribution package. See LICENSE.
# By accessing, using, copying or modifying this work you indicate your
# agreement to t... | |
<filename>terminis/terminis.py
# -*- coding: utf-8 -*-
import sys
try:
import curses
except ImportError:
sys.exit(
"""This program requires curses.
You can install it on Windows with:
pip install --user windows-curses"""
)
else:
curses.COLOR_ORANGE = curses.COLOR_WHITE
import random
import sched
import time
imp... | |
[x2Prime, x2PrimeRequest, x2PrimeLoad, x2PrimeTimeWasted, x2PrimeTime, x2PrimeReward, x2PrimeCost,
x2FinalReward, x2FinalCost, x2PrimePartiallyServed, x2PrimeServedRequests,
x2PartiallyServedRequestsAllVehicles, x2ServedRequestsAll, isItPossible] = \
updateAllRoutes(x2Prime, x2PrimeRequest, xPrimeTime, tMatrix, allR... | |
authentication_type: Authentication type.
:type authentication_type: str
:param network_isolation: Optional resource information to enable network isolation for
request.
:type network_isolation: ~azure.mgmt.sql.models.NetworkIsolationSettings
"""
_validation = {
'storage_key_type': {'required': True},
'storage... | |
axis=2)
epsilon = 1e-3
m_pred_used = tf.log(m_pred_used + epsilon)
m_total = tf.log(m_total + epsilon)
m_loss = tf.nn.l2_loss(m_total - m_pred_used)
q_loss = tf.nn.l2_loss(
(q_total - q_pred_used) * tf.reduce_sum(q_gates, axis=2))
q_loss /= tf.to_float(batch * length_q)
m_loss /= tf.to_float(batch * length_kv)... | |
k_v, d_v, c_v):
locdata()
elif operation == 'entangle':
if self.entangleaction(time_stamp, periods, k_v, d_v, c_v):
locdata()
elif operation == 'entangle_and_cross_up':
if self.crossup_entangle_action(time_stamp, periods, k_v, d_v, c_v):
locdata()
elif operation == 'entangle_and_cross_up_within_period':
if sel... | |
entities_recognition_tasks=[EntitiesRecognitionTask(model_version="bad")],
# at this moment this should cause all documents to be errors, which isn't correct behavior but I'm using it here to test document ordering with errors. :)
key_phrase_extraction_tasks=[KeyPhraseExtractionTask()],
pii_entities_recognition_task... | |
#BEGIN_HEADER
import os
import sys
import traceback
import argparse
import json
import logging
import time
from pprint import pprint
import string
import subprocess
from os import environ
from ConfigParser import ConfigParser
import re
from collections import OrderedDict
import uuid
from string import Template
# 3rd p... | |
role %(linkrole)s to concept %(conceptTo)s and to concept %(conceptTo2)s"),
modelObject=(rel, orderRels[order]), conceptFrom=relFrom.qname, order=rel.arcElement.get("order"), linkrole=rel.linkrole, linkroleDefinition=modelXbrl.roleTypeDefinition(rel.linkrole),
conceptTo=rel.toModelObject.qname, conceptTo2=orderRels[o... | |
new_bbox:
transform.bounding_box = self.bounding_box
else:
axes_ind = self._get_axes_indices()
if transform.n_inputs > 1:
transform.bounding_box = [self.bounding_box[ind] for ind in axes_ind][::-1]
else:
transform.bounding_box = self.bounding_box
result = transform(*args, **kwargs)
if with_units:
if self.ou... | |
try:
scale = curve.ref_curve.scale
self._p("Using previous scale=%s" % scale, level=2)
except AttributeError:
# crude estimate that should be OK but not optimal
def _crude_scale_estimate(curve):
if callable(curve):
scale = 0.25 * (curve(0)[1]-curve(np.pi)[1])
else:
if isinstance(curve, (list, tuple)):
scale =... | |
"""Please Not Another Compiler Compiler -- LR parser generator library.
"""
from collections import namedtuple
from operator import methodcaller
from functools import partial
import sys
import re
_str_type = globals().get("basestring", str)
def identity(x):
"""Identity functions, useful as semantic action for rules... | |
#imports--------------------------------------------------------------------------------------------------------------------
import os
import glob
import sys
#import wget
import time
import subprocess
import shlex
import sys
import warnings
import random
import pickle
from Bio.SeqUtils import seq1
from Bio.PDB.PDBPars... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import argparse
import sys
import subprocess
import os
import urllib
from zipfile import ZipFile
from shutil import rmtree
import urlparse
spark_versions = \
{
"2.2.0": {"hadoop_versions": ["2.6", "2.7"]},
"2.1.0": {"hadoop_vers... | |
"""The code editor of GraphDonkey, with a few features:
- Syntax Highlighting
- Error Highlighting
- Line Numbers
Based on https://stackoverflow.com/questions/2443358/how-to-add-lines-numbers-to-qtextedit
- Selection/Line Events (Duplicate, Copy, Cut, Comment/Uncomment, Auto-Indent, Indent/Unindent...)
- Parenthesis ... | |
<reponame>milesluigi/ipv6gaw<gh_stars>0
#!/usr/bin/env python3
# -*- coding: utf-8 -*
"""
IPv6 Global Address Watcher. This is a script that keeps global IPv6 addresses consistent. The circumstances for
using this script are:
A) The system has interface(s) that will only have a single global IPv6 prefix.
B) The system... | |
<filename>scripts/maya/nwFenixCommitter/unit_tests/test_Controller.py
# -*- coding: utf-8 -*-
"""Unit tests for the Fenix Committer."""
from nwave.effects.tools.nwFXTDTools.PipelineHelper import PipelineHelper
import zefir
from zefir.settings import get_setting_value
from fenix4maya.settings import MOTION_BLUR_SAMPLE... | |
<reponame>mzymzy/dgl
"""This file contains NodeFlow samplers."""
import sys
import numpy as np
import threading
from numbers import Integral
import traceback
from ..._ffi.function import _init_api
from ..._ffi.object import register_object, ObjectBase
from ..._ffi.ndarray import empty
from ... import utils
from ...no... | |
)
return display_config
def get(self, request, *args, **kwargs):
from samplesheets.plugins import get_irods_content
timeline = get_backend_api('timeline_backend')
irods_backend = get_backend_api('omics_irods', conn=False)
study = Study.objects.filter(sodar_uuid=self.kwargs['study']).first()
if not study:
ret... | |
<filename>lettuce/moments.py
"""
Moments and cumulants of the distribution function.
"""
import warnings
import torch
import lettuce
from lettuce.util import LettuceException, InefficientCodeWarning, get_subclasses, ExperimentalWarning
from lettuce.stencils import Stencil, D1Q3, D2Q9, D3Q27
import numpy as np
__all__... | |
RequestContext, ops_metadata_arn: OpsMetadataArn
) -> DeleteOpsMetadataResult:
raise NotImplementedError
@handler("DeleteParameter")
def delete_parameter(
self, context: RequestContext, name: PSParameterName
) -> DeleteParameterResult:
raise NotImplementedError
@handler("DeleteParameters")
def delete_paramet... | |
group into
the right (fundamental group) factor in "WF" style.
EXAMPLES::
sage: E = ExtendedAffineWeylGroup(['E',6,1],print_tuple=True); WF = E.WF(); F = E.fundamental_group()
sage: [(x,WF.from_fundamental(x)) for x in F]
[(pi[0], (1, pi[0])), (pi[1], (1, pi[1])), (pi[6], (1, pi[6]))]
"""
return self((self.car... | |
# Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
"""
This provides a small set of effect handlers in NumPyro that are modeled
after Pyro's `poutine <http://docs.pyro.ai/en/stable/poutine.html>`_ module.
For a tutorial on effect handlers more generally, readers are encouraged to
read ... | |
<reponame>desmoteo/swiss-army-keras
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.eager import def_function
from tensorflow.python.framework import ops
from tensorflow.python.keras import backend_config
from tensorflow.python.keras.o... | |
pair (tuple) of
(connection, read) timeouts.
:return: Returns the result object.
If the method is called asynchronously,
returns the request thread.
:rtype: V1Agent
"""
kwargs['_return_http_data_only'] = True
return self.update_agent_with_http_info(owner, agent_uuid, body, **kwargs) # noqa: E501
def update_ag... | |
import numpy as np
import scipy as sc
import scipy.fftpack
from collections import deque
import CustomPrincetonSPE_v2 as SPE
import matplotlib as mp
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from itertools import islice, tee
from numba import jit
import datetime as dt
import tim... | |
<reponame>gtca/mofax
from .core import mofa_model
from .utils import *
import sys
from warnings import warn
from typing import Union, Optional, List, Iterable, Sequence
from functools import partial
import numpy as np
from scipy.stats import pearsonr
import pandas as pd
from pandas.api.types import is_numeric_dtype
i... | |
# This file is part of GridCal.
#
# GridCal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GridCal is distributed in the hope that... | |
that are being learned
# for which learning_enabled == True or ONLINE (i.e., not False or AFTER)
# Implementation Note: RecurrentTransferMechanisms are special cased as the
# AutoAssociativeMechanism should be handling learning - not the RTM itself.
if self._is_learning(context) and not isinstance(node, RecurrentTr... | |
<filename>LC709203F.py<gh_stars>0
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""LC709203F: Smart LiB Gauge Battery Fuel Gauge LSI For 1‐Cell Lithium‐ion/Polymer (Li+)"""
__author__ = "ChISL"
__copyright__ = "TBD"
__credits__ = ["ON Semiconductor"]
__license__ = "TBD"
__version__ = "0.1"
__maintainer__ = "https://c... | |
"""
Prepare data for Part-GPNN model.
Need:
Node feature at different scales
Edge feature for valid edges
Adjacency matrix GT (parse graph GT)
Edge weight (corresponds to node level)
Edge label GT
"""
import json
import os
import pickle
import warnings
from collections import defaultdict
import matplotlib.pyplot as... | |
<gh_stars>1-10
#!/usr/bin/env python
# Copyright 2018 Division of Medical Image Computing, German Cancer Research Center (DKFZ).
#
# 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... | |
import logging
from amuse.community import *
from amuse.test.amusetest import TestWithMPI
from omuse.community.dales.interface import Dales
from omuse.units import units
# kwargs = {}
kwargs = dict(channel_type="sockets", redirection="none")
# kwargs=dict(redirection="none",debugger="gdb")
logging.basicConfig(level=... | |
<filename>utils/hct/hctdb_instrhelp.py<gh_stars>0
# Copyright (C) Microsoft Corporation. All rights reserved.
# This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details.
import argparse
import functools
import collections
from hctdb import *
# get db singletons
g_db_dx... | |
makes sense to implement a
gradient solver. The question is: how do I make this fast with arbitrary
equations. Maybe start with a product version like linsolve and go from there
"""
pass
def solve(self):
"""
"""
pass
# XXX make a version of linproductsolver that taylor expands in e^{a+bi} form
# see https://... | |
rew_mean, rew_range, rew_std, rew_mean_new, rew_range_new, rew_std_new
def _add_trajs_to_new_trajs_list_memory_RW(self, produced_trajs):
"""
only replaces the worst trajectories
trajectories stored on ram
RW --> stands for Replce worst
"""
# poduced_trajs = myutils.produce_trajs_from_policy(self.actor_critic, s... | |
the end containing the metadata.
"""
with Tiff2Jp2k(
self.astronaut_ycbcr_jpeg_tif, self.temp_jp2_filename
) as j:
j.run()
j = Jp2k(self.temp_jp2_filename)
actual = j[:]
self.assertEqual(actual.shape, (512, 512, 3))
c = j.get_codestream(header_only=False)
actual = c.segment[2].code_block_size
expected = ... | |
(output wpkh only, input tx1-3)
txid = tx.txid
txin_list = []
txin_utxo_list = []
txin_list.append(TxIn(txid=txid, vout=0))
desc = f'raw({str(tr_addr.locking_script)})'
txin_utxo_list.append(UtxoData(
txid=txid, vout=0, amount=txouts[0].amount, descriptor=desc))
txouts2 = [
TxOut(100000000, str(test_obj.addr_d... | |
nan, 10, 10, nan, 0.00, nan ],
[ nan, 20, 20, nan, 0.00, nan ],
[ nan, 30, 30, nan, 0.00, nan ],
[ nan, 40, 40, nan, 0.00, nan ],
[ nan, 50, 50, nan, 0.00, nan ],
[ nan, 60, 60, nan, 0.00, nan ],
[ nan, 70, 70, nan, 0.00, nan ],
[ nan, 80, 80, nan, 0.00, nan ],
[ nan, 90, 90, nan, 0.00, nan ],
[ nan, 100, 100,... | |
<reponame>leonhard-s/auraxium
"""Base classes for the Auraxium object model.
These classes define shared functionality required by all object
representations of API data, and defines the basic class hierarchy used
throughout the PlanetSide 2 object model.
"""
import abc
import logging
from typing import Any, ClassVar... | |
return node
single_param_func_type = PyrexTypes.CFuncType(
PyrexTypes.c_returncode_type, [
PyrexTypes.CFuncTypeArg("obj", PyrexTypes.py_object_type, None),
],
exception_value = "-1")
def _handle_simple_method_list_sort(self, node, function, args, is_unbound_method):
"""Call PyList_Sort() instead of the 0-argum... | |
"""Close connection to a currently connected snes"""
self.ctx.snes_reconnect_address = None
if self.ctx.snes_socket is not None and not self.ctx.snes_socket.closed:
asyncio.create_task(self.ctx.snes_socket.close())
return True
else:
return False
def _cmd_connect(self, address: str = "") -> bool:
"""Connect to ... | |
<gh_stars>0
#
# Copyright (c), 2018-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author <NAME> <<EMA... | |
Sets the tags of this IaasUcsdInfo.
The array of tags, which allow to add key, value meta-data to managed objects.
:param tags: The tags of this IaasUcsdInfo.
:type: list[MoTag]
"""
self._tags = tags
@property
def version_context(self):
"""
Gets the version_context of this IaasUcsdInfo.
The versioning info... | |
import collections
import itertools
from . import raw_ast, common, objects
def _astclass(name, fields):
# type is set to None for statements
return collections.namedtuple(name, ['location', 'type'] + fields)
StrConstant = _astclass('StrConstant', ['python_string'])
StrJoin = _astclass('StrJoin', ['parts']) # the... | |
state as new_state:
new_state.constrain(expression == new_value)
# and set the PC of the new state to the concrete pc-dest
# (or other register or memory address to concrete)
setstate(new_state, new_value)
# enqueue new_state, assign new state id
new_state_id = self._put_state(new_state)
# maintain a list of ... | |
<gh_stars>1-10
import gc
import os
import math
import random
import warnings
import albumentations as A
import cv2
import numpy as np
import pandas as pd
import timm
import torch
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional as F
import torch.utils.data as torchdata
from pathlib import ... | |
or b_on_gpu:
gpu_sm = GpuSoftmaxWithBias()(gpu_from_host(x), gpu_from_host(b))
return [host_from_gpu(gpu_sm)]
return False
#### Convolution, maxpooling
from theano.tensor.nnet import conv
@register_opt()
@local_optimizer([])
def local_gpu_conv(node):
"""
gpu_from_host(conv) -> gpu_conv(gpu_from_host)
conv(host_... | |
def_num=61,
scale=1000,
units='m/s',
),
62: Field(
name='max_pos_vertical_speed',
type=BASE_TYPES[0x83], # sint16
def_num=62,
scale=1000,
units='m/s',
),
63: Field(
name='max_neg_vertical_speed',
type=BASE_TYPES[0x83], # sint16
def_num=63,
scale=1000,
units='m/s',
),
64: Field(
name='min_heart_rate',... | |
import collections
import datetime
import decimal
import json
import time
import unittest
import uuid
from unittest import TestCase
from unittest.util import safe_repr
import dateutil.parser
import django.test
import django.urls
import django.utils.timezone
import mock
import rest_framework.test
# noinspection PyUnres... | |
ax.grid(True, axis="x")
if y_grid:
ax.grid(True, axis="y")
self._add_axis_labels(ax)
if "hue" in self.variables and legend:
# TODO if possible, I would like to move the contour
# intensity information into the legend too and label the
# iso proportions rather than the raw density values
artist_kws = {}
art... | |
<filename>gmso/tests/test_forcefield.py
import lxml
import pytest
import unyt as u
from lxml.etree import DocumentInvalid
from sympy import sympify
from gmso.core.forcefield import ForceField
from gmso.exceptions import (
ForceFieldParseError,
MissingAtomTypesError,
MissingPotentialError,
)
from gmso.tests.base_tes... | |
None,
env_variables: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
handlers: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['StandardAppVersionHandlerArgs']]]]] = None,
inbound_services: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
instance_class: Optional[pulumi.Input... | |
on success
type: str
sample: OL7_X86_64_STANDARD_10
build_spec_file:
description:
- The path to the build specification file for this Environment. The default location if not specified is build_spec.yaml
returned: on success
type: str
sample: build_spec_file_example
stage_execution_timeout_in_seconds:
descrip... | |
<reponame>JackToppen/stem-cell-patterning_Python
import random as r
import csv
import cv2
import pickle
import math
import psutil
from backend import *
class Simulation:
""" This class makes sure any subclasses have the necessary
attributes to run a simulation.
"""
def __init__(self, name, output_path):
# set n... | |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import telegram
from telegram.error import Unauthorized, TelegramError
import random
THRESHOLD_PLAYERS = 10
with open("api_key.txt", 'r') as f:
TOKEN = f.read().rstrip()
bot = telegram.Bot(token=TOKEN)
class Player:
def __init__(self, id, hand):
... | |
airportname FROM `{0}` WHERE lower(city) = 'lyon' AND country = 'France'".format(self.bucket_name), server=self.master)
# Stop session
results = self.run_cbq_query(query="SELECT ADVISOR({{'action': 'stop', 'session': '{0}'}})".format(stopped_session), server=self.master)
# List sessions
results = self.run_cbq_query... | |
R.reduce_by(sum_values, 0)
sum_by_type = reduce_to_sums_by(by_type)
eq(R.into(
{},
R.compose(sum_by_type, R.map(R.adjust(R.multiply(10), 1))),
sum_input),
{"A": 800, "B": 800, "C": 500})
def describe_reduced():
@pytest.fixture
def stop_if_gte_10():
def _fn(acc, v):
result = acc + v
if result >= 10:
result... | |
# Created byMartin.cz
# Copyright (c) <NAME>. All rights reserved.
import numpy
from pero.enums import *
from pero.properties import *
from pero import Frame
from pero import MarkerLegend
from . series import Series
from . import utils
class Rectangles(Series):
"""
Abstract base class for various types of rectan... | |
<reponame>ayesha-omarali/sentry<gh_stars>0
"""
sentry.coreapi
~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
# TODO: We should make the API a class, and UDP/HTTP just inherit from it
# This will make it so we can more easily c... | |
#
# Copyright (c) 2019 Intel Corporation
#
# 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 w... | |
following channels have been marked as bad:", self.raw.info["bads"])
if save_to_raw:
# raw needs to be reloaded for this with the mastoid channels still present
mne_data_root = os.path.join(self.data_root, "eeg", "mne")
tmp = load_raw(
self.subject,
mne_data_root=mne_data_root,
interpolate_bad_channels=False,
... | |
tn == all1(N):
print("all ones found:wn:{}, tn:{}, nbt:{}, tni:{}".format(wn,tn,nbt,tni))
#if the number of tiles is smaller than max_fcn,
#and there is a tile in the ALL-1, the bit that should be
#set to one is not the last one, but the ones next to the
#previous tile number
#example, tiles 1 tile in ALL-1
pri... | |
<filename>meerk40t/core/node/elem_image.py
import threading
from copy import copy
from PIL.Image import DecompressionBombError
from meerk40t.core.node.node import Node
from meerk40t.core.units import UNITS_PER_INCH
from meerk40t.image.imagetools import RasterScripts
from meerk40t.svgelements import Matrix
class Ima... | |
# Copyright 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from __future__ import print... | |
'Yichun, Heilongjiang', 'zh': u('\u9ed1\u9f99\u6c5f\u7701\u4f0a\u6625\u5e02')},
'861800451':{'en': 'Harbin, Heilongjiang', 'zh': u('\u9ed1\u9f99\u6c5f\u7701\u54c8\u5c14\u6ee8\u5e02')},
'861800450':{'en': 'Harbin, Heilongjiang', 'zh': u('\u9ed1\u9f99\u6c5f\u7701\u54c8\u5c14\u6ee8\u5e02')},
'861800453':{'en': 'Mudanji... | |
%02x received %02x' % (chsum, calc_chsum))
def check_coredump_trigger_before_print(self, line): # type: (bytes) -> None
if self._decode_coredumps == COREDUMP_DECODE_DISABLE:
return
if COREDUMP_UART_PROMPT in line:
yellow_print('Initiating core dump!')
self.event_queue.put((TAG_KEY, '\n'))
return
if COREDUMP_... | |
# Copyright 2018 New Vector
#
# 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, softw... | |
socket client.
updateAccountTime()
updateAccountValue()
updatePortfolio()
'''
if not self.connected:
raise RuntimeError('IB client is not connected to TWS')
# TODO: check self.IB_acct_id before using it
# request IB host (e.g. TWS) push account info to IB client (socket client)
self.connection.reqAccountUpdat... | |
,
u'耱' : [u'm'] ,
u'㢶' : [u'b'] ,
u'綸' : [u'l', u'g'] ,
u'圿' : [u'j'] ,
u'桁' : [u'h'] ,
u'䗈' : [u'm'] ,
u'蛊' : [u'g'] ,
u'灑' : [u'x', u's', u'l'] ,
u'滚' : [u'g'] ,
u'塡' : [u't'] ,
u'鵣' : [u'c', u'l'] ,
u'㗨' : [u'a'] ,
u'盪' : [u'd'] ,
u'诬' : [u'w'] ,
u'敳' : [u'a'] ,
u'建' : [u'j'] ,
u'鏼' : [u's'] ,
u'螉' : [u'w'] ,
u'砌' :... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.