input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
a sparse 'd' matrix of size (0,n).
b is a dense 'd' matrix of size (p,1). The default value is a
dense 'd' matrix of size (0,1).
Optionally, the interface can write a .task file, required for
support questions on the MOSEK solver.
Return values
solsta is a MOSEK solution status key.
If solsta is mosek.so... | |
mentalIndef,recvMental = self.getHistoryRelatedColumnData(phIndex,
"MentalHealthProblem", "has_mental_health_problem",
"mental_health_indefinite", "receive_mental_health_services")
substance, substanceIndef, recvSubstance \
= self.getHistoryRelatedColumnData(phIndex,
"SubstanceAbuseProblem", "has_substance_abuse_... | |
rf o rpi = r>
label(X,Z,rpi) :- label(X,Y,rf), label(Y,Z,rpi).
% rf o rd = rd
label(X,Z,rd) :- label(X,Y,rf), label(Y,Z,rd).
% rf o rdi = r> di si mi oi
label(X,Z,rpi) | label(X,Z,rdi) | label(X,Z,rsi) | label(X,Z,rmi) | label(X,Z,roi) :- label(X,Y,rf), label(Y,Z,rdi).
% rf o rs = rd
label(X,Z,rd) :- label(X,Y,rf),... | |
from .solver1d import *
# p coefficient functions
class Solver2d(Solver1d):
def __init__(self, equation):
super().__init__(equation)
# Equation dependent functions
self.flux_y = equation.flux_y
self.spectral_radius_y = equation.spectral_radius_y
def fd2(self, u):
u_star = np.ones(u.shape)
un_half = np.ones(... | |
<reponame>woodrow/pyoac
from pypy.tool.udir import udir
class AppTestMarshal:
def setup_class(cls):
tmpfile = udir.join('AppTestMarshal.tmp')
cls.w_tmpfile = cls.space.wrap(str(tmpfile))
def test_None(self):
import sys
hello = "he"
hello += "llo"
def func(x):
return lambda y: x+y
scopefunc = func(42)
impo... | |
"""
dataclasses
===========
Wrappers around Python's dataclasses to support slots and defaults.
License
-------
Copyright 2019 NEM
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:... | |
> -68:
return "moc bardzo dobra (" + str(rssi) + ")"
if rssi > -71:
return "moc dobra (" + str(rssi) + ")"
if rssi > -81:
return "moc słaba (" + str(rssi) + ")"
if rssi > -91:
return "moc bardzo słaba (" + str(rssi) + ")"
return info
def _wifi_frequency_info(mhz):
if str(mhz).startswith("2"):
return "2.4 GH... | |
"
r"the values are in the correct form with the acceptable values\)"
r": \['CBMC_Nth'\]",
):
gomc_control.write_gomc_control_file(
charmm,
"test_save_NVT_bad_variables_part_2.conf",
"NVT",
10,
300,
input_variables_dict={"CBMC_Nth": []},
)
with pytest.raises(
ValueError,
match=r"ERROR: The following input... | |
and reduced traces.
Positional arguments:
r: QRegistry
state: numpy array with the expected state of r
rdm0: numpy array with the expected reduced density matrix after
tracing out qubit 0.
rdm1: numpy array with the expected reduced density matrix after
tracing out qubit 1.
Keyworded arguments:
srt0: expected... | |
freq2:
if icpu not in freq1:
equal=False
break
ff1=float(freq1[icpu])
ff2=float(freq2[icpu])
if ff2!=0:
diff=ff1/ff2
else:
equal=False
break
if diff<0.98 or diff>1.02:
equal=False
break
if not equal:
if o=='con':
ck.out('CPU frequency changed over iterations:')
ck.out('')
i['fail_reason']='frequency ... | |
<gh_stars>10-100
import unittest
import datetime
from contextlib import contextmanager
import rfc3339
from falcon_heavy.core.context import (
make_specification_conversion_context,
make_request_conversion_context
)
from falcon_heavy.core.openapi import (
SchemaObjectType,
ComponentsObjectType
)
from falcon_heavy.... | |
"dv": Variable(
"Meridional velocity tendency", V_GRID + TIMESTEPS, "m/s", "Meridional velocity tendency", write_to_restart=True
),
"du_cor": Variable("Change of u by Coriolis force", U_GRID, "m/s^2", "Change of u due to Coriolis force"),
"dv_cor": Variable("Change of v by Coriolis force", V_GRID, "m/s^2", "Change ... | |
level += 1
self.exportLiteralAttributes(outfile, level, [], name_)
if self.hasContent_():
self.exportLiteralChildren(outfile, level, name_)
def exportLiteralAttributes(self, outfile, level, already_processed, name_):
pass
def exportLiteralChildren(self, outfile, level, name_):
if self.Name is not None:
showInde... | |
(3759*mckin**10)/mbkin**10)*q_cut**5)/mbkin**10 +
((-1710 + (271*mckin**2)/mbkin**2 + (11609*mckin**4)/mbkin**4 +
(16225*mckin**6)/mbkin**6 + (2709*mckin**8)/mbkin**8)*q_cut**6)/
mbkin**12 - ((-465 + (689*mckin**2)/mbkin**2 + (3797*mckin**4)/
mbkin**4 + (939*mckin**6)/mbkin**6)*q_cut**7)/mbkin**14 +
((-63 + (11... | |
<reponame>roshanba/mangal<gh_stars>0
XXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXX XXXXX XXXX XXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXX
XX XXXXXXXXXXXXXXX XXXXXXXXXXXX
XXXXXXXXXXXXX
XXXXXXXXXXXXX
XX XXXXXXX XXXXXXXXX
XX XXXXXX XXXXXXXX X XXXXXXXXXXXXXXX XXXX XXXXXXX XXX XXXXXX XXXX XXXXX XXXX
XXX XXXXXXX XX XXXXXX XXXXXXX XXX XXXXXXX... | |
import os
import pytz
import time
import datetime
import asyncio
import traceback
import subprocess
import importlib
import requests
from typing import Union, List
from pyrogram.types import Message
from pyrogram.errors import YouBlockedUser, MessageIdInvalid, PeerIdInvalid
from pyrogram.enums import ParseMode, ChatTy... | |
import argparse
import logging
import requests
import sqlite3
import sys
import time
from voussoirkit import backoff
from voussoirkit import betterhelp
from voussoirkit import httperrors
from voussoirkit import mutables
from voussoirkit import operatornotify
from voussoirkit import ratelimiter
from voussoirkit import ... | |
from enum import Enum
import random
from time import perf_counter
from .controller import ControllerTypes
from .utils import replace_subarray
class SwitchResponses(Enum):
NO_DATA = -1
MALFORMED = -2
TOO_SHORT = -3
UNKNOWN_SUBCOMMAND = -4
REQUEST_DEVICE_INFO = 2
SET_SHIPMENT = 0x08
SPI_READ = 0x10
SET_MODE =... | |
dist.write(' It is not required for loading .wav, .ogg or .opus files, which Panda3D can read out of the box.">\n')
dist.write(' <pkg-ref id="org.panda3d.panda3d.ffmpeg.pkg"/>\n')
dist.write(' </choice>\n')
#if not PkgSkip("OPENAL"):
# dist.write(' <choice id="openal" title="OpenAL Audio Plug-In" tooltip="OpenAL a... | |
== 2:
if ExternalEncoding:
encoding = ExternalEncoding
else:
encoding = 'utf-8'
return instring.encode(encoding)
else:
return instring
@staticmethod
def convert_unicode(instring):
if isinstance(instring, str):
result = quote_xml(instring)
elif sys.version_info.major == 2 and isinstance(instring, unicode):
... | |
180, 270):
raise ValueError("bad rotate value")
r = Rect(rect)
if r.isEmpty or r.isInfinite:
raise ValueError("rect must be finite and not empty")
_imgpointer = None
# -------------------------------------------------------------------------
# Calculate the matrix for image insertion.
# ---------------------... | |
"""
Utility functions for QS files.
"""
import traceback
import re
import math
import sys
import threading
import os
from PyQt6 import QtCore
from pineboolib.application import types, qsadictmodules
from pineboolib.core.utils import utils_base, logging
from pineboolib import application
from typing import (
Any,
... | |
must be either standard, daily, or anime")
elif method_name in ["sonarr_season", "sonarr_search", "sonarr_cutoff_search"]:
self.sonarr_options[method_name[7:]] = util.get_bool(method_name, method_data)
elif method_name == "sonarr_tag":
self.sonarr_options["tag"] = util.get_list(method_data)
elif method_final in pl... | |
= (
(0.5 + (self.bin_temp[:,12*year:12*(year+1)] -
self.modelprms['tsnow_threshold']) / 2) * bin_precsnow[:,12*year:12*(year+1)])
self.bin_acc[:,12*year:12*(year+1)] = (
bin_precsnow[:,12*year:12*(year+1)] - self.bin_prec[:,12*year:12*(year+1)])
# if temperature above maximum threshold, then all rain
(self.bin_pr... | |
<filename>greykite/common/viz/timeseries_plotting_mpl.py
# BSD 2-CLAUSE LICENSE
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# Redistributions of source code must retain the above copyright notice, this
# list of con... | |
val_f_ifWirelessSSIDAuthChangedCols: If op_ifWirelessSSIDAuthChangedCols is specified, the field named in this input will be compared to the value in ifWirelessSSIDAuthChangedCols using the specified operator. That is, the value in this input will be treated as another field name, rather than a constant value. Either t... | |
type: {type: map, values: double}}
- 3
- {fcn: u.mylt}
fcns:
mylt:
params: [{a: double}, {b: double}]
ret: boolean
do: {"<": [{m.abs: {"-": [a, 6.2]}}, {m.abs: {"-": [b, 6.2]}}]}
''')[0].action(None), ["1", "5", "3"])
self.assertEqual(PFAEngine.fromYaml('''
input: "null"
output: {type: array, items: string}
act... | |
= output[0]
return output
reconBaseline = ReconstructionModel(RECON_BASELINE)
reconModels = [ReconstructionModel(f) for f in NETWORKS]
reconPostModels = [ReconstructionModelPostTrain(name, file, inpainting)
for (name, file, inpainting) in POSTTRAIN_NETWORKS]
allReconModels = reconModels + reconPostModels
NETWO... | |
import numpy as np
import pandas as pd
from pylab import *
import pickle
import tensorflow as tf
import random
import os
from sklearn.model_selection import train_test_split
import matplotlib.lines as mlines
from random import randint
from sklearn import preprocessing
from sklearn.model_selection import KFol... | |
<reponame>Hartorn/airflow<filename>airflow/providers/google/cloud/hooks/spanner.py
#
# 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 f... | |
configFromProvisioningServer(self, serverBaseURL, deviceId, disableServerValidation=False):
if disableServerValidation:
ssl._create_default_https_context = ssl._create_unverified_context
url = serverBaseURL + '/GetWeaveProvisioningInfo?macAddr=%016X' % deviceId
with urllib.request.urlopen(url) as resp:
respData =... | |
<= 0)
m.c1972 = Constraint(expr= m.x1971 - m.b3020 <= 0)
m.c1973 = Constraint(expr= m.x1972 - m.b3020 <= 0)
m.c1974 = Constraint(expr= m.x1973 - m.b3020 <= 0)
m.c1975 = Constraint(expr= m.x1974 - m.b3020 <= 0)
m.c1976 = Constraint(expr= m.x1975 - m.b3020 <= 0)
m.c1977 = Constraint(expr= m.x1976 - m.b3020 <= 0)
m... | |
], 1 , 1 , 4 , 0 , 92 , (3, 0, None, None) , 0 , )),
(( 'RemoveHalftone' , ), 22, (22, (), [ ], 1 , 1 , 4 , 0 , 96 , (3, 0, None, None) , 0 , )),
(( 'SmoothCharacters' , 'Type' , ), 23, (23, (), [ (3, 1, None, None) , ], 1 , 1 , 4 , 0 , 100 , (3, 0, None, None) , 0 , )),
(( 'CleanNoise' , 'NoiseSize' , ), 24, (24, (... | |
<reponame>nakedible/vpnease-l2tp
from testbase import PersistTest
import testbase
import unittest, sys, datetime
import sqlalchemy.databases.sqlite as sqllite
import tables
from sqlalchemy import *
from sqlalchemy.engine import ResultProxy, RowProxy
from sqlalchemy import exceptions
class QueryTest(PersistTest):
... | |
<filename>nutils/mesh.py
# Copyright (c) 2014 Evalf
#
# 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, merg... | |
#!/usr/bin/env python
# File: dataset_misr.py
# Author: <NAME>, 5/7/13
#
# Readers and plotters for MISR data sets
#
# Copyright 2013-2015, by the California Institute of Technology. ALL
# RIGHTS RESERVED. United States Government Sponsorship
# acknowledged. Any commercial use must be negotiated with the Office
# of Te... | |
"location". This defaults to the empty string,
indicating that the application corresponds to the "root" of the
server.
protocol: The protocol to use for the URL scheme
(default: 'http')
port (int): The TCP port to simulate. Defaults to
the standard port used by the given scheme (i.e., 80 for 'http'
and 443 for ... | |
"▁Walker": 7032,
"▁850": 7033,
"▁1938": 7034,
"DM": 7035,
"▁Massachusetts": 7036,
"▁Pur": 7037,
"HI": 7038,
"▁2017-2018": 7039,
"▁55%": 7040,
"▁Liber": 7041,
"7,6": 7042,
"▁Harris": 7043,
"▁Hamburg": 7044,
"▁Bla": 7045,
"▁Mak": 7046,
"Ri": 7047,
"zh": 7048,
"▁Team": 7049,
"Tra": 7050,
"oka": 7051,
"... | |
#!/usr/bin/env python
"""
A headless open source tool for synchronizing users' name and emails between a
MySQL database and mailman server. Correct login credentials for the database
and mailman server must be provided in a '.env' file.
Python2 & Python3 compatible.
Author: <NAME>
"""
from __future__ import print_f... | |
Constraint(expr= - m.x18 + m.x33 + m.x36 + m.x39 + m.x42 + m.x45 - m.x48 - m.x60 - m.x75 - m.x119 + m.x120 == 0)
m.c23 = Constraint(expr= - m.x19 + m.x34 + m.x37 + m.x40 + m.x43 + m.x46 - m.x49 - m.x61 - m.x76 - m.x120 + m.x121 == 0)
m.c24 = Constraint(expr= - m.x3 - m.x21 - m.x33 + m.x48 + m.x51 + m.x54 + m.x57 - m.... | |
"""
Sweeps all the apple pick bagfiles and saves all the plots from a certain variable in a pdf,
and for a certain label (e.g. Succesful or Failure)
Created by: <EMAIL>
References:
https://stackoverflow.com/questions/38938454/python-saving-multiple-subplot-figures-to-pdf
"""
# ... System related packages
import os
im... | |
#fd[p].append("NAi1")
fd[p].append('')
else:
#fd[p].append("emmean nai")
fd[p].append('')
if gf in v[s]:
if sf in v[s][gf]['pec50mean']:
fd[p].append(v[s][gf]['pec50mean'][sf])
else:
#fd[p].append("NAi1")
fd[p].append('')
else:
#fd[p].append("pec50mean nai")
fd[p].append('')
if gf in v[s]:
if sf in v[s... | |
expected
@pytest.mark.django_db
@pytest.mark.parametrize(
"dry_run, adjustment_type, adjustment_amount, expected_rent, expected_amount_left",
[
# Save amount left
# Discount
(False, RentAdjustmentType.DISCOUNT, 100, Decimal(1827), Decimal(0)),
(False, RentAdjustmentType.DISCOUNT, 10000, Decimal(0), Decimal(8073... | |
["blue", "green", "blue", "green", "blue", "green", "blue", "green", "", "green"])
#
celldata = {}
for v_n in selected_v_ns:
#try:
Printcolor.green("\tInterpolating. grid: {} it: {} v_n: {} ".format(d3intclass.new_grid.grid_type, it, v_n))
celldata[str(v_n)] = d3intclass.get_int(it, v_n)
# except:
# celldata[st... | |
' or ", if True shlex
"""
if shlex is None:
matchobj = SHLEXRGX.match(colspecfieldstr)
shlex = bool(matchobj)
retval = None
if shlex:
shlexoutput = _shlex.split(colspecfieldstr, comments=False, posix=True)
if shlexoutput:
shlexword1 = shlexoutput[0]
retval = shlexword1
else:
raise ValueError(colspecfieldstr... | |
# -*- coding: utf-8 -*-
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBoo... | |
import argparse
import os
import logging
import random
import time
import torch
import torchvision
import torch.nn as nn
from sklearn import metrics
import matplotlib.pyplot as plt
from sklearn.svm import SVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.metrics import confusion_matrix
from datahelp... | |
def test_recommendTezConfigurations(self, os_listdir_mock, os_isdir_mock, os_exists_mock):
os_exists_mock.return_value = True
os_isdir_mock.return_value = True
os_listdir_mock.return_value = ['TEZ{0.7.0.2.3.0.0-2155}']
self.maxDiff = None
configurations = {
"yarn-site": {
"properties": {
"yarn.scheduler.minim... | |
fit_mask_bad.append(b)
if len(user_mask) > 0:
for i in user_mask:
ibad = np.where((lam_gal / (1.0 + z) >= i[0]) & (lam_gal / (1.0 + z) <= i[1]))[0]
for b in ibad:
fit_mask_bad.append(b)
if mask_metal:
# galaxy = interpolate_metal(galaxy,noise)
metal_mask_bad = metal_masker(lam_gal, galaxy, noise, fits_file)
... | |
import os
import requests
from typing import Optional, Union, Iterable, Mapping, Sequence
from platypush.plugins import Plugin, action
from platypush.schemas.mastodon import MastodonSchema, MastodonSearchSchema, MastodonAccountCreationSchema, \
MastodonAccountSchema, MastodonStatusSchema, MastodonFeaturedHashtagSchem... | |
any(check_rel):
QMessageBox().critical(self,
'Cell ID = Relative\'s ID', 'Some cells are '
'mother or bud of itself. Make sure that the Relative\'s ID'
' is different from the Cell ID!',
QMessageBox.Ok)
return None
elif any(check_buds_S):
QMessageBox().critical(self,
'Bud in S/G2/M not in 0 Generation number',... | |
<reponame>dfsp-spirit/cogload<gh_stars>1-10
import os
import pytest
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose
import brainload as bl
import brainload.freesurferdata as fsd
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
TEST_DATA_DIR = os.path.join(THIS_DIR, os.pardir, 'te... | |
"""
Script to define the classfiers from individual sensor streams
Input: Training and Test set
Output: Classfied data frame
Date: Sep 18, 2014
Author: <NAME>
"""
import os
import time
import math
import pandas as pd
from django.conf import settings
from sklearn.externals import joblib
from django_pandas.io import... | |
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Publi... | |
<filename>src/archive/tests/local_test_kfp_components.py
# Copyright 2021 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 ... | |
<reponame>bgusach/influxdb-python
# -*- coding: utf-8 -*-
"""Unit tests for misc module."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from datetime import timedelta
import json
import unittest
import warnings
i... | |
b"POST",
'{0}/__experiments/multiplot?from={1}&to={2}&points={3}'.format(
self.uri, '1412902262560', '1412988662560', 500),
json.dumps({'metrics': [{'entity_id': self.entity_id,
'check_id': check_id,
'metric': 'whut'}]}).encode("utf-8")))
self.assertEquals(resp.code, 200)
self.assertEquals(data['metrics'][0]['ty... | |
#!/usr/bin/env python
import sys
import apsw
import shlex
import os
import csv
import re
import textwrap
import time
import codecs
import base64
if sys.platform=="win32":
_win_colour=False
try:
import colorama
colorama.init()
del colorama
_win_colour=True
except: # there are several failure reasons, ignore the... | |
# -*- coding:utf-8 -*-
"""
=============================================================================
Provide Material Studio markup file class which do operations on these files.
=============================================================================
Written by PytLab <<EMAIL>>, August 2015
Updated by PytLab ... | |
# This program is in the public domain
"""
Join reflectivity datasets with matching intent/cross section.
"""
from __future__ import print_function
from copy import deepcopy
import numpy as np
from dataflow.lib import unit
from .refldata import Intent, ReflData, Environment
from .util import poisson_average, extend
... | |
#!/usr/bin/env python
import sys
import PyTango
from upgrade_utils import *
class Controller:
def __init__(self, type, file, kcls, name, id):
self.type = type
self.file = file
self.kcls = kcls
self.name = name
self.id = id
def __str__(self):
return "%s %s %s %s %s" % (self.type, self.file, self.kcls, self.... | |
<filename>tutorial_7_a_star_solved.py<gh_stars>0
# ------------------------------------------------------------------------------------------------
# Copyright (c) 2016 Microsoft Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation... | |
<reponame>wenfeifei/miniblink49
# Copyright (C) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this... | |
<filename>src/lotusCalender.py
import json
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtCore import Qt, QTime, QDate, pyqtSignal, QRect, QRectF, QObject, pyqtProperty, QDateTime
from PyQt5.QtGui import QColor, QPen
from PyQt5.QtWidgets import QPushButton, QWidget, QDialogButtonBox, QVBoxLayout, QHBoxLayout, \... | |
dict of additional parameters for the radial basis function used for q-out (q-space of output feature map).
See q_radial_basis_params but only for q-out.
Defaults to q_radial_basis_params.
:param q_in_radial_basis_params: A dict of additional parameters for the radial basis function used for q-in (q-space of input f... | |
""" Utilities for viewing MRI images and interactively identify electrodes
Includes version of OrthoSlicer3D code originally written by:
<NAME>, <NAME>, <NAME>
"""
from __future__ import division, print_function
from time import time
import itertools
from pandas import DataFrame as df
from mpl_toolkits.mplot3d import... | |
#------------------------------------------------------------------------------
# Copyright (C) 1996-2010 Power System Engineering Research Center (PSERC)
# Copyright (C) 2007-2010 <NAME>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | |
<reponame>Grey-Peters/IanPeters<gh_stars>0
#-------------------------------------------------------------------------
# Copyright (c) Microsoft. 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... | |
<filename>apps/logics/equipment.py
#-*- coding: utf-8 -*-
import math
import copy
import random
from apps.common import utils
from apps.config import game_config
from apps.models.user_equipments import UserEquipments
from apps.models.user_forge import UserForge
from apps.models.user_property import UserProper... | |
criterium suggested by Steven:
if abs(flux_opt_old-flux_opt)/np.abs(fluxerr_opt) < epsilon:
break
flux_opt_old = flux_opt
# reject any discrepant values; use [nsigma_inner] as the
# rejection criterium for the inner region defined by
# [mask_inner]; outside of that use [nsigma_outer]
sigma2 = (D - flux_opt * P... | |
often gives
better results.
transformation: bool, default = False
When set to True, a power transformation is applied to make the data more normal /
Gaussian-like. This is useful for modeling issues related to heteroscedasticity or
other situations where normality is desired. The optimal parameter for stabiliz... | |
<gh_stars>0
# Copyright (c) 2021 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | |
<filename>src/NLG/NonLocalGame.py
import math
from math import sqrt
import matplotlib.pyplot as plt
from qiskit.extensions import RYGate, RZGate, RXGate, IGate, CXGate
from sklearn.preprocessing import StandardScaler
from NLG.agents.BasicAgent import BasicAgent
from NLG.agents.DQNAgent import DQNAgent
from NLG.models... | |
"""
API for TensorFlow usage.
"""
import functools
import itertools
from typing import Any, Callable, List, Optional, Sequence, Tuple
import tensorflow as tf # type: ignore
from targetran._check import (
_check_shear_input,
_check_translate_input,
_check_crop_input,
_check_input_range,
)
from targetran._tf_funct... | |
#!/usr/bin/env python
################################################################################
#
# file_name_parameters
#
#
# Copyright (c) 10/9/2009 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to... | |
asv_to_taxa_dict = {}
taxa_to_asv_dict = {}
for line in taxonomy:
if 'Feature' not in line:
asv, taxa, _confidence = line.split('\t')
taxa = asv_taxa_clean_up(taxa, level)
if taxa:
if asv not in asv_to_taxa_dict:
asv_to_taxa_dict[asv] = taxa
else:
print('something wrong')
if taxa not in t... | |
#!/usr/bin/env/python
#
# -*- coding: utf-8 -*-
###
# Copyright (c) 2016, <NAME>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyrig... | |
import traceback, sys, time, signal, importlib, yaml, os, os.path, datetime
from pythreader import Task, TaskQueue, Primitive, synchronized, PyThread, LogFile
from webpie import Logged, Logger, HTTPServer, RequestProcessor, yaml_expand as expand, init_uid
from multiprocessing import Process, Pipe
import re, socket
se... | |
"rili": 36472,
"schop": 36473,
"svar": 36474,
"ást": 36475,
"école": 36476,
"āva": 36477,
"ıdır": 36478,
"Л": 36479,
"ской": 36480,
"▁Akt": 36481,
"▁Apel": 36482,
"▁Dragnea": 36483,
"▁Flüge": 36484,
"▁Giardia": 36485,
"▁Höf": 36486,
"▁Intensiv": 36487,
"▁Kız": 36488,
"▁Libro": 36489,
"▁Mwana": 36490,
... | |
i, bh_k in enumerate(bh_l):
if bh_k in astroA.activity_ratios.keys():
activity_num_np[i] += (len(astroA.res_d['area'][astroA.event_subsets[bh_k]]) / len(astroA.indices_d[bh_k])) * astroA.minute_frames
activity_num_added[i] += 1
activity_num_np /= activity_num_added
activity_i = np.argsort(activity_num_np)
acti... | |
<gh_stars>1-10
"""
Open Power System Data
Timeseries Datapackage
read.py : read time series files
"""
import pytz
import yaml
import os
import sys
import numpy as np
import pandas as pd
import logging
import zipfile
import csv
import re
from datetime import datetime, date, time, timedelta
import xlrd
from xml.sax im... | |
import unittest
from io import StringIO
import tempfile
import sift_pyx12.error_handler
#from sift_pyx12.errors import *
import sift_pyx12.x12file
class X12fileTestCase(unittest.TestCase):
def _get_first_error(self, x12str, ftype=None):
fd = self._makeFd(x12str)
errors = []
err_cde = None
err_str = None
src =... | |
<reponame>Joukahainen/finmarketpy
__author__ = 'saeedamen' # <NAME>
#
# Copyright 2016-2020 Cuemacro - https://www.cuemacro.com / @cuemacro
#
# 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... | |
nodetypes.DependNode ):
attrNode = PyNode( attrNode )
# #-- Second Argument: Plug or Component
# # convert from string to _api objects.
# if isinstance(argObj,basestring) :
# argObj = _api.toApiObject( argObj, dagPlugs=False )
#
# # components
# elif isinstance( argObj, int ) or isinstance( argObj, slice ):
# argObj ... | |
= {
"pools": [
{
"cbm": 0xf0,
"cores": [1],
"id": 1,
"name": "valid"
},
{
"cbm": 0xf,
"cores": [3],
"id": 8,
"name": "invalid"
}
]
}
with mock.patch('common.PQOS_API.check_core', new=check_core):
with pytest.raises(ValueError, match="Invalid core 3"):
ConfigStore.validate(data)
@mock.patch("common... | |
<gh_stars>10-100
from ...base import *
class HistoryMixin:
""" GeomDataObject class mix-in """
def __init__(self):
self._subobj_change = {"vert": {}, "edge": {}, "poly": {}}
def get_data_to_store(self, event_type="", prop_id="", info="", unique_id=False):
data = {}
unique_prop_ids = self._unique_prop_ids
o... | |
= M(content)
expected1 = Project('testproject_v1', 'https://url1.com/testproject',
revision='v1.0')
expected2 = Project('testproject_v2', 'https://url1.com/testproject',
revision='v2.0')
check_proj_consistency(m.projects[1], expected1)
check_proj_consistency(m.projects[2], expected2)
def test_project_clone_depth... | |
#!/usr/bin/env python3
from os import listdir
from os.path import join
from fnmatch import filter
from sys import exit
from datetime import datetime
from shared.random import Random
from shared.utils import *
from bot_utils import *
HELP_TEXT = """<b>Help:</b>
/help - This Message
/start - Start the Bot
/status - ... | |
"""
- Sets the CIE Tristimulus Standard Observer Angle as 2 degrees or 10 degrees.
The default at power-on is always 2 degrees.
Parameters
----------
angle : `RS_7_1.OBSERVER_ANGLE`
(default to DEG_2)
CIE Tristimulus Standard Observer Angle.
"""
msg = f"SOB{angle.value}"
self._com_cmd(msg)
self._raise_debu... | |
<reponame>i-m-vivek/iGibson
from flask import Flask, render_template, Response, request, session
import sys
import pickle
from gibson2.robots.turtlebot_robot import Turtlebot
from gibson2.robots.fetch_robot import Fetch
from gibson2.simulator import Simulator
from gibson2.scenes.gibson_indoor_scene import StaticIndoor... | |
lowest + can_replicate not in seen:
seen.add(lowest + can_replicate)
queue.append(lowest + can_replicate)
if lowest + can_replicate - 1 not in seen:
seen.add(lowest + can_replicate - 1)
queue.append(lowest + can_replicate - 1)
for exclude in xrange(0, min(remaining_budget, partial) + 1):
cand = get_expected(plac... | |
from copy import deepcopy
import json
import logging, logging.handlers
import sys
import uuid
from datetime import datetime
from io import BytesIO
from pprint import pformat
from time import time, sleep
from pymisp import MISPObject
###################################
def add_ips_to_cert_obj(mh, cert_data, ips):
... | |
<reponame>maxwellmattryan/cs-313e
# dependencies
import math
# point class used for triangle class
class Point(object):
# initialization of Point object
def __init__(self, x=0, y=0):
self.x = x
self.y = y
# handle print calling
def __str__(self):
return(f"({self.x}, {self.y})")
# given another point, other, ... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
import fileinput
import gettext
import os
import platform
import sqlite3
import subprocess
import tkinter as tk
from tkinter import *
if platform.system() == "Windows":
import winreg
if sys.version_info[0] < 3:
raise Exception("This bot works only with Python 3.x")
root ... | |
from numpy import isnan, take, any, all, logical_or, logical_and, logical_not, atleast_1d, \
asarray, argmin, argsort, abs, isfinite, dot#where
import numpy as np
# for PyPy
from openopt.kernel.nonOptMisc import where
from bisect import bisect_right
from FuncDesigner.Interval import splitDomainForDiscreteVariable
tr... | |
<filename>caldavclientlibrary/protocol/url.py
##
# Copyright (c) 2007-2016 Apple Inc. 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/L... | |
columns[0] ],
key="free-text-search",
visible=False,
filterable="standard" ) )
operations = []
use_paging = False
def build_initial_query( self, trans, **kwd ):
# Filter by latest installable revisions that contain tools with missing tool test components.
revision_clause_list = []
for repository in trans.sa_s... | |
<gh_stars>0
import dash
import dash_core_components as dcc
import dash_table
import dash_html_components as html
import dash_bootstrap_components as dbc
import pandas as pd
import os
from dash.exceptions import PreventUpdate
import dash_bio as dashbio
from src.processing import Processing
from src.dashView import init... | |
<reponame>dmopalmer/pds-tools
################################################################################
# julian.py - The Julian Library
#
# This is a set of routines for handing date and time conversions. It handles
# these time systems:
# UTC = Universal Coordinates Time, similar to Grenwich Mean Time, express... | |
# 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 agreed to in writing, softw... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.