input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
m.ncp_t and 0 < kx <= m.ncp_x:
return m.dHge_dt[it, kt, ix, kx] == \
sum(m.ldot_t[jt, kt] * m.Hge[it, jt, ix, kx] for jt in m.cp_t if jt <= m.ncp_t)
else:
return Constraint.Skip
# Nse
def fdvar_t_nse(m, it, kt, ix, kx, c):
if 0 < kt <= m.ncp_t and 0 < kx <= m.ncp_x:
return m.dNse_dt[it, kt, ix, kx, c] == \
sum(... | |
Seismic Unix data files. It
currently can only read IEEE 4 byte float encoded SU data files.
"""
def __init__(self, file=None, endian=None, unpack_headers=False,
headonly=False, read_traces=True):
"""
:param file: A file like object with the file pointer set at the
beginning of the SEG Y file. If file is None, a... | |
#coding:utf-8
from datetime import datetime, date, time
import decimal
import re
import xlrd
import xlwt
from xlwt.Style import default_style
from simple_report.interface import ISpreadsheetSection
from simple_report.core.exception import XLSReportWriteException
from simple_report.core.spreadsheet_section import (
... | |
posx + (width - offset) / 2, posy + (height - offset) / 2, width < height ? height : width);
var fgcolor = $.rgbToHex($.map($.hexToRgb(color), function(dataAndEvents) {
return dataAndEvents * 0.3 >> 0;
}));
gradient.addColorStop(0, color);
gradient.addColorStop(1, fgcolor);
ctx.fillStyle = gradient;
}
if (borde... | |
constants = np.array([atrial_cycle_length, conduction_constant])
constants = np.stack([constants]*signals.shape[1], axis=1)
x_i = np.concatenate([signals, constants], axis=0)
y_i[:(n_Rwaves-1)] = intervals[:(n_Rwaves-1)]
idx3 = np.where(signals[2] == 1)[0]
cond_i = y_to_cond(idx3, signals.shape[1], y_i)
... | |
adhere to user-defined boundaries
such as dist, az, baz, id, or component matches. Don't actually remove
the traces from the stream but rather just collect indices we can use
to skip when plotting.
TODO add distance, azi and backazi skip criteria
:rtype: np.array
:return: returns an indexing list which can be u... | |
N.array([2,2,1])
transformations.append((rot, trans_num, trans_den))
rot = N.array([1,0,0,0,-1,0,0,0,-1])
rot.shape = (3, 3)
trans_num = N.array([1,1,1])
trans_den = N.array([2,2,2])
transformations.append((rot, trans_num, trans_den))
rot = N.array([-1,0,0,0,1,0,0,0,-1])
rot.shape = (3, 3)
trans_num = N.array([1,1,1])
... | |
'v_1'), ('t_3', 'v_4'), ('t_1', 'v_5'), ('t_2', 'v_1'), ('t_3', 'v_2'), ('t_1', 'v_3'),
('t_1', 'v_4'), ('t_2', 'v_6'), ('c_1', 'v_5'), ('t_2', 'v_3'), ('t_1', 'v_6'), ('c_1', 't_1'),
('t_3', 'v_5'), ('t_1', 'v_2'), ('c_1', 'v_4'), ('t_3', 'v_1'), ('c_1', 't_2'), ('t_2', 'v_4'),
('c_1', 'v_6'), ('t_2', 'v_2'), ('t_3... | |
<filename>scripts/mgear/synoptic/widgets.py<gh_stars>1-10
import re
from mgear.vendor.Qt import QtCore, QtWidgets, QtGui
from . import utils
##################################################
# PROMOTED WIDGETS
##################################################
# They must be declared first because they are used in ... | |
<gh_stars>0
import pytest
from dlapp.collection import Element
from dlapp.collection import LookupCls
from dlapp.collection import List
from dlapp.collection import ListIndexError
@pytest.fixture
def dict_data():
obj = {
"widget": {
"debug": "on",
"window": {
"title": "ABC Widget",
"name": "window abc",
"widt... | |
<gh_stars>0
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# Glidein creation module Classes and functions needed to
# handle dictionary files
#
import os,os.path,string,copy
import cgWConsts,cWConsts
import cWDictFile
import pwd
import shutil
from glideinwms.lib import condorPrivsep
MY_USERNAME=pwd.get... | |
pas d erreur
# role = Item_QModelIndex.data(QtCore.Qt.BackgroundRole) # ne retourne pas d erreur
# self.printSTD(role) # ne retourne pas d erreur
modelScript.setData(
modelScript.index(n, colIndex),
QtGui.QColor(QtCore.Qt.green),
QtCore.Qt.BackgroundColorRole
)
#===================... | |
# MIT License
#
# Copyright (c) 2021 <NAME>
#
# 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 limitation the rights
# to use, copy, modify, merge, publi... | |
import os
import numpy as np
import matplotlib
matplotlib.use('TkAgg')
import sys
import tkinter as Tk
import tkinter.filedialog
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.figure import Figure
from scipy.optimize import curve_fit
from scipy.signal import butter, lfilter
i... | |
#!/usr/bin/env python
"""
emr_simulator.py
Part of Dooplicity framework
Runs JSON-encoded Hadoop Streaming job flow. FUNCTIONALITY IS IDIOSYNCRATIC;
it is currently confined to those features used by Rail. Format of input JSON
mirrors that of StepConfig list from JSON sent to EMR via RunJobsFlow. Any
files input to a ... | |
test = {
'name': 'Problem 10',
'points': 2,
'suites': [
{
'cases': [
{
'code': r"""
>>> p0 = [2, 2, 3]
>>> p1 = [6, 1, 2]
>>> fastest_words(game(['What', 'great', 'luck'], [p0, p1]))
[['What'], ['great', 'luck']]
>>> p0 = [2, 2, 3]
>>> p1 = [6, 1, 3]
>>> fastest_words(game(['What', 'great', 'luck'], [p0, ... | |
import random as r
from time import sleep
import time as t
loading = ['Loading -', 'Loading \\', 'Loading |', 'Loading /']
for i in range(10):
for load in loading:
sleep(0.25)
print(f'\r{load}', end='')
print()
print("Welcome to...")
sleep(1)
print("""
▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄
▐░▌ ▐░▌▐░░░░░░░░░... | |
<gh_stars>1-10
"""
Functions to sort/combine nucleotide pairs/combine lines of multiline formats, and to revert combined formats to regular form
Usage:
genome_3nt.py FASTA_FILENAME FASTA_OUTPUT FASTQ_FILENAME FASTQ_OUTPUT
Options:
-FASTA_FILENAME fasta filename
"""
from numba.roc.hsaimpl import lower
from Utility.g... | |
<reponame>Xudewang/scarlet
import numpy as np
from astropy.visualization.lupton_rgb import LinearMapping, AsinhMapping
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle, Polygon
from matplotlib.ticker import MaxNLocator
from .bbox import Box
from .component import Component
def channels_to_rgb(... | |
<filename>tests/keras/layers/wrappers_test.py<gh_stars>100-1000
import pytest
import numpy as np
import copy
from numpy.testing import assert_allclose
from keras.utils import CustomObjectScope
from keras.layers import wrappers, Input, Layer
from keras.layers import RNN
from keras import layers
from keras.models import ... | |
Array code %(typelabel)s.
"""
# This version is expected to pass.
arrayfunc.pow(2%(decimalpoint)s, self.datax2a, self.dataout, matherrors=True)
# This is the actual test. There should be no exception on math errors.
arrayfunc.pow(2%(decimalpoint)s, self.datayovfl, self.dataout, matherrors=True)
##########... | |
""" MODULE images2swf
Provides a function (writeSwf) to store a series of PIL images or numpy
arrays in an SWF movie, that can be played on a wide range of OS's.
This module came into being because I wanted to store a series of images
in a movie that can be viewed by other people, and which I can embed in
flash pr... | |
<gh_stars>100-1000
import torch
import torch.nn as nn
import numpy as np
from functools import partial
import torch.nn.init as init
import torch.nn.functional as F
import math
from timm.models.layers import DropPath, to_2tuple
import torch
import torch.nn as nn
from timm.models.layers import trunc_normal_
import nump... | |
import math
import numpy as np
class NcsSections:
"""
Contains information regarding the contiguous sections of records in an Ncs file.
Methods of NcsSectionsFactory perform parsing of this information from an Ncs file and
produce these where the sections are discontiguous in time and in temporal order.
TODO: T... | |
<reponame>safdark/advanced-lane-lines<gh_stars>0
'''
Created on Dec 23, 2016
@author: safdar
'''
from operations.baseoperation import Operation
import numpy as np
from _collections import deque
import cv2
from operations.perspectivetransformer import PerspectiveTransformer
import math
from utils.plotter import Image
f... | |
# 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
# "License"); you may not use... | |
<filename>htmlapi_client.py
#
# Copyright (C) 2013 Comcast 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 ap... | |
minimum score for mapping to genome or past-end
minIdentity: (float) minimum %identity for mapping to genome or past-end
tileSize: (int) size of an alignment tile
stepSize: (int) distance between the starting bases of alignment tiles
(will overlap if stepSize<tileSize)
output_fp: (str) path to output_file
The be... | |
<filename>cdci_osa_plugin/osa_lightcurve_query.py
"""
Overview
--------
general info about this module
Classes and Inheritance Structure
----------------------------------------------
.. inheritance-diagram::
Summary
---------
.. autosummary::
list of the module you want
Module API
----------
"""
from __future__... | |
"""Make BIDS compatible directory structures and infer meta data from MNE."""
# Authors: <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
# <NAME> <<EMAIL>>
#
# License: BSD (3-clause)
import os
import errno
import shutil as sh
import pandas as pd
from collections import def... | |
For other parameters, this is always `FALSE`.
:param str is_modified: Indicates how the parameter was modified. If an `ALTER SYSTEM` was performed, the value will be `MODIFIED`.
:param bool is_pdb_modifiable: Indicates whether the parameter can be modified on a per-PDB basis (`TRUE`) or not (`FALSE`). In a non-CDB, t... | |
detail only within WPS output", \
# "WPS I/O title should be converted to CWL label of corresponding I/O from additional details"
assert "format" not in pkg["outputs"][1], "Omitted formats in CWL and WPS I/O definitions during deployment" \
"should not add them to the generated CWL package definition"
def test_dep... | |
"Project does not exist"
)
plan['project_id'] = project_id
def _create_machine__get_key_object(self, key):
from libcloud.utils.publickey import get_pubkey_openssh_fingerprint
key_obj = super()._create_machine__get_key_object(key)
fingerprint = get_pubkey_openssh_fingerprint(key_obj.public)
keys = self.connectio... | |
path if the 'output_folder' is not off of
'root_folder'. Defaults to 'output'.
formats (MutableMapping[str, FileFormat]): a dictionary of file_formats
and keys with the denovo str names of those formats. Defaults to the
global 'formats' variable.
parameters (MutableMapping[str, str]): keys are the denovo names of ... | |
for i in range(len(I_d_r_tr))]
if initdate < datetime(2020,6,15):
outliers_init = (datetime(2020,6,15)-initdate).days
outliers_end = (datetime(2020,6,19)-initdate).days
I_d_r_smooth=pd.DataFrame(I_d_r)
I_d_r_smooth = I_d_r_smooth.rolling(7, win_type='gaussian', min_periods=1, center=True).mean(std=2).round()
... | |
"""
The MIT License (MIT)
Copyright (c) 2016-2017 Elastic Email, Inc.
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 limitation the rights
to use, copy, mo... | |
<gh_stars>100-1000
# Copyright (c) 2009-2021 The Regents of the University of Michigan
# This file is part of the HOOMD-blue project, released under the BSD 3-Clause
# License.
"""Implement Table."""
from abc import ABCMeta, abstractmethod
import copy
from numbers import Integral
from math import log10
from sys impor... | |
h_obj = cf.create_checkcombo(hP, None, chk_list, has_all=len(chk_list)>1, first_line=first_line)
#
cb_func = functools.partial(self.checkComboUpdate, h_obj, chk_list, i_grp)
h_obj.view().pressed.connect(cb_func)
# sets the initial states
if any_sel:
for i_sel in [self.fields[i_grp][3].index(x) for x in ... | |
<reponame>charelF/ComplexSystems
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
from numba import njit, prange
import scipy
from scipy import special, spatial, sparse
import ... | |
except BillingContactInfo.DoesNotExist:
pass
super(EditBillingAccountInfoForm, self).__init__(data, *args, **kwargs)
self.helper = hqcrispy.HQFormHelper()
fields = [
'company_name',
'first_name',
'last_name',
crispy.Field('email_list', css_class='input-xxlarge accounting-email-select2',
data_initial=json.dum... | |
# coding=utf-8
from org.meteothink.chart.plot import Plot3D, GraphicFactory
from org.meteothink.chart import ChartText3D
from org.meteothink.legend import LegendManage, BreakTypes, PolylineBreak
from org.meteothink.shape import ShapeTypes, Graphic
from axes import Axes
import numjy as np
import plotutil
import datet... | |
<filename>st7735/test.py
import machine
from machine import Pin
import st7735
import time
import random
import vga1_8x8 as font
from struct import unpack
from struct import pack
import binascii
import sys
import uos
import network
import framebuf
# Subclassing FrameBuffer provides support for graphics primitives
# htt... | |
<reponame>thejasvibr/itsfm<gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Even though the spectrogram is one of the most dominant time-frequency
representation, there are whole class of alternate representations. This
module has the code which tracks the dominant frequency in a sound using
non-spectrogram methods.
The P... | |
<reponame>Joshuaalbert/bayes_filter
from .datapack import DataPack
import tensorflow as tf
import numpy as np
import os
from . import logging
from .plotting import DatapackPlotter
import pylab as plt
def callback_sequence(callbacks, args, async=False):
if async:
ops = []
for arg, callback in zip(args, callbacks):
... | |
"password": <PASSWORD>,
}
tls = {"ca_certs": cert_path, "tls_version": ssl.PROTOCOL_SSLv23}
topic = "devices/{}/messages/events/{}".format(
device_id, url_encode_dict(properties) if properties else ""
)
for _ in range(msg_count):
msgs.append({"topic": topic, "payload": data, "qos": int(qos)})
try:
publish.mul... | |
= 0
tot_mult_count = 0
all_mh_wgaps = {}
all_mh_wogaps = {}
with open ('%s/%s_out.txt'%(path, name), 'w') as mh_table:
# Wgaps includes mismatches
# Wogaps excludes mismatches
with open(align, 'r') as f:
logging.info('Opening ' + align)
reader = csv.reader(f, dialect='excel', delimiter='\t')
headers = next(re... | |
<reponame>marcelosalles/pyidf
""" Data objects in group "Setpoint Managers"
"""
from collections import OrderedDict
import logging
from pyidf.helper import DataObject
logger = logging.getLogger("pyidf")
logger.addHandler(logging.NullHandler())
class SetpointManagerScheduled(DataObject):
""" Corresponds to IDD ob... | |
ell_max=ell_max,
frameType=scri.Inertial,
dataType=data_type,
r_is_scaled_out=True,
m_is_scaled_out=True,
)
def single_mode_proportional_to_time_supertranslated(**kwargs):
"""Return WaveformModes as in single_mode_proportional_to_time, with analytical supertranslation
This function constructs the same basic o... | |
# display statistics every 100 iterations
#print(count)
if count%1000 == 0:
print('Its %d Collected %d/%d Acc %.3f L %.3f k %d Prec %f \n' % (count, \
sample, mcmc_samples, np.sum(acc)/np.sum(prop), marg_lik, k, prec))
# at each iteration: first make a copy of the current model
beta_prop = np.array(beta)
X_pro... | |
wikidata information relevant to deduplication into
bibliographical metadata, similar to CrossRef JSON format (but simplified) and feed the signature index
'''
metadata = {}
local_title = None
local_first_author = None
if "claims" in entity:
for the_property in entity["claims"]:
claims = entity["claims"][the_pr... | |
<gh_stars>1-10
# coding: utf-8
"""
Convenience methods wrapping openpyxl module for handling .xlsx file I/O.
(Despite the module name, this doesn't actually do any parsing of the file
format, but it attempts to intelligently interpret the content.)
"""
import logging
import math
import sys
from openpyxl import Workbo... | |
0) * ((epoch + 1) / self.epoch) # Eq. 21
r_idx = np.random.choice(list(set(range(0, self.pop_size)) - {idx}))
x_r = pop[r_idx][self.ID_POS]
# x_r = pop[np.random.randint(0, self.pop_size-1)][self.ID_POS]
if np.random.random() < 0.5:
x_new = beta * x_r + (1 - beta) * pop[idx][self.ID_POS]
else:
x_new = (1 - beta)... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import, unicode_literals
import copy, warnings
from os import path
from collections import OrderedDict
import itertools
import numpy as np
from scipy import stats, signal, interpolate
import matplotlib.pyplot as plt
... | |
"""
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""
import contextlib
import os
from typing import Optional, Sequence, Tuple, Union
import numpy as np
import torch
from skimage.transform impor... | |
rev_eds = _parser(_lexer(fmt))
self.assertEqual(result, _input(eds, rev_eds, inp))
@attr(platform='9-1_linux_intel')
@attr('input')
@attr(ed='E')
def test_e_ed_input_348(self):
inp = '''.'''
fmt = '''(E3.1E3)'''
result = [0.0000000000000000e+00]
eds, rev_eds = _parser(_lexer(fmt))
self.assertEqual(result, _i... | |
# Required for rest of hug scripts
from bitshares import BitShares
from bitshares.account import Account
from bitshares.amount import Amount
from bitshares.asset import Asset
from bitshares.blockchain import Blockchain
from bitshares.block import Block
from bitshares.dex import Dex
from bitshares.price import Price
fro... | |
#######################################################################################
### This is the RESTful API I will use for the Mercantile application.
### It includes Seven databases, The CLIENT TRIPS, the COMPANIES, the DRIVERS, the
### VEHICLES, DRIVER TRIPS, INDIVIDUAL TRIPS, and SELF TRIPS.
###############... | |
pass
return field_value
def _make_repr_table_from_sframe(X):
"""
Serializes an SFrame to a list of strings, that, when printed, creates a well-formatted table.
"""
assert isinstance(X, _SFrame)
column_names = X.column_names()
out_data = [[None] * len(column_names) for i in range(X.num_rows())]
column_size... | |
# param1: ptr to matrix 1
# param2: ptr to matrix 2
# param3: dim_x of matrix
# param4: dim_y of matrix
# param5: output ptr
builder = _setup_builtin_func_builder(ctx, "mat_add", (double_ptr_ty, double_ptr_ty, ctx.int32_ty, ctx.int32_ty, double_ptr_ty))
m1, m2, dim_x, dim_y, o = builder.function.args
with helpe... | |
res[...] = value
else:
res = constructNumpyArray(cls, obj, cls.spatialDimensions, cls.channels, dtype, order, init)
# FIXME: this should work for arbitrary many dimensions
if axistags is None:
if order == 'A' and not isinstance(obj, numpy.ndarray):
order = 'V'
if hasattr(obj, 'axistags'):
axistags = obj.axistag... | |
'object'},
'ScaleApplicationResult': {'additionalProperties': False,
'properties': {'error': {'$ref': '#/definitions/Error'},
'info': {'$ref': '#/definitions/ScaleApplicationInfo'}},
'type': 'object'},
'ScaleApplicationResults': {'additionalProperties': False,
'properties': {'results': {'items': {'$ref': '#/defin... | |
0] = minmax(re_fs[i+1, j-1, 0]+(3/16.0)*quant_error_b)
re_fs[i+1, j-1, 1] = minmax(re_fs[i+1, j-1, 1]+(3/16.0)*quant_error_g)
re_fs[i+1, j-1, 2] = minmax(re_fs[i+1, j-1, 2]+(3/16.0)*quant_error_r)
re_fs[i+1, j, 0] = minmax(re_fs[i+1, j, 0]+(5/16.0)*quant_error_b)
re_fs[i+1, j, 1] = minmax(re_fs[i+1, j, 1]+(5/16.0... | |
<gh_stars>0
import sys
sys.path.append('/root/csdc3/lib/ablib')
sys.path.append('/root/csdc3/src/logs')
sys.path.append('/root/csdc3/src/logs/config_setup')
sys.path.append("/root/csdc3/src/utils")
from ablib import Pin
from ablib import DS18B20
from chomsky import *
from time import sleep
from sensor_entropy import *
... | |
0, 0, 0, 0, 0, 0, 0,
0, 0.000, 0.000 ],
[ 0.1244, -0.6134, 0.1823, 0.3012, -0.1968, 0.1616, 0.1025,
-0.1972, 0.1162, -0.2079, -0.3062, 0.0585, -0.3286,
0.3187, -0.0812, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0 ],
[ 0.1832, -0.1559, -0.4327, 0.2059, 0.4677, 0.0317, 0.2233,
-0.3589, 0.2393, 0.2468, 0.0148, 0.11... | |
<gh_stars>1-10
import copy
from rpython.rlib import jit
from rpython.rlib.objectmodel import specialize
from topaz.celldict import CellDict, VersionTag
from topaz.coerce import Coerce
from topaz.module import ClassDef, check_frozen
from topaz.objects.functionobject import W_FunctionObject
from topaz.objects.objectobj... | |
-1.0, -1.0], [1.0, -1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0]]]]))
self.assertTrue(isinstance(res,Data),"wrong type of result.")
self.assertEqual(res.getShape(),(3, 2, 3, 4),"wrong shape of result.")
self.assertTrue(Lsup(res-ref)<=self.RES_TOL*Lsup(ref),"wrong result")
#++++++++++++++++++++++++++++++++++++++++++++++++++... | |
keeps reading forever
def __len__(self):
return 0 # so that the main() send loop is never entered
def append(self, text_and_image):
self.send_q.append(text_and_image)
def send_messages_forever(self):
# this will run in a separate thread
# the "sleep()" calls allow main thread more time for image capture
whil... | |
ORN1_ES = a_ORN1['ES'].values[0]
ORN1_parent_n = a_ORN1['parent_n'].values[0]
ORN1_offspring_n = a_ORN1['offspring_n'].values[0]
ORN1_N = (ORN1_parent_n + ORN1_offspring_n) / 2.
ORN1_parent_sd = a_ORN1['parent_std'].values[0]
ORN1_offspring_sd = a_ORN1['offspring_std'].values[0]
## Calculate pooled SD for O... | |
# ------------ Helper Functions -------------------------------------------------------------------------
#
# This file provides all necessary helper functions.
#
# ----- (0) Imports --------------------------------------------------------------------------------------
import random
import numpy as np
import keras
f... | |
filename and write it"""
def onAddCmdToViewer(self):
checkHasDpo(self.vf)
def __call__(self, outfile, **kw):
self.doitWrapper(*(outfile,), **kw)
def doit(self, outfile):
if not len(self.vf.dpo.receptor_stem):
self.vf.warningMsg("You must choose a macromolecule before writing dpf")
return 'ERROR'
#set sel... | |
import numpy as np
import pandas as pd
import logging
logger = logging.getLogger(__name__)
class SqFtProFormaConfig(object):
"""
This class encapsulates the configuration options for the square
foot based pro forma.
parcel_sizes : list
A list of parcel sizes to test. Interestingly, right now
the parcel sizes... | |
Meteorological Office, March 2006 halldor at vedur.is)
"""
# Cast key variables as float.
x=np.asarray(x, np.float_)
y=np.asarray(y, np.float_)
yp=np.zeros(y.shape, np.float_)
dx=x[1:] - x[:-1]
dy=y[1:] - y[:-1]
dydx = dy/dx
yp[1:-1] = (dydx[:-1] * dx[1:] + dydx[1:] * dx[:-1])/(dx[1:] + dx[:-1])
yp[0] = 2.0... | |
seqno, remote_cas, options, scope=None, collection=None):
# extra = struct.pack('>IIQQI', flags, exp, seqno, remote_cas, 0)
exp = 0
extra = struct.pack('>IIQQI', flags, exp, seqno, remote_cas, options)
scope, collection = self.collection_name(scope, collection)
return self._doCmd(cmd, key, value, extra, cas, scop... | |
<reponame>paleopresto/recommender
import json
import re
from sys import platform as _platform
import os
named_individuals, q_proxy_obs = None, None
periodic_table_elements, periodic_table_name = [], []
proxy_obs_map = {}
ignore_set = set()
unknown_proxy = set()
def initialize_input_data():
'''
q_proxy_obs stores th... | |
<filename>sigpy/block.py
# -*- coding: utf-8 -*-
"""Block reshape functions.
"""
import numpy as np
import numba as nb
from sigpy import backend, config, util
__all__ = ['array_to_blocks', 'blocks_to_array']
def array_to_blocks(input, blk_shape, blk_strides):
"""Extract blocks from an array in a sliding window m... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
r"""
Permutations template
This file define high level operations on permutations (alphabet,
the different rauzy induction, ...) shared by reduced and labeled
permutations.
AUTHORS:
- <NAME> (2008-12-20): initial version
.. TODO::
- construct as options different string representations for a permutation
- the t... | |
"v6.4.0": True,
"v6.4.1": True,
"v6.2.0": True,
"v6.2.3": True,
"v6.2.5": True,
"v6.2.7": True,
"v6.0.11": True
}
}
},
"revisions": {
"v6.0.0": True,
"v7.0.0": True,
"v6.0.5": True,
"v6.4.4": True,
"v7.0.1": True,
"v6.4.0": True,
"v6.4.1": True,
"v6.2.0": True,
"v6.2.3": True,
"v6.2.5": True,
"v6.2... | |
cutout.
"""
hdr = inhdr.copy()
wcskeys = ['ra', 'dec']
if self.wcsinfo is not None:
for j in range(1, self.wcsinfo.wcs.naxis + 1):
for key in ['ctype', 'crpix', 'crval', 'cunit', 'crota']:
wcskeys.append('%s%d' % (key, j))
for k in range(1, self.wcsinfo.wcs.naxis + 1):
for key in ['pc', 'cd']:
wcskeys.append(... | |
<reponame>davidryanshay/AIT-Core
import os.path
from unittest import mock
from unittest import TestCase
import pytest
import ait.core.server
from ait.core import cfg
from ait.core.server.handlers import *
from ait.core.server.server import Server
def teardown_module():
ait.config.reload(filename=os.environ["AIT_CO... | |
bilinear_test = form.test
else:
#
# Compare against reference test
#
assert bilinear_test.dofhandler() == form.test.dofhandler(),\
'The test functions of every bilinear form in the ' +\
'problem should have the same dofhandler.'
assert bilinear_test.subforest_flag()==form.test.subforest_flag(),\
'The tes... | |
list_constraints_for_portfolio(self, PortfolioId: str, AcceptLanguage: str = None, ProductId: str = None, PageSize: int = None, PageToken: str = None) -> Dict:
"""
Lists the constraints for the specified portfolio and product.
See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2... | |
'Secreted', 'Membrane', 'Protease', 'CAZyme']
header += uniqueNotes.keys()
header += ['Notes', 'gDNA', 'mRNA', 'CDS-transcript', 'Translation']
outfile.write('%s\n' % '\t'.join(header))
for k,v in sortedGenes.items():
for i in range(0,len(v['ids'])):
# for each new feature, start with empty lists
pfams = []
ipr... | |
# RESTAURANT DINING RESERVATION SYSTEM
# Program Description: This program utilizes the class RestaurantReservation to execute the user's desired choices.
# This program stores the restaurant reservation into the txt file named reservations.txt
# The txt file can be located at currentDirectory/reservartions/reservat... | |
if self.headless:
options.add_argument('--headless')
self['seleniumrc'] = selenium.webdriver.Chrome(
options=options,
service_args=['--log-path=chromedriver.log'])
WD_LAYER = WebdriverLayer(name='WebdriverLayer', bases=(HTTP_LAYER,))
WEBDRIVER_LAYER = gocept.selenium.WebdriverSeleneseLayer(
name='WebdriverSelene... | |
All input pixels are altered toward a set of
multiple points obtained from the two-dimensional
polynomial parabolic surface.
Third_Order-This technique tends to create a
smoother color change and uses less storage in
the auxiliary table, but it may take longer to
process compared to the color grid surface.... | |
_logger.error("Compartment not found: %s", cspec)
else:
cvols = comp.all_volumes()
vols += cvols
else:
# compartment specified with display name regexp
comps = sess.find_compartments(display_name=cspec)
if len(comps) == 0:
_logger.error("No compartments matching '%s' found", cspec)
else:
for comp in comps:
c... | |
profile layers_id
:type fp_id: str
:return: tuple
:rtype: (str, boolean, str, str)
"""
logger = logging.getLogger(skyline_app_logger)
function_str = 'ionoshere_backend.py :: features_profile_layer_algorithms'
trace = 'none'
fail_msg = 'none'
# fp_details = None
logger.info('%s :: getting MySQL engine' % f... | |
# 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 ... | |
ALTER VIRTUAL SCHEMA VS1 SET UNUSED = NULL
''')
self.query('''
SELECT PROPERTY_NAME, PROPERTY_VALUE FROM EXA_DBA_VIRTUAL_SCHEMA_PROPERTIES WHERE SCHEMA_NAME = 'VS1'
''')
self.assertEqual(0, self.rowcount())
def testDeleteOnlyOneProperty(self):
self.createFastAdapter(schemaName="ADAPTER", adapterName="FAST_ADAPT... | |
<gh_stars>0
from __future__ import print_function, division
from sympy.core import Basic, Dict, sympify
from sympy.core.compatibility import as_int, default_sort_key
from sympy.core.sympify import _sympify
from sympy.functions.combinatorial.numbers import bell
from sympy.matrices import zeros
from sympy.sets.sets impo... | |
to the front
print(spi, 'oa/ica search deg', graph.nodes[neinodes[0]]['deg'], graph.nodes[neinodes[0]]['pos'],
graph.nodes[spi]['pos'])
if graph.nodes[neinodes[0]]['deg'] == 1 and graph.nodes[neinodes[0]]['pos'][1] < \
graph.nodes[spi]['pos'][1]:
# if prednodes[spi]==oanodetype:
# print('oa/ica prob',probnodes[sp... | |
<filename>HEall.py
# AUTHOR: <NAME>
# CONTACT: <EMAIL>.
# --------------------------- LIBRARIES
import numpy as np
import pandas as pd
from scipy.sparse import csc_matrix
from scipy.sparse.linalg import spsolve, factorized
np.set_printoptions(linewidth=2000)
pd.set_option('display.max_rows', 500)
pd.set_option('displa... | |
<reponame>ghostchoir/fairseq_old
import copy
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Function
from .lsqquantize_V1 import Round
class ALSQPlus(Function):
@staticmethod
def forward(ctx, weight, alpha, g, Qn, Qp, beta):
# assert alpha > 0, "alpha={}".... | |
**kwargs
):
super(CloudErrorBody, self).__init__(**kwargs)
self.code = kwargs['code']
self.message = kwargs['message']
self.target = kwargs.get('target', None)
self.details = kwargs.get('details', None)
class TrackedResource(Resource):
"""The resource model definition for an Azure Resource Manager tracked top ... | |
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 23 17:18:39 2021
@author: Koustav
"""
import os
import glob
import matplotlib.pyplot as plt
import seaborn as sea
import numpy as np
import pandas as pan
import math
import collections
import matplotlib.ticker as mtick
from mpl_toolkits import mplot3d
from matplotlib.col... | |
on_error_event" %
(port, self))
else:
raise UnknownPortError("Unknown port '%s' in OutputThing %s" % (port, self)) from e
enq = self.__enqueue_fn__
if enq:
for s in connections:
enq(s.on_error, e)
else:
try:
for s in connections:
s.on_error(e)
except FatalError:
raise
except Exception as e:
raise ExcInDi... | |
import os
import sys
import pkg_resources
import numpy as np
from matplotlib.image import imread
import obrero.cal as ocal
import obrero.plot as oplot
import obrero.experimental.enso as oenso
# path where stored logo
DATA_PATH = pkg_resources.resource_filename('obrero', 'data/')
def _add_text_axes(axes, text):
"... | |
a position in a big, worth-while office. You’re not always going
to be a detective’s apprentice, are you?”
“You bet I am! Watcha talking about? Me leave F. Stone! Not on your
fleeting existence! But, never mind that part of the argument, I’ll
remember your offer, and some day, when I have a million dollars to
invest, ... | |
<filename>casper4/simple_casper.v.py
# Information about validators
validators: public({
# Amount of wei the validator holds
deposit: wei_value,
# The dynasty the validator is joining
dynasty_start: num,
# The dynasty the validator joined for the first time
original_dynasty_start: num,
# The dynasty the validato... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.