input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>tests/client/client_tests.py
# -*- coding: utf-8 -*-
import os
import platform
import sys
import time
import mock
import pytest
import elasticapm
from elasticapm.base import Client, ClientState
from elasticapm.conf.constants import KEYWORD_MAX_LENGTH
from elasticapm.transport.base import Transport
from elas... | |
# -*- coding: utf-8 -*-
"""
@File: database.py
@Description: This is a module for different database operations and
to provide a fast lookup.
This application,
1. Open/Close a SQLite database connection
2. Create a new SQLite database
3. Create a new SQLite table
4. Insert records into SQLite table
5. Create a... | |
= 1/PropsSI('DMOLAR', 'T', T, 'Q', 0, fluid)
Vm2 = 1/PropsSI('DMOLAR', 'T', T, 'P', P2, fluid)
dH = PropsSI('HMOLAR', 'T', T, 'P', P2, fluid) - PropsSI('HMOLAR', 'T', T, 'Q', 0, fluid)
def to_int(P):
Vm = 1/PropsSI('DMOLAR', 'T', T, 'P', P, fluid)
alpha = PropsSI('ISOBARIC_EXPANSION_COEFFICIENT', 'T', T, 'P', P, ... | |
<filename>ems/optim/opt_test.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
optimization for unit commitment of the household devices.
@author: ge57vam
"""
import sys
import pyomo.core as pyen
# import pyomo.environ
# from pyomo.core import *
from pyomo.opt import SolverFactory
from pyomo.opt import SolverManagerFactory
im... | |
of a companion. This mecha packs some heavy firepower and an electronic warfare system."))
museum.contents.append(ghwaypoints.GladiusModel(desc="Since NT152, the Gladius mecha has been awarded to the winner of Snake Lake City's annual Robot Warriors competition. This makes it one of the rarest mecha in the world since... | |
beam filling (NUBF) offset used to correct Ku-band Doppler velocity (m/s)
- channel_mask (range, time): xarray.DataArray(int) - Composite image channel mask. 0: No signal, 1: Low-resolution pulse, 2: High-resolution pulse, 3: Chirp
- horizontal_resolution_ku (range) : xarray.DataArray(float) - Approximate horizontal ... | |
this vote
* @apiSuccess {Integer} results.results.abstain Number of abstentions
* @apiSuccess {Integer} results.results.against Number of MPs who voted against the motion
* @apiSuccess {Integer} results.results.not_present Number of MPs who weren't present at the vote
* @apiSuccess {Integer} results.results.votes_f... | |
<reponame>bluetyson/bluecap<filename>bluecappy3/Managers/MiningSystemDataManager.py
"""
Copyright (C) 2019, Monash University, Geoscience Australia
Copyright (C) 2018, <NAME>
Bluecap is released under the Apache License, Version 2.0 (the "License");
you may not use this software except in compliance with the License.... | |
_ElementMap = {}
_AttributeMap = {}
# Base type is pyxb.binding.datatypes.anyType
# Attribute ReferredPoint uses Python identifier ReferredPoint
__ReferredPoint = pyxb.binding.content.AttributeUse(pyxb.namespace.ExpandedName(None, u'ReferredPoint'), 'ReferredPoint', '__cad_PointReference__ReferredPoint', STD... | |
1
self.ircd.userid[uuid] = newUser
for remoteserver in self.ircd.servers.itervalues():
if remoteserver.nearHop == self.ircd.name and remoteserver != self:
remoteserver.callRemote(ConnectUser, uuid=uuid, ip=ip, server=server, secure=secure, signon=signon)
return {}
ConnectUser.responder(basicConnectUser)
def ad... | |
cms.double(0.9),
NTOT = cms.int32(1),
jetsInput = cms.InputTag("hltAK4PFJets"),
maxCF = cms.double(99.0),
maxEta = cms.double(1e+99),
minPt = cms.double(20.0)
)
process.hltAK4PFJetsTightIDCorrected = cms.EDProducer("CorrectedPFJetProducer",
correctors = cms.VInputTag("hltAK4PFCorrector"),
src = cms.InputTag("h... | |
and Sorting supported on below mentioned
attributes: friendlyName issuedTo issuedBy
validFrom Supported Date Format: yyyy-MM-dd HH:mm:ss
Supported Operators: EQ, NEQ, GT and LT
expirationDate Supported Date Format: yyyy-MM-dd
HH:mm:ss Supported Operators: EQ, NEQ, GT and LT
.
Args:
host_name(basestring): hostN... | |
'''
Created on 13.12.2011
@author: <EMAIL>
'''
from __future__ import division
import json, re #, sys
from xml.etree import ElementTree as ET
__version__ = "0.3"
# global settings
# txt files must be changed encoding from UCS-2 to ANSI :(( xml files are ok )
folder = "C:\\Users\\Peter\\Documents\\ANNO 2070\\"
asset... | |
np.meshgrid(coords, coords)
sq_r = x ** 2 + y ** 2
elif dimension == 3:
x, y, z = np.meshgrid(coords, coords, coords)
sq_r = x ** 2 + y ** 2 + z ** 2
elif dimension == 4:
x, y, z, t = np.meshgrid(coords, coords, coords, coords)
sq_r = x ** 2 + y ** 2 + z ** 2 + t ** 2
else:
raise ValueError('Unsupport... | |
secret
state.
:attr str secret_type: (optional) The secret type.
:attr str crn: (optional) The Cloud Resource Name (CRN) that uniquely identifies
the resource.
:attr datetime creation_date: (optional) The date the secret was created. The
date format follows RFC 3339.
:attr str created_by: (optional) The unique i... | |
Target.
type: str
router_id:
description: Router id.
type: str
shutdown:
description: When True, shut down BGP.
type: bool
timers:
description: Timers.
type: dict
suboptions:
keepalive:
description: Keep Alive Interval in secs.
type: int
holdtime:
description: Hold time in secs.
type: int
ucmp:
descr... | |
courses.
# There may be multiple correct orders, you just need to return one of them.
# If it is impossible to finish all courses, return an empty array.
from collections import defaultdict
class Solution:
def findOrder(self, numCourses, prerequisites):
"""
:type numCourses: int
:type prerequisites: List[List[i... | |
<reponame>ANA-POTJE/kedro
# Copyright 2020 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWAR... | |
<reponame>Axel-Jacobsen/opentrons<gh_stars>1-10
from datetime import timedelta
from . import types as command_types
from opentrons.broker import Broker
import functools
import inspect
from typing import Union, Sequence, List, Any, Optional, TYPE_CHECKING
from opentrons.legacy_api.containers import (Well as OldWell,
... | |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Support module generated by PAGE version 4.20
# in conjunction with Tcl version 8.6
# Feb 18, 2019 11:55:48 AM -03 platform: Windows NT
# Feb 19, 2019 09:09:42 AM -03 platform: Windows NT
"""
Created on Mon Feb 18 10:08:04 2019
@author: <NAME>
"""
import sys
import C... | |
# 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, overload
from .. import _utilities
from... | |
from copy import deepcopy
import inspect
ACTIVATE_INSPECTION=True
#### helpers for inspection ####
def auto_inspect():
if not ACTIVATE_INSPECTION:
return [("unknown","unknown","unknown")]
stack = inspect.stack()
while len(stack)>=1 and len(stack[0])>=2 and ('FWCore/ParameterSet' in stack[0][1] or 'FWCore/GuiBrow... | |
elif self.exists_left(i+2, j, 3) and self.exists_right(i+2, j, 2):
self.animal_num[self.animal[i][j]] += 6
Sounds.eliminate(4) # Elimination sound 4
self.change_down(i, j, 3)
self.change_left(i+2, j, 3)
self.change_right(i+2, j, 2)
elif self.exists_left(i+2, j, 3) and self.exists_right(i+2, j, 3):
self.animal_nu... | |
if not db_row:
return
if db_row["entitytype"] == "server":
create_or_update_server_details(db, dbid, rest, slice_dbid)
elif db_row["entitytype"] == "serverfarm":
create_or_update_serverfarm_details(db, dbid, rest)
elif db_row["entitytype"] == "compute_network_service":
create_or_update_compute_details(db, dbid, ... | |
to complete request
:raise: ``Unimplemented`` -- ``supports_location_admin()`` or ``supports_visible_federation()`` is ``false``
*compliance: optional -- This method must be implemented if
``supports_location_admin()`` and
``supports_visible_federation()`` are ``true``*
"""
return # osid.mapping.LocationAdminSe... | |
to this `device` slot.
"""
return pulumi.get(self, "volume_id")
@pulumi.output_type
class InstanceConfigHelpers(dict):
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "devtmpfsAutomount":
suggest = "devtmpfs_automount"
elif key == "modulesDep":
suggest = "modules_dep"
elif key == "update... | |
<reponame>kayzhou/election
import pendulum
from my_weapon import *
"""
针对 disk/all-url-tweets.json 进行分析
默认15分钟的粒度
"""
from pyloess import stl
# LOESS smoothing
def get_day(dt):
return pendulum.parse(dt).format("YYYY-MM-DD 00:00:00")
def get_hour(dt):
return pendulum.parse(dt).format("YYYY-MM-DD HH:00:00")
d... | |
false, list only resources belonging to the command's
caller; if set to true - list resources that the caller is authorized to see.
Default value is false
page -
pagesize -
projectid - list firewall rules by project
page - Pagination
'''
return self.request('listPortForwardingRules', args)
def createPortForw... | |
pass
def saveState(*args, **kwargs):
pass
def selectFile(*args, **kwargs):
pass
def selectMimeTypeFilter(*args, **kwargs):
pass
def selectNameFilter(*args, **kwargs):
pass
def selectUrl(*args, **kwargs):
pass
def selectedFiles(*args, **kwargs):
pass
def selectedNameFilter(*args,... | |
#!/usr/bin/env python
"""Autogenerated python functions to serialize/deserialize binary messages.
Generated by: ../scripts/aisxmlbinmsg2py.py
Need to then wrap these functions with the outer AIS packet and then
convert the whole binary blob to a NMEA string. Those functions are
not currently provided in this file.
... | |
import torch
import math
import torch.nn as nn
import numpy as np
from .config import regnet_cfg
def init_weights(m):
"""Performs ResNet-style weight initialization."""
if isinstance(m, nn.Conv2d):
# Note that there is no bias due to BN
fan_out = m.kernel_size[0] * m.kernel_size[1] * m.out_channels
m.weight.data.... | |
<= 1)
m.c764 = Constraint(expr= m.b97 - m.b103 + m.b140 <= 1)
m.c765 = Constraint(expr= m.b97 - m.b105 + m.b141 <= 1)
m.c766 = Constraint(expr= m.b97 - m.b107 + m.b142 <= 1)
m.c767 = Constraint(expr= m.b97 - m.b109 + m.b143 <= 1)
m.c768 = Constraint(expr= m.b97 - m.b111 + m.b144 <= 1)
m.c769 = Constraint(expr= m.... | |
# *****************************************************************
# Copyright 2013 MIT Lincoln Laboratory
# Project: SPAR
# Authors: <NAME>
# Description: Parser for the perfomer queries log file.
# Results are stored in a DB.
# *****************************************************************
import argparse
impor... | |
<filename>src/chatbot/server/chatbot_agent.py
# -*- coding: utf-8 -*-
import traceback
import logging
import random
import os
import re
import sys
import numpy as np
import datetime as dt
reload(sys)
sys.setdefaultencoding('utf-8')
import atexit
from collections import defaultdict, OrderedDict
from threading import RL... | |
None
self.name = "T"+timestep_element.text
self.path = path+timestep_element.attrib["href"]
self.time = timestep_element.attrib["time"]
self.delta = timestep_element.attrib["oldDelt"]
tree = ET.parse(self.path)
self.root = tree.getroot()
self.res = ast.literal_eval(self.root.find(".//geom_object/res").text)
... | |
supply a keyword argument to the constructor.
@title
INSTALLATION:
The BitVector class was packaged using Distutils. For installation,
execute the following command-line in the source directory (this is
the directory that contains the setup.py file after you have
downloaded and uncompressed the tar archive):
... | |
+ language.PrintError('"ERROR : Equality check for '+message.Name+' failed"'))
result.append(WHITESPACE + language.WhiteSpace(0) + 'return false;')
result.append(WHITESPACE + language.CloseBrace())
elif unittestfw == UnitTestFramework.BOOST:
result.append(WHITESPACE + 'BOOST_REQUIRE_MESSAGE(' + equality_check + ', ... | |
<filename>pmExt.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
PubMed Article Search and Download Python Script (Ver 0.1)
"""
# import modules
import sys
import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import argparse
from tqdm import tqdm
import requests
import time
im... | |
import datetime as dt_module
from dynamicmethod import dynamicmethod
from collections import OrderedDict
__all__ = ['datetime', 'date', 'time',
'make_datetime', 'str_datetime',
'DATETIME_FORMATS', 'TIME_FORMATS', 'DATETIME_FORMATS']
DATE_FORMATS = [
'%m/%d/%Y', '%Y-%m-%d', '%y-%m-%d', '%m/%d/%y', # '2019-04-17',... | |
# noqa: E501
return self.api_client.call_api(
'/website/websites', 'GET',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type='WebsitePaginationResponse', # noqa: E501
auth_settings=auth_settings,
async_req=params.get('async_req'),
_retu... | |
kwargs.get('lendingFundAcct')
self.__reportId = kwargs.get('reportId')
self.__indexWeight = kwargs.get('indexWeight')
self.__MACSPrimaryAssetClass = kwargs.get('MACSPrimaryAssetClass')
self.__rebate = kwargs.get('rebate')
self.__flagship = kwargs.get('flagship')
self.__trader = kwargs.get('trader')
self.__additi... | |
<gh_stars>1-10
# coding=utf-8
# Copyright 2020 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | |
in the same
way as the events in the catalog.
"""
if not wavefiles:
wavefiles = ['DUMMY' for _i in range(len(catalog))]
with open(filename, 'w') as fout:
for event, wavfile in zip(catalog, wavefiles):
select = io.StringIO()
_write_nordic(event=event, filename=None, userid=userid,
evtype=evtype, wavefiles=wavfi... | |
it niver wud have entered me head again, savin’ your
speakin’ of it now. Why—was it the—the man that——”
“Oh, probably not. But everything I can learn is of help in discovering
the criminal and perhaps freeing your employers from suspicion.”
“And I wish that might be! To put it on the good man, now! And worse,
upon th... | |
# Copyright (c) 2019. Partners HealthCare and other members of
# Forome Association
#
# Developed by <NAME> based on contributions by <NAME>,
# <NAME>, <NAME> and other members of Division of
# Genetics, Brigham and Women's Hospital
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use t... | |
) )
folder_id = util.restore_text( params.get( 'sample_%i_folder_id' % index, '' ) )
library, folder = self.__get_library_and_folder( trans, library_id, folder_id )
history_id = util.restore_text( params.get( 'sample_%i_history_id' % index, '' ))
if not history_id and sample.history:
history_id = trans.security.en... | |
#!/usr/bin/env python3
import socket
import sys
import subprocess
from struct import pack
start_value = 0x00 # Default 0x00. Set higher to speed up runs.
def receive_data(s: socket):
received = b""
continue_receive = True
try:
while continue_receive:
data = s.recv(4096)
received += data
if len(data) < 4096:... | |
#!/usr/bin/env python3
# Copyright 2019 <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
#
# Unless required by applicable law or agreed ... | |
<filename>jenkins_jobs/modules/helpers.py
# Copyright 2015 <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
#
# Unless required by applica... | |
= self.lastFourChars[-4:]
return True
def entityDataState(self):
entity = self.consumeEntity()
if entity:
self.tokenQueue.append({"type": "Characters", "data": entity})
else:
self.tokenQueue.append({"type": "Characters", "data": u"&"})
self.state = self.states["data"]
return True
def tagOpenState(self):
d... | |
comp_id = request.POST.get('comp_id', '')
comp_type = request.POST.get('complaint_type', '')
location = request.POST.get('Location', '')
specific_location = request.POST.get('specific_location', '')
comp_file = request.FILES.get('myfile')
print("Attachment : ",comp_file)
details = request.POST.get('details'... | |
<reponame>siiptuo/kriobot
# SPDX-FileCopyrightText: 2021 <NAME>
# SPDX-License-Identifier: MIT
import argparse
import logging
import pickle
import random
import string
import sys
from datetime import datetime, timezone
from enum import Enum
from pathlib import Path
from random import Random
from typing import Callable... | |
# coding=utf-8
from honeybee.model import Model
from honeybee.room import Room
from honeybee.face import Face
from honeybee.shade import Shade
from honeybee.aperture import Aperture
from honeybee.door import Door
from honeybee.boundarycondition import boundary_conditions
from honeybee.facetype import face_types, Floor... | |
'dataset': current_dataset,
'annotationidglosstranslation':default_annotationidglosstranslation,
'machine_key': human_key,
'human_key': human_key,
'original_machine_value': tag_names_display,
'original_human_value': tag_names_display,
'new_machine_value': new_tag_names_display,
'new_human_value': new_tag_names_d... | |
<reponame>ignacioct/GeneticAlgorithms
import copy
import math
import operator
import random
import sys
from concurrent import futures
import numpy as np
import requests
class FitnessFunctionCaller:
"""Class for returning the fitness function of an individual."""
def __init__(self, *args):
functional_parts = []
... | |
<reponame>henri-chat-noir/PyPSA-Docs-Staging<filename>pypsa/pf.py
## Copyright 2015-2021 PyPSA Developers
## You can find the list of PyPSA Developers at
## https://pypsa.readthedocs.io/en/latest/developers.html
## PyPSA is released under the open source MIT License, see
## https://github.com/PyPSA/PyPSA/blob/master... | |
value: bool):
"""
:param bool value:
"""
self.part_infrastructure_setting_att.NewWith3DSupport = value
@property
def new_with_axis_system(self) -> bool:
"""
.. note::
:class: toggle
CAA V5 Visual Basic Help (2020-07-06 14:02:20.222384)
| o Property NewWithAxisSystem() As boolean
|
| Returns or sets the... | |
fsf_data = cmdopt_raw_data
assert (fsf_data.fileHeader is not None)
# Set file header
status = fsf_write.SetFileHeader(fsf_data.fileHeader)
check_status("fsf_write.SetFileHeader", status)
assert (status == fsf.Status.SUCCESS)
# Set stream info
for streamIdx in range(fsf_data.fileHeader.nStreams):
status = fsf... | |
https://zaber.com/documents/ZaberSpeedSetting.xls
return int(self.accel_units[unit] * accel * 1.6384 * 1e-7 * 1.0 / self.microstep)
def accel_to_unit(self, accel, unit='mm/s2'):
"""
Method to convert acceleration *accel* given in micro steps per square second into *unit*
Parameters
----------
accel : int
acce... | |
backwards to NOT change the discriminator....
crazy_hack = reconstructed_embed-reconstructed_embed_sg+tf.stop_gradient(reconstructed_embed_sg)
real_p_embed_sg, adv_true_layer = _architecture(tf.stop_gradient(real_points), reuse=True)
real_p_embed, _ = _architecture(real_points, reuse=True)
adv_fake = tf.reduce_mea... | |
<filename>notebooks/sputnikTools.py<gh_stars>0
import numpy as np
import matplotlib.pyplot as plt
### numerical model specifications and physical constants
def getPhysConstants():
physConst = {}
physConst['RE'] = 6371.0 # Earth's radius in km
physConst['sigSB'] = 5.6703*(10**-8) # Stefan-Boltzmann constant
phys... | |
import time
import os
import numpy as np
from collections import OrderedDict, deque, defaultdict
import torch
import torch.optim as optim
from torch.nn import DataParallel, Parameter, parameter
from .bound_op_map import bound_op_map
from .bound_ops import *
from .bounded_tensor import BoundedTensor, BoundedParameter
... | |
<reponame>goldblum/TruthOrBackpropaganda
"""Analyze NTKs."""
import argparse
import torch
import torchvision
import torchvision.transforms as transforms
import numpy as np
import scipy
import datetime
from collections import OrderedDict
import os
import csv
import matplotlib.pyplot as plt
import dl_myths as dl
from ... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | |
'''
# Amazon Kinesis Construct Library
<!--BEGIN STABILITY BANNER-->---


---
<!--END STABILITY B... | |
seq = Sequence(Func(av.motionFSM.moveLock), Func(av.currentWeapon.hideMouse, av), Func(base.cr.targetMgr.setWantAimAssist, 1), Func(self.startChargeSound, av, skillId), Func(startVFX), av.actorInterval('wand_cast_start', blendOutT = 0), Func(av.loop, 'wand_cast_idle', blendT = 0))
del startVFX
return seq
def... | |
# So ugly ... sadness :(
p2ps[0, i] = np.linalg.norm(p_centers[:, 0, i] - p_centers[:, 1, i])
p2ps[1, i] = np.linalg.norm(p_centers[:, 0, i] - p_centers[:, 2, i])
p2ps[2, i] = np.linalg.norm(p_centers[:, 0, i] - p_centers[:, 3, i])
p2ps[3, i] = np.linalg.norm(p_centers[:, 1, i] - p_centers[:, 2, i])
p2ps[4, i] = n... | |
child
del_comment_session_val(c_child)
c_child.delete()
# Delete the master parent, 'curr_comment'
del_comment_session_val(c)
c.delete()
# Call recursive delete on current comment entity
del_curr_comment(curr_comment)
except LookupError:
print (""""Error deleting comments and
associated replies....""")
final... | |
in _TIME_COORD_VARS if name in coords][0]
except IndexError:
xtime_coord = None
return lat_coord, lon_coord, xtime_coord
def _find_max_time_size(wrfseq):
"""Return the maximum number of times found in a sequence of
WRF files.
Args:
wrfseq (sequence): A sequence of WRF NetCDF file objects.
Returns:
... | |
H = HyperellipticCurve(2*t^5 + 2*t + 4)
sage: H.frobenius_polynomial_cardinalities()
x^4 - x^3 - 52*x^2 - 37*x + 1369
Curve over a non-prime field::
sage: K.<z> = GF(7**2)
sage: R.<t> = PolynomialRing(K)
sage: H = HyperellipticCurve(t^5 + z*t + z^2)
sage: H.frobenius_polynomial_cardinalities()
x^4 + 8*x^3 + 7... | |
from typing import Union, List
from . import cpp_templates, utils
from .utils import checked
from .version import __version__
from .third_party import triehash
from .schema import (
UxsdSchema,
UxsdComplex,
UxsdDfa,
UxsdAll,
UxsdLeaf,
UxsdElement,
UxsdEnum,
UxsdSimple,
UxsdString,
UxsdAtomic,
UxsdAttribute,... | |
import os
import math
import sys
import pandas as pd
from citrination_client import CitrinationClient
from pypif import pif
from pypif.obj import *
from IN718_porosity_updater.pore_statistics import *
sys.path.insert(0, '/Users/cborg/projects/community_projects/')
from community_projects.pycc_utils import pycc_wrappers... | |
# coding=utf-8
# Copyright (C) 2020 NumS Development Team.
#
# 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... | |
# -*- c--oding: ko_KR.UTF-8 -*-
import os
import sys
import vim
import socket
import base64
import traceback
import xml.dom.minidom
import re
import unicodedata
#######################################################################################################################
# #
# this diagram is little outdated... | |
"""
Do a likelihood fit. The class NestedSamplerStatModel is used for fitting
applying the bayesian algorithm nestle/multinest
"""
from __future__ import absolute_import, unicode_literals
import datetime
import json
import os
import shutil
import tempfile
from warnings import warn
import corner
import matplotlib.pyplo... | |
<filename>zerocloud/proxyquery.py
from copy import deepcopy
import ctypes
from itertools import chain
import re
import struct
import traceback
import time
import datetime
from urllib import unquote
import uuid
from hashlib import md5
from random import randrange, choice
import greenlet
from eventlet import GreenPile
fr... | |
diseases
except RuntimeError:
flash("Could not establish a conection to Phenomizer", "danger")
def rerun(store, mail, current_user, institute_id, case_name, sender, recipient):
"""Request a rerun by email."""
institute_obj, case_obj = institute_and_case(store, institute_id, case_name)
user_obj = store.user(curr... | |
<reponame>cowboygneox/boto3_type_annotations<gh_stars>100-1000
from typing import Optional
from botocore.client import BaseClient
from typing import Dict
from botocore.paginate import Paginator
from botocore.waiter import Waiter
from typing import Union
from typing import List
class Client(BaseClient):
def can_pagin... | |
- m.x105)*m.x507) + m.x506) == 0)
m.c306 = Constraint(expr=m.x508 - (0.0025*(m.x105*(m.x306 - 10*m.x507) - (1 - m.x105)*m.x507 + m.x106*(m.x307 - 10*
m.x508) - (1 - m.x106)*m.x508) + m.x507) == 0)
m.c307 = Constraint(expr=m.x509 - (0.0025*(m.x106*(m.x307 - 10*m.x508) - (1 - m.x106)*m.x508 + m.x107*(m.x308 - 10*
m.x... | |
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2021 <NAME> (The Compiler) <<EMAIL>>
#
# This file is part of qutebrowser.
#
# qutebrowser 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, e... | |
2 * radi + 1), list1, 2)
list2 = list_metric[min_pos - 1:min_pos + 2]
(afact2, bfact2, _) = np.polyfit(
np.arange(min_pos - 1, min_pos + 2), list2, 2)
curvature = np.abs(afact1)
if afact2 != 0.0:
num = - bfact2 / (2 * afact2)
if (num >= min_pos - 1) and (num <= min_pos + 1):
min_pos = num
return curvature, np.... | |
u19': '3755f67e',
'sc hauenstein': '3e994daf',
'sc paderborn 07': 'd9f93f02',
'paderborn 07': 'd9f93f02',
'sc paderborn 07 u17': '6df34a06',
'sc paderborn 07 u19': 'd9f72365',
'sc preußen 06 münster u17': '9d619fa8',
'sc preussen 06 munster u17': '9d619fa8',
'sc preußen 06 münster u19': '21499441',
'sc preusse... | |
#
# Copyright (c) 2006-2013, Prometheus Research, LLC
#
"""
:mod:`htsql.core.fmt.text`
==========================
This module implements the plain text renderer.
"""
from ..adapter import Adapter, adapt, adapt_many
from ..util import maybe, oneof
from ..context import context
from .format import TextFormat
from .e... | |
<gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 17 20:05:53 2020
@author: dariograna
"""
import numpy as np
import numpy.matlib
from numpy.linalg import matrix_power
import scipy .spatial
def CorrelatedSimulation(mprior, sigma0, sigmaspace):
"""
CORRELATED SIMULATION
Generates 1D stochastic rea... | |
#!/usr/bin/env python3
"""
DWARF parser minimal implementation.
All references unless states otherwise are for:
DWARF v3, December 20, 2005
"""
"""
Enumeration examples
TI ARM C/C++ Codegen PC v16.9.6.LTS
([], DIE DW_TAG_enumeration_type, size=13, has_children=True
|DW_AT_sibling : AttributeValue(name='DW_AT_si... | |
<filename>hcmr_pilot/views.py<gh_stars>1-10
import csv
import sys
import json
from django.core.exceptions import PermissionDenied
from django.template.loader import render_to_string
import folium
from folium import plugins
import numpy as np
from PIL import Image, ImageChops
from bs4 import BeautifulSoup
import reques... | |
<filename>qtgmc_modern/settings/_interface.py<gh_stars>1-10
"""
Implements the interface in static typing and at runtime plus some enumerations.
"""
__all__ = [
'CoreParam', 'CoreSettings',
'VSCallableD',
'InterpolationSettings',
'MotionAnalysisSettings',
'SharpnessSettings',
'SourceMatchSettings',
'NoiseSetti... | |
reset the parameters.
'''
methods = [SIMPLE]
if none_and_length_check([self.Tcs, self.Vcs, self.omegas, self.CASs]):
methods.append(COSTALD_MIXTURE)
if all([i in COSTALD_data.index for i in self.CASs]):
self.COSTALD_Vchars = [COSTALD_data.at[CAS, 'Vchar'] for CAS in self.CASs]
self.COSTALD_omegas = [COSTALD_d... | |
0
board = Block((0, 0), 1000, None, 0, 2)
# Level 1
colours = [COLOUR_LIST[3], None, COLOUR_LIST[0], None]
set_children(board, colours)
# Level 2
colours1 = [COLOUR_LIST[1], COLOUR_LIST[2], COLOUR_LIST[0], COLOUR_LIST[2]]
set_children(board.children[1], colours1)
colours2 = [COLOUR_LIST[0], COLOUR_LIST[1], CO... | |
* *_async* (``bool``) --
Indicate if invoke asynchronously.
:raises CollectionNotExistException: If the collection does not exist.
:raises ParamError: If the parameters are invalid.
:raises BaseException: If the specified field, index or partition does not exist.
:example:
>>> from pymilvus import connections, ... | |
when added to a Graph in a Dashboard. Default: - No label
:param period: The period over which the specified statistic is applied. Default: Duration.minutes(5)
:param region: Region which this metric comes from. Default: - Deployment region.
:param statistic: What function to use for aggregating. Can be one of the f... | |
roi = (0,int(idxL),size[0],int(idxH-idxL))
cv.SetImageROI(pal,roi)
color = np.array((float(self._mPalette[i][2]),float(self._mPalette[i][1]),float(self._mPalette[i][0])))
cv.AddS(pal,color,pal)
cv.ResetImageROI(pal)
idxL = idxH
retVal = Image(pal)
else: # do hue
if( horizontal ):
if( size[0] == -1 or size[1] =... | |
event is required for termination. Defaults to
True.
terminal_sufficient (bool):
Whether this event is sufficient for termination. Defaults to
False.
"""
msgs = [
f"This {name} is delicious",
"Blecch! Rotten food!",
"last bite of your meal",
]
if name == "apple":
msgs.append("Delicious! Must be a Macintosh!... | |
ret = 0.0
queue = [1] + placed + [(p - 1) for p in placed] + [(p + 1) for p in
placed]
queue = sorted(set(queue))
seen = set(queue)
while queue:
lowest = queue.pop()
if lowest == 0:
continue
needed_budget = (37 - len(placed)) * lowest
for p in placed:
needed_budget += max(0, lowest - p)
if budget < needed_b... | |
<gh_stars>10-100
from aeternity import utils, defaults, identifiers, signing, compiler, hashing
from aeternity.contract import Contract
from munch import Munch
class ContractNative(object):
CONTRACT_ERROR_TYPES = ["revert", "abort", "error"]
def __init__(self, **kwargs):
"""
Initialize a ContractNative object
... | |
<gh_stars>1-10
# Copyright (c) 2016 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
#... | |
flavor."""
return self.delete(self.flavor_path % (flavor))
def list_flavors(self, retrieve_all=True, **_params):
"""Fetches a list of all Neutron service flavors for a project."""
return self.list('flavors', self.flavors_path, retrieve_all,
**_params)
def show_flavor(self, flavor, **_params):
"""Fetches inform... | |
bv.ast), ctx)
else:
ctx = _get_ctx(ctx)
return BitVecNumRef(Z3_mk_numeral(ctx.ref(), _to_int_str(val), BitVecSort(bv, ctx).ast), ctx)
def BitVec(name, bv, ctx=None):
"""Return a bit-vector constant named `name`. `bv` may be the number of bits of a bit-vector sort.
If `ctx=None`, then the global context is used.
... | |
<filename>core/domain/exp_services_test.py<gh_stars>1-10
# coding: utf-8
#
# Copyright 2014 The Oppia 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://... | |
time. Setting it to a fixed seed accross glaciers can
be usefull if you want to have the same climate years for all of them
temperature_bias : float, optional
add a bias to the temperature timeseries, default = None
climate_filename : str, optional
name of the climate file, e.g. 'climate_monthly' (default) or
'gc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.