input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<gh_stars>10-100
"""
NLTE module of SME
reads and interpolates departure coefficients from library files
"""
import itertools
import logging
import warnings
import numpy as np
from scipy import interpolate
from tqdm import tqdm
from .abund import Abund
from .abund import elements as abund_elem
from .data_structure i... | |
and end positions.
for match in re.finditer(
r'^CIDR:[^\S\n]+(.+?,[^\S\n].+|.+)$',
response,
re.MULTILINE
):
try:
net = copy.deepcopy(BASE_NET)
if len(nets) > 0:
temp = pattern.search(response, match.start())
net_range = None
net_range_start = None
if temp is not None:
net_range = temp.group(1).strip()
... | |
141. 0.]
[ 0. 194. 1.]
[ 2. 122. 0.]
[ 1. 97. 0.]
[ 4. 108. 0.]]
>>> # Print names (or absolute indices, if no names) of columns in data.
... # Note: Column 0 was isolated as target values.
... print(main.columns_)
Int64Index([1, 2, 3], dtype='int64')
>>> # Print the names (or absolute indices, if no names... | |
empty mask for balancing training set
#nudels2 = np.where(masks1 == 1, scans1, -4000*np.ones(( masks1.shape[1], masks1.shape[2))) ### was -2000
#nudels1 = np.where(masks1 == 1, scans1, masks1 - 4000) ### was -2000
#nudles1_rf = nudels1.flatten()
#nudles1_rf = nudles1_rf[nudles1_rf > -4000]
scans1 = normalize(... | |
import requests
from heltour import settings
from collections import namedtuple
from . import slackapi
from django.core.cache import cache
from django.core.urlresolvers import reverse
from heltour.tournament.models import *
from django.db.models.signals import post_save
from django.dispatch.dispatcher import receiver
i... | |
0.87, 0.92))
fd(1)
color((0.18, 0.27, 0.45))
fd(1)
color((0.98, 0.74, 0.0))
fd(3)
color((0.3, 0.35, 0.38))
fd(1)
color((0.29, 0.2, 0.43))
fd(1)
color((0.88, 0.14, 0.23))
fd(16)
color((0.77, 0.15, 0.27))
fd(1)
color((0.09, 0.22, 0.5))
fd(1)
color((0.98, 0.74, 0.0))
fd(8)
color((0.94, 0.71, 0.02))
fd(1)
color((0.09, 0.22... | |
<gh_stars>0
import random
import math
version = "5.0"
# major - backwards incompatible
# minor - backwards compatible
# TODO:
# nothing?
'''
(dd.m.yyyy)
1.0 (31.5.2021?) - the
2.0 (01.6.2021?) - stuff like A. and A, / changed <'' and >'' into <, and >, / added the t command / added copying and pastin... | |
models.Action.action.in_(consts.CLUSTER_SCALE_ACTIONS))
scaling_actions = query.all()
return scaling_actions
def action_get_by_name(context, name, project_safe=True):
return query_by_name(context, action_model_query, name,
project_safe=project_safe)
def action_get_by_short_id(context, short_id, project_safe=Tru... | |
<gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from git_machete import __version__
import datetime
import getopt
import io
import itertools
import os
import re
import shutil
import subprocess
import sys
import textwrap
# Core utils
class MacheteException(Exception):
def __init__(self, msg, apply_fmt=Tru... | |
= {} # type: Dict[int, Any]
self.MATS3 = {} # type: Dict[int, Any]
self.MATS8 = {} # type: Dict[int, Any]
#: stores MATTx
self.MATT1 = {} # type: Dict[int, Any]
self.MATT2 = {} # type: Dict[int, Any]
self.MATT3 = {} # type: Dict[int, Any]
self.MATT4 = {} # type: Dict[int, Any]
self.MATT5 = {} # type: Dict[int,... | |
grid3 nodes because of
heavy melting of surface nodes (problematic in ablation area)
-> merge k batches of n1 grid3 nodes into k grid23 nodes (k is maximum nb of batches of n1 grid3 nodes available)
if nb of layers in grid2 is <k:
-> calculate the nb of supplementary grid2 layers required
-> calculate xx: the numb... | |
MCacheFormatDescription_getNumChannels(*args, **kwargs):
pass
def MArrayDataBuilder_removeElement(*args, **kwargs):
pass
def MItSurfaceCV_getIndex(*args, **kwargs):
pass
def MFnSubd_polygonGetCenterUV(*args, **kwargs):
pass
def MFnLatticeData_className(*args, **kwargs):
pass
def MFnDagNode_inModel(*args,... | |
<filename>SequenceWrangler.py
import numpy as np
import pandas as pd
from sklearn.model_selection import StratifiedKFold, train_test_split
from sklearn import preprocessing
import time
import sys
import os
import dill as pickle
import utils
import pathos.multiprocessing as mp
# Class to take a list of continuous, cont... | |
__str__(self):
self.templateMap = {
'message': self.getMessage()
,'identifier': self.identifier
# ,'props': stringify([ conf.INDENT + str(p) for p in self.getProperties() if len(self) == 2])
,'props': stringify([ conf.INDENT + str(p) for p in self.getProperties()], prefix=(len(self) > 2))
,'token': self.token
}
... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# 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
#... | |
self.client.post(reverse('inbox_api:inbox', kwargs={'author_id':author2.id}), data, format="json")
self.assertEqual(response.status_code, 201, f"expected 201. got: {response.status_code}")
# test admin
self.client.logout()
self.auth_helper.authorize_client(self.client)
response = self.client.post(reverse('inbox_ap... | |
if full port details might be provided to this call,
# they are not used since there is no guarantee the notifications
# are processed in the same order as the relevant API requests
self.updated_ports.add(port['id'])
def port_delete(self, context, **kwargs):
port_id = kwargs.get('port_id')
self.deleted_ports.add... | |
-1.0: 140,
0.0: 2.0,
90.0: 14.0,
180.0: 10.0,
270.0: 14.0}
def test_fill_window_area_dict(self):
"""test of fill_window_area_dict"""
prj.buildings[-1].fill_window_area_dict()
assert prj.buildings[-1].window_area == {90.0: 1.0,
180.0: 8.0,
270.0: 5.0}
def test_calc_building_parameter(self):
"""test of calc... | |
!HawCyDkL.:,.nlD!jQFrq:-G'UBTs/,"
"LPNf'?nlD,;G'UBTs,HawCyDkL;-.??LPNf';HawCyDkL,?:?;G'UBTs___ "
"jQFrq._!:;HawCyDkL!:_jnjG!:G'UBTs:/;.-tLJKKVH!_-_nlD.LPNf' ,"
"::tdFdQVKM?jQFrq_!;jnjG,:!:-G'UBTs,tdFdQVKM_! "
"HawCyDkL-;tdFdQVKM;?jQFrq,G'UBTs;rPfpL/.?-jnjG,:,"
"-:tLJKKVH.;.nlD_jQFrq_!/;tdFdQVKM;//!tdFdQVKM!.zuPwI_... | |
self.center = center
self.width = width
self.lower = center - width / 2.0
self.upper = center + width / 2.0
self.flux = flux
class SpectralGrid(object):
"""
A grid of spectra for quick interpolation.
Attributes
----------
teff_bds : iterable
The lower and upper bounds of the model temperatures to load.
l... | |
import dgl
import torch
import math
import time
import numpy as np
import dgl.nn.pytorch as dglnn
import torch.nn as nn
from utils import *
from metrics import *
class Perceptron(torch.nn.Module):
def __init__(self, in_dim, out_dim, dropout=0, norm=False, act=True):
super(Perceptron, self).__init__()
self.weight =... | |
tbl = DialogTableWidget(
df=pd.DataFrame(columns=cols),
col_widths=col_widths,
name=name,
scroll_bar=True,
**kw)
else:
# use full TableView for filters/line highlighting etc
from smseventlog.gui import tables as tbls
if query is None:
raise RuntimeError('Must pass query obj if not using simple table')
self... | |
a numpy array.
:param inplace:
:return:
"""
obs_set = self if inplace else self.copy()
select_indices = obs_set.search_names(names)
if select_indices.size == 0:
obs_set.obs = np.asarray([])
obs_set.length_vector = np.asarray([])
obs_set.names_vector = np.asarray([])
return obs_set
return obs_set.select_obser... | |
0:
#Download file completed successfully
self.playlist_src.remove(0)
#self.playlist_src.save(RootDir + downloads_queue)
self.playlist_src.save(datapaths + downloads_queue)
counter += 1
elif self.state == -1:
#Downlaod failed
dialog = xbmcgui.Dialog()
if dialog.yesno("Error",str(self.playlist_src.list... | |
2579, 2580, 2586, 2585)
model.createElement(2640, 4700, 4701, 4707, 4706, 2580, 2581, 2587, 2586)
model.createElement(2641, 4701, 4702, 4708, 4707, 2581, 2582, 2588, 2587)
model.createElement(2642, 4702, 2927, 2928, 4708, 2582, 563, 564, 2588)
model.createElement(2643, 2233, 4703, 4709, 2232, 428, 2583, 2589, 429)
mode... | |
:
### existing units
vPowerOutput_Ex = 0
# dispatchable output
for TechDisp in model.setProcBaseDisp_TCD:
if (sZone + "/") in TechDisp:
vPowerOutput_Ex = vPowerOutput_Ex + model.vExProcDispPwOutNetTest_TCD_TS[TechDisp, sTimeSlice]
# storage output
for TechStor in model.setProcBaseStor_TCS:
if (sZone + "/")... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# NetApp HANA Integration Script
#
# This script allows an SAP HANA administrator to take advantage
# of the data management features offered by the Azure NetApp Files Service.
#
# These include application-consistent instant snapshots, restore, and
# cloning.
#
# This i... | |
}
resource = f'/networks/{networkId}/switch/dscpToCosMappings'
return await self._session.get(metadata, resource)
async def updateNetworkSwitchDscpToCosMappings(self, networkId: str, mappings: list):
"""
**Update the DSCP to CoS mappings**
https://developer.cisco.com/docs/meraki-api-v1/#!update-network-switch-d... | |
# Copyright 2022 Google LLC. 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 law or ag... | |
self.L
class LCESN(LayeredESN):
def __reservoir_input_size_rule__(self, reservoir_sizes, echo_params, activation):
"""
Set up the reservoirs so that the first takes the input signal as input,
and the rest take the previous reservoir's state as input.
"""
self.reservoirs.append(Reservoir(self.K, reservoir_size... | |
consecutive value filtering" : tuple,
},
"quantity: profiles/protein groups" : df - number of protein groups | number of profiles | data completeness of profiles
"Unique Proteins": list,
"Analysis parameters" : {
"acquisition" : str,
"filename" : str,
##SILAC##
"Ratio H/L count 1 (>= X)" : int,
"Ratio H/L ... | |
'3d', '61', '62', '63', '64', '43', '44', '45', '56', '57', '58', '59', '39', '30', '3a', '6e', '6f', '71', '78', '37', '38', '26', '79', '3e', '3f', '41', '42', '49', '21', '22', '5c'],
['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '79... | |
timeout=60, ignore_sighup=False, options=login_ssh_options
)
self._second_ssh = CustomSSH(
timeout=60,
ignore_sighup=False,
options={"PubkeyAuthentication": "yes" if self.use_pubkey else "no"},
)
# perform close() on exit or term() on interrupt
atexit.register(self.close)
self.flag_exit = False
for sig in (... | |
[ P.h02, P.h02, P.su6__tilde__, P.su6 ],
color = [ 'Identity(3,4)' ],
lorentz = [ L.SSSS1 ],
couplings = {(0,0):C.GC_1954})
V_1083 = Vertex(name = 'V_1083',
particles = [ P.A0, P.A0, P.su6__tilde__, P.su6 ],
color = [ 'Identity(3,4)' ],
lorentz = [ L.SSSS1 ],
couplings = {(0,0):C.GC_1145})
V_1084 = Vertex(name... | |
corresponding element of data.
'''
r = data[:, :, red].astype(float)
if len(r.shape) == 3 and r.shape[2] > 1:
r = sum(r, 2) / r.shape[2]
n = data[:, :, nir].astype(float)
if len(n.shape) == 3 and n.shape[2] > 1:
n = sum(n, 2) / n.shape[2]
return (n - r) / (n + r)
def bdist(class1, class2):
'''
Calulates t... | |
from typing import Tuple
from typing import Union
import numpy as np
from sklearn.utils.validation import check_is_fitted, check_array
from . import LVQBaseClass
from ..objectives import GeneralizedLearningObjective
ModelParamsType = Tuple[np.ndarray, np.ndarray]
DISTANCES = [
"adaptive-squared-euclidean",
]
SOLV... | |
<gh_stars>0
import setuptools
import distutils.command.build
from distutils.errors import DistutilsSetupError
import distutils.sysconfig
import distutils.spawn
import hashlib
import os
import re
import shutil
import StringIO
import sys
import tarfile
import tempfile
import urllib2
import urlparse
import zipfile
#
# Th... | |
while performing the operations are not handled.
see: config.backed_up
filename: Name of the file to create
content: list of strings to store into 'filename'
which: Kind of backup: 'wxg' or 'codegen'"""
if which == 'wxg':
content = [line.encode('utf-8') for line in content] # encode from unicode to utf-8
do_ba... | |
into an include-optional
# file, then reloaded into FAUCET.
@staticmethod
def acls_override():
"""Return override ACLs option"""
return {
1: [
{'rule': {
'dl_type': IPV4_ETH,
'ip_proto': 6,
'tcp_dst': 5001,
'actions': {
'allow': 0,
},
}},
{'rule': {
'dl_type': IPV4_ETH,
'ip_proto': 6,
'tcp_dst': 5002,... | |
nærkamp_bonus = 15
nærkamp_value += nærkamp_bonus
self.charactersheet[author_id]["Character Sheet"]["Nærkamp"] = nærkamp_value
styrke_value = int(self.charactersheet[author_id]["Character Sheet"]["Styrke"])
styrke_bonus = 5
styrke_value += styrke_bonus
self.charactersheet[author_id]["Character Sheet"]["Styrke"] ... | |
<reponame>woodrow/pyoac<gh_stars>1-10
# ______________________________________________________________________
import sys, operator, types
from pypy.interpreter.baseobjspace import ObjSpace, Wrappable
from pypy.interpreter.pycode import PyCode, cpython_code_signature
from pypy.interpreter.module import Module
from pypy... | |
chart=None, name=None,
latex_name=None):
r"""
Construct a scalar field.
TESTS::
sage: M = Manifold(2, 'M', structure='topological')
sage: X.<x,y> = M.chart()
sage: f = M.scalar_field({X: x+y}, name='f') ; f
Scalar field f on the 2-dimensional topological manifold M
sage: from sage.manifolds.scalarfield impor... | |
# Copyright 2017 QuantRocket - 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 law or agre... | |
[]
map_types = ["unambig"]
if readlen_ambig == True:
map_types.append("ambig")
for transcript in traninfo_dict:
outfile = open("{}/static/tmp/{}_{}".format(config.SCRIPT_LOC,transcript,curr_time),"w")
filepaths.append("{}_{}".format(transcript,curr_time))
count_dict = {}
for filetype in file_paths_... | |
<reponame>ajuvercr/idasen-controller
#!python3
import os
import sys
import shutil
import struct
import argparse
import yaml
import asyncio
from bleak import BleakClient, BleakError, BleakScanner
import pickle
import json
import functools
from appdirs import user_config_dir
IS_LINUX = sys.platform == "linux" or sys.pla... | |
<filename>cleanex.py
#!/usr/bin/env python
import os.path
import pandas as pd
import numpy as np
import sys
import argparse
import utility
import math
import itertools
import random
from datetime import datetime
from pareto import *
from radarPlot import *
import os.path
endNodes = set()
nodesInPathToFinalNode = {}
fi... | |
from multiprocessing import cpu_count
from os import path
from socket import gethostname
import os
hostname = gethostname().split('.')
machine_name = hostname[0]
#hypothesis_params = {
# 'START DATE':'2004-01-01',
# 'END DATE': '2018-01-15',
# 'PORTFOLIO': 'US_TOP_500_LIQUID',
# 'NEUTRALIZATION': 'DOLLAR',
# 'LONG L... | |
self.pop2()
def drop_double(self):
return self.pop2()
# </editor-fold>
# <editor-fold desc="Loads" defaultstate="collapsed" defaultstate="collapsed">
def load_reference(self, index: int) -> 'Instructions':
if 0 >= index >= 3:
return self.append(f"aload_{index}")
else:
return self.append("aload", index)
de... | |
= Column(String, default='', server_default=sql.text("''"), nullable=False)
link = relationship('Link', foreign_keys=[link_id], innerjoin=True)
entity0 = relationship('Label', foreign_keys=[entity0_id], innerjoin=True)
entity1 = relationship('Recording', foreign_keys=[entity1_id], innerjoin=True)
@hybrid_property... | |
import time
import wandb
import os
import gym
import numpy as np
import imageio
from collections import defaultdict, deque
from itertools import chain
import matplotlib
import matplotlib.pyplot as plt
import torch
import torch.nn as nn
from torch.nn import functional as F
from onpolicy.utils.util import update_linear... | |
if _instances :
for _x in _instances :
_instances = _x
if obj_type == "pod" and hasattr(_instances, "obj") and "nodeName" in _instances.obj["spec"] :
obj_attr_list["node"] = _instances.obj["spec"]["nodeName"]
_status = 0
except CldOpsException as obj :
_status = obj.status
_xfmsg = str(obj.msg)
except Exce... | |
##! python3
##==============================================================================
## Copyright (c) 2021 COMPAL Electronic Inc. All rights reserved.
## This program contains proprietary and confidential information.
## All rights reserved except as may be permitted by prior written consent.
##
## Compal STiD ... | |
self.enable : ROOT.ROOT.EnableImplicitMT ( self.__nthreads )
else : ROOT.ROOT.DisableImplicitMT ()
return self
## Context manager: EXIT
def __exit__ ( self , *_ ) :
_current = ROOT.ROOT.IsImplicitMTEnabled()
if _current == self.__initial : pass
elif _current : ROOT.ROOT.DisableImplicitMT ()
else : ROOT.ROO... | |
import numpy as np
import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib.patches import Circle
import ephem
import sqlite3 as lite
from progressbar import ProgressBar
# Altitude and Azimuth of a single field at t (JD) in rad
def Fields_local_co... | |
"""Module containing library functions for time manipulation.
Standard for time representation in this project is fractional days.
Dates are represented as modified Julian dates (mjd).
An mjd gives the number of days since midnight on November 17, 1858.
"""
import string
from math import ceil, floor
# Constant for con... | |
<filename>sdk/python/pulumi_gcp/compute/forwarding_rule.py
# 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, ... | |
'code.py')
sm = SchemaModule(code)
module = sm.import_module_for_migration()
self.check_imported_module(sm, 'test_package.pkg_dir.code', module)
self.check_related_attributes(sm)
# test deletion of imported schemas from sys.modules after importlib.import_module()
# ensure that the schema and its submodels get de... | |
<reponame>PRECISE/SMEDL<gh_stars>0
# Copyright (c) 2021 The Trustees of the University of Pennsylvania
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without... | |
import discord
from discord.ext import commands
import asyncio
import aiohttp
from lxml import html
from datetime import datetime
import json
import re
# because fuck it why not.
timedict = {"0":"🕛","030":"🕧","1":"ðŸ•", "130":"🕜", "2":"🕑", "230":"ðŸ•",
"3":"🕒", "330":"🕞", "4":"ðŸ•... | |
<gh_stars>100-1000
import abc
import logging
import re
import time
from collections import defaultdict
import numpy as np
import pandas as pd
from diamond.solvers.repeated_block_diag import RepeatedBlockDiagonal
from scipy import sparse
from future.utils import iteritems
LOGGER = logging.getLogger(__name__)
LOGGER.set... | |
tick2On=True,
labelcolor=label_color,
color=color)
cbar.set_label(label, size=label_size, color=label_color)
return cbar
except:
report_err(comment='Could not set color bar; please set manually!')
def get_cmap(colors, n=None, r=False, start=0, stop=1, **kwargs):
"""
Converts a list of colors into a color m... | |
<gh_stars>1-10
'''
Copyright (C) 2018 CG Cookie
http://cgcookie.com
<EMAIL>
Created by <NAME>, <NAME>
This program 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... | |
<reponame>vadian/climate
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "L... | |
tuple(metadata) + (
gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)),
)
pager = client.list_tensorboard_time_series(request={})
assert pager._metadata == metadata
results = [i for i in pager]
assert len(results) == 6
assert all(
isinstance(i, tensorboard_time_series.TensorboardTimeSeries)
for i in... | |
from formalchemy.tests import *
from formalchemy.fields import DateTimeFieldRenderer
import datetime
class Dt(Base):
__tablename__ = 'dts'
id = Column('id', Integer, primary_key=True)
foo = Column('foo', Date, nullable=True)
bar = Column('bar', Time, nullable=True)
foobar = Column('foobar', DateTime, nullable=Tru... | |
the zones
attached to that specific air loop.
Duplicate groups of Zone name, Design Specification Outdoor Air Object Name,
and Design Specification Zone Air Distribution Object Name to increase allowable number of entries
"""
_schema = {'extensible-fields': OrderedDict([(u'zone 1 name',
{'name': u'Zone 1 Name',
... | |
name = "com_github_rogpeppe_go_internal",
importpath = "github.com/rogpeppe/go-internal",
sum = "h1:Usqs0/lDK/NqTkvrmKSwA/3XkZAs7ZAW/eLeQ2MVBTw=",
version = "v1.5.0",
)
go_repository(
name = "com_github_rs_cors",
importpath = "github.com/rs/cors",
sum = "h1:G9tHG9lebljV9mfp9SNPDL36nCDxmo3zTlAf1YgvzmI=",
versio... | |
y, tol=2, rel=2))
self.assertTrue(approx_equal(inf, inf, tol=2, rel=2))
self.assertTrue(approx_equal(-inf, -inf, tol=2, rel=2))
class ApproxFloatTest(unittest.TestCase):
# Test the approx_equal function with floats.
def testExactlyEqual(self):
# Test that equal values are equal and unequal values are unequal.
... | |
<filename>lights/lights/lights.py
# Lights Controller and light patterns
# <NAME>, 22 October 2016
# Copyright Notice
import logging
import os
import random
import signal
import time
import RPi.GPIO as GPIO
import Adafruit_WS2801
import Adafruit_GPIO.SPI as SPI
from multiprocessing import Process
import config
# li... | |
Why: #3599 in Alexa global
'http://www.autodesk.com/',
# Why: #3600 in Alexa global
'http://www.vertitechnologygroup.com/',
# Why: #3601 in Alexa global
'http://www.leaseweb.com/',
# Why: #3602 in Alexa global
'http://www.yoox.com/',
# Why: #3603 in Alexa global
'http://www.papajohns.com/',
# Why: #3604 in Al... | |
<reponame>gordon-quad/matrix-nio<filename>nio/store.py<gh_stars>0
# -*- coding: utf-8 -*-
# Copyright 2018 Zil0
# Copyright © 2018, 2019 <NAME> <<EMAIL>>
# 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 Li... | |
to generate.
pts: Number of points to use in grid for evaluation.
"""
# Define the grid we'll use
xx = dadi.Numerics.default_grid(pts)
#### Calculate the neutral spectrum
# phi for the equilibrium ancestral population
phiN = dadi.PhiManip.phi_1D(xx)
#Now do the population growth event.
phiN = dadi.Integratio... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Bertrand256
# Created on: 2017-12
from typing import List
from PyQt5 import QtGui
import bitcoin
import functools
import re
from PyQt5.QtCore import pyqtSlot, QAbstractTableModel, QVariant, Qt, QPoint
from PyQt5.QtGui import QKeySequence
from PyQt5.QtWidgets impo... | |
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Copyright (c) 2020 <NAME>. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE.chromium file.
import sys
import struct
from enum import Enum, IntEnum
from typing import TypeVar, Generic, ... | |
and ceiling lines
# The reason it is done this way is that it allows me to track physical
# location of each pixel (which is needed for zBuffer
# and correct overlapping of objects
floorLine = getLinePixels((x1, y1), (x2, y2))
ceilingLine = getLinePixels((x4, y4), (x3, y3))
newW = max(abs(x2 - x1) + 1, len(... | |
<reponame>PennyLaneAI/pennylane-pq<gh_stars>1-10
# Copyright 2018 Xanadu Quantum Technologies 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... | |
Return ``self/value``.
Availability
--------
Multiple GPUs, Multiple CPUs
"""
from ._ufunc import true_divide
return true_divide(self, rhs)
def __xor__(self, rhs):
"""a.__xor__(value, /)
Return ``self^value``.
Availability
--------
Multiple GPUs, Multiple CPUs
"""
from ._ufunc import bitwise_xor
... | |
342989, 343019, 343037, 343051, 343061,
343073, 343081, 343087, 343127, 343141, 343153, 343163, 343169,
343177, 343193, 343199, 343219, 343237, 343243, 343253, 343261,
343267, 343289, 343303, 343307, 343309, 343313, 343327, 343333,
343337, 343373, 343379, 343381, 343391, 343393, 343411, 343423,
343433, 343481, 343... | |
<reponame>bronreichardtchu/koffee
"""
NAME:
koffee.py
KOFFEE - Keck Outflow Fitter For Emission linEs
AUTHOR:
<NAME>
Swinburne
2019
EMAIL:
<<EMAIL>>
PURPOSE:
To fit gaussians to emission lines in 3D data cubes.
Written on MacOS Mojave 10.14.5, with Python 3
FUNCTIONS INCLUDED:
mock_data
... | |
# -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012-2016 GEM Foundation
#
# OpenQuake is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the Licen... | |
False
except TypeError as e:
logger.debug("make_transfer: money of wrong type")
self.make_report(
from_acc = payment['from_acc'],
to_acc = payment['to_acc'],
value = 0,
kind = payment['kind'],
name = payment['name'],
code = C_transfer_ERR,
message = e.message(),
meta = payment['meta']
)
return False
# fi... | |
#!/usr/bin/python
# Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
# Usage:
#
# $ INSTANCE=minnesota ./statewide_munis_lookup.py --help
#
script_name = ('Populate MN cities lookup')
script_version = '1.0'
__version__ = script_version
__author__ = 'Cyclop... | |
mutated AA
# ### got conflicts, engerineered mutation and expression tag examples
# cache_dir = ['pdbe', 'mutated_AA_or_NA']
# url = 'https://www.ebi.ac.uk/pdbe/api/pdb/entry/mutated_AA_or_NA/$index'
# pdbe_mut = fetch_from_web_api(url, pdbname, cache_dir)
# d['links'].append(Template(url).substitute(index=quote(s... | |
forAnalysis:
jobStatBrokerClouds.setdefault(previousCloud, {})
# use number of jobs in the cloud
jobStatBroker = jobStatBrokerClouds[previousCloud]
if site not in jobStatBroker:
jobStatBroker[site] = {}
if tmpProGroup not in jobStatBroker[site]:
jobStatBroker[site][tmpProGroup] = {'assigned':0,'activated':0,'run... | |
print("to_reject", type(to_reject))
print("to_reject ...(len)", len(to_reject))
print(np.take(peaklist, to_reject, axis=0))
print("to_reject2 ...(len)", len(to_reject2))
print(np.take(peaklist, to_reject2, axis=0))
print(np.take(peaklist, to_reject3, axis=0))
print("After fitting, {}/{} peaks have been rejected\... | |
<gh_stars>1-10
# coding: utf-8
"""
Apteco API
An API to allow access to Apteco Marketing Suite resources # noqa: E501
The version of the OpenAPI document: v2
Contact: <EMAIL>
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class ElementStatus(object):
"""NO... | |
float]]]
) -> np.float64:
"""
Function for calculating the log-likelihood for the sampled
parameter cube.
Parameters
----------
params : np.ndarray, pymultinest.run.LP_c_double
Cube with physical parameters.
prior : dict(str, tuple(float, float))
Dictionary with Gaussian priors for one or multiple
parameter... | |
:return: N x (T-1) x 7
"""
vos = []
for p in poses:
pvos = [calc_vo_relative_logq(p[i].unsqueeze(0), p[i+1].unsqueeze(0))
for i in range(len(p)-1)]
vos.append(torch.cat(pvos, dim=0))
vos = torch.stack(vos, dim=0)
return vos
def calc_vos_safe(poses):
"""
calculate the VOs, from a list of consecutive poses
:... | |
import os, sys
parentPath = os.path.abspath("..")
if parentPath not in sys.path:
sys.path.insert(0, parentPath)
from model.title import extractTitle
from converter.pdfextractor import PDFContainer
from model.location import Location
from config.dictionary import refWords, Coves, Seas, Bays, Islands
from model.keyword... | |
#!/usr/bin/env python3
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Copyright 2012 California Institute of Technology. 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... | |
<gh_stars>1-10
# coding=utf-8
from __future__ import absolute_import
import math
import tempfile
import webbrowser
from sys import platform
try:
from Tkinter import BooleanVar, OptionMenu, Frame, Radiobutton, StringVar, Label, Button, Text, END, Toplevel, WORD, \
Scrollbar, LEFT, RIGHT, Y
from tkFileDialog import ... | |
###############################
#
# (c) <NAME>, <NAME>, <NAME>, <NAME> 2017
# Student No: C14714071
# Course: DT228
# Date: 13-10-2017
#
# Title - Difference Checker
#
# Introduction:
# - The difference checker is an application created for the purpose of difference that exists
# in two images that are similar but have... | |
# coding: utf-8
# 本脚本copy到工程目录下,与工程文件同级即可
import sys
import time
import re
import requests
import json
import os
import smtplib
import platform
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from release_conf import config
# @params selectType 1:dev-test,2:dev-online,3:rc-online,4... | |
m.b2536 <= 1)
m.e4529 = Constraint(expr= m.b2537 + m.b2538 <= 1)
m.e4530 = Constraint(expr= m.b2537 + m.b2539 <= 1)
m.e4531 = Constraint(expr= m.b2537 + m.b2540 <= 1)
m.e4532 = Constraint(expr= m.b2537 + m.b2538 <= 1)
m.e4533 = Constraint(expr= m.b2538 + m.b2539 <= 1)
m.e4534 = Constraint(expr= m.b2538 + m.b2540 <= 1)
... | |
<filename>fhir/resources/STU3/tests/test_conceptmap.py<gh_stars>0
# -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/ConceptMap
Release: STU3
Version: 3.0.2
Revision: 11917
Last updated: 2019-10-24T11:53:00+11:00
"""
import io
import json
import os
import unittest
import pytest
from .. impo... | |
<filename>src/static.py<gh_stars>0
from collections import OrderedDict
from tempfile import NamedTemporaryFile
from warnings import warn
from datetime import date
from ftplib import FTP
import libarchive.public
import requests
import json
import csv
import re
import os
from .utils_static import *
from .parser import P... | |
in (get_previous_epoch(state), get_current_epoch(state))
assert data.target.epoch == compute_epoch_at_slot(data.slot)
assert data.slot + MIN_ATTESTATION_INCLUSION_DELAY <= state.slot <= data.slot + SLOTS_PER_EPOCH
committee = get_beacon_committee(state, data.slot, data.index)
assert len(attestation.aggregation_bi... | |
<gh_stars>1-10
# RNN implementation inspired by https://github.com/philipperemy/tensorflow-ctc-speech-recognition
import argparse
import collections
import os
import random
import time
from math import ceil
from os.path import join
import numpy as np
import tensorflow as tf
from constants import TRAIN_ROOT
from corpu... | |
from ROAR.control_module.controller import Controller
from ROAR.utilities_module.vehicle_models import VehicleControl, Vehicle
from ROAR.utilities_module.data_structures_models import Transform, Location
import numpy as np
import logging
from ROAR.agent_module.agent import Agent
from typing import Tuple
import json
fro... | |
<gh_stars>10-100
import pickle
import math
import re
import csv
import concurrent.futures
import os
from functools import reduce
from operator import add
import pandas as pd
import numpy as np
ROOT = "./mimic_database/"
## Utilities ##
def map_dict(elem, dictionary):
if elem in dictionary:
return dictionary[elem... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.