input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
import itertools
from functools import partial
from multiprocessing.pool import Pool
import pandas as pd
from cellphonedb.src.core.core_logger import core_logger
from cellphonedb.src.core.models.complex import complex_helper
def get_significant_means(real_mean_analysis: pd.DataFrame,
result_percent: pd.DataFrame,
... | |
<reponame>intel/acrn-workload-consolidation
import json
import base64
import os
import time
import paho.mqtt.client as mqtt
class MqttClient():
"""
This is a Mosquitto Client class that will create an interface to connect to mosquitto
by creating mqtt clients.
It provides methods for connecting, diconnecting, pu... | |
'Maxis'},
'6015881':{'en': 'Packet One'},
'6017':{'en': 'Maxis'},
'6016':{'en': 'DiGi'},
'6019':{'en': 'Celcom'},
'88018':{'en': 'Robi'},
'88019':{'en': 'Banglalink'},
'62562994':{'en': 'Esia'},
'62562991':{'en': 'Esia'},
'556399911':{'en': 'Vivo'},
'62562993':{'en': 'Esia'},
'62562992':{'en': 'Es... | |
<reponame>hodossy/pandas-extras
"""
Contains functions to help transform columns data containing complex types,
like lists or dictionaries.
"""
from functools import reduce
from itertools import zip_longest
import numpy as np
import pandas as pd
def extract_dictionary(dataframe, column, key_list=None, p... | |
<reponame>smaeland/ML-2HDM
# pylint: disable=C0303, C0103
## Class for a 2HDM model, contains parameters and computes xsec / BR
import os
import subprocess
import argparse
import h5py
import numpy as np
from glob import glob
from lhatool import LHA, Block, Entry
from dispatcher import Dispatcher
class Model(object)... | |
elevation,
5 - noise diode state, and
6 - channel [if argument chan=None; see get_boresight_data()]
* 'xpwr_metadata' is a 2D-array with a row for each configuration and columns::
0 - 'xpwr_cfg_id'
1 - UNIX time,
2 - rss_cfg_id,
3 - source_id,
4 - axis, and
5 - chan
"""
def __init__(self, parent, year, doy):... | |
<filename>src/sage/quivers/algebra.py
"""
Path Algebras
"""
from __future__ import absolute_import
#*****************************************************************************
# Copyright (C) 2012 <NAME> <<EMAIL>>
# 2013 <NAME> <<EMAIL>>
# 2014 <NAME> <<EMAIL>>
#
# Distributed under the terms of the GNU General Publ... | |
<reponame>jonathancross/specter-desktop
import base64
import datetime
import hashlib
import json
import logging
import secrets
from decimal import Decimal
from os import access
from typing import List
from urllib import request
from urllib.parse import urlparse
import pytz
import requests
from flask import current_app... | |
## dea_plotting.py
'''
Description: This file contains a set of python functions for plotting
Digital Earth Australia data.
License: The code in this notebook is licensed under the Apache License,
Version 2.0 (https://www.apache.org/licenses/LICENSE-2.0). Digital Earth
Australia data is licensed under the Creative ... | |
)
if index_species is None or spec in index_species:
forward_strand_start = c.forward_strand_start
forward_strand_end = c.forward_strand_end
try:
forward_strand_start = int( forward_strand_start )
forward_strand_end = int( forward_strand_end )
except ValueError:
continue # start and end are not integers, can't ... | |
in uvf.history
uvf2 = uvf.copy()
uvf2.flag_array = np.ones_like(uvf2.flag_array)
uvf.flag_array[0] = True
uvf2.flag_array[0] = False
uvf2.flag_array[1] = False
uvf3 = uvf | uvf2
assert pyuvdata_version_str in uvf3.history
def test_or_error():
uvf = UVFlag(test_f_file)
uvf2 = uvf.copy()
uvf.to_flag()
with ... | |
<gh_stars>1-10
# coding=utf-8
from .core import *
from collections import deque
from typing import Set, Tuple
import math
class GreedyShortestDeadlineFirstScheduler(BaseScheduler):
def __init__(self, sim: Sim,
incremental: bool = True, oracle=True,
admission_control_threshold_low: float = 0.8,
admission_contr... | |
"""This module contains all functions required to perform the visibility computations.
These computations are based on a paper by <NAME>, <NAME> and <NAME>:
Rapid Satellite-to-Site Visibility Determination Based on Self-Adaptive Interpolation Technique.
https://arxiv.org/abs/1611.02402
"""
# pylint: disable=too-many... | |
<filename>tests/p4transfer/test_move.py
from __future__ import annotations
import logging
import pytest
import p4transfer
@pytest.mark.parametrize("filetype", ["text", "binary"])
def test_move(source, target, default_transfer_config, filetype):
"""Test for replicating a basic move."""
original_file = source.loca... | |
AFTER incrementing
latest_row = append_row.commit()
max_segment_id = column.deserialize(latest_row[column.family_id][column.key][0][0])
min_segment_id = max_segment_id + 1 - step
segment_id_range = np.arange(min_segment_id, max_segment_id + 1,
dtype=basetypes.SEGMENT_ID)
return segment_id_range
def get_unique_... | |
"""Classes for efficient reading of multipage tif files.
PIL/pillow will parse a tif file by making a large number of very small reads. While this is in general perfectly fine
when reading from the local filesystem, in the case where a single read is turned into an http GET request (for
instance, reading from AWS S3),... | |
import os
import glob
import click
import pandas
import nibabel as nib
from .batch_manager import BatchManager, Job
from .config_json_parser import ClpipeConfigParser
import json
from pkg_resources import resource_stream, resource_filename
import clpipe.postprocutils
import numpy
import logging
import gc
import psutil
... | |
size_range = (256, 512)
# Pick one random number from the range of 0 and 255 (512 - 256)
oneside_length = sampling.pick_random_permutation(1, size_range[1] - size_range[0] + 1)[0]
# Add random number to size_range[0]
oneside_length = size_range[0] + oneside_length
y, x = x_or_probability.shape[:2]
# calculate the... | |
# ******************************************************************************
# pysimm.cassandra module
# ******************************************************************************
#
# ******************************************************************************
# License
# *************************************... | |
* j, 0), (step_col * j, self.size()[1]))))
j += 1
return lineFS
def logicalAND(self, img, grayscale=True):
if not self.size() == img.size():
print("Both images must have same sizes")
return None
try:
import cv2
except ImportError:
print("This function is available for OpenCV >= 2.3")
if grayscale:
retval ... | |
'''
Created on Dec 10, 2014
@author: Dxmahata
'''
__author__ = "<NAME>"
import requests
import sys
import json
API_REQUEST_COUNT = 0
#Base Url for calling Seen API
BASE_URL = "http://api.seen.co/v0.1"
#Setting up the endpoints
ENDPOINTS = {}
#setting up events endpoint
ENDPOINTS["events"] = {}
#setting up endpoi... | |
import pandas as pd
import numpy as np
import h5py
import os
from sklearn.model_selection import train_test_split
from sklearn.model_selection import StratifiedKFold
from pandas_plink import read_plink1_bin
from ..utils import helper_functions
from . import encoding_functions as enc
def prepare_data_files(data_dir: ... | |
<filename>backup.py<gh_stars>1-10
#!/usr/bin/env python
# (c) Copyright 2017 <NAME>
#
# Licensed under the MIT License
#
# 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, i... | |
# coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2019
import datetime
from tempfile import gettempdir
import streamsx.spl.op
import streamsx.spl.types
from streamsx.topology.schema import CommonSchema, StreamSchema
from streamsx.spl.types import rstring
import streamsx.spl.toolkit
from strea... | |
mod_attr_val_list:
setattr(mod, attr, val)
# end teardown_mocks
@contextlib.contextmanager
def patch(target_obj, target_method_name, patched):
orig_method = getattr(target_obj, target_method_name)
def patched_wrapper(*args, **kwargs):
return patched(orig_method, *args, **kwargs)
setattr(target_obj, target_method... | |
log2(L1) > time:
continue
L12 = L1 ** 2 // 2 ** l1
L12 = max(L12, 1)
tmp_mem = log2((2 * L1 + L12) + _mem_matrix(n, k, r))
if tmp_mem > mem:
continue
#################################################################################
#######choose start value for l2 such that resultlist size is close to L12####... | |
<reponame>baltham/dne-dna-code<gh_stars>1-10
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'st... | |
"pl85s5iyhxltk.cf",
"pl85s5iyhxltk.ga",
"pl85s5iyhxltk.gq",
"pl85s5iyhxltk.ml",
"pl85s5iyhxltk.tk",
"placemail.online",
"planet-travel.club",
"planeta-samsung.ru",
"plantsvszombies.ru",
"playcard-semi.com",
"playforfun.ru",
"playsbox.ru",
"playsims.ru",
"plexolan.de",
"plez.org",
"plgbgus.ga",
"plgbgus.... | |
# _core/test_base.py
"""Tests for rom_operator_inference._core._base.py."""
import os
import h5py
import pytest
import numpy as np
from scipy import linalg as la
import rom_operator_inference as opinf
from . import MODEL_FORMS, _get_data, _get_operators, _trainedmodel
class TestBaseROM:
"""Test _core._base._BaseR... | |
:type Width: int
:param Height: ้ช็ขงๅพไธญๅฐๅพ็้ซๅบฆ๏ผๅๅผ่ๅด๏ผ [128, 4096]๏ผๅไฝ๏ผpxใ
:type Height: int
:param ResolutionAdaptive: ๅ่พจ็่ช้ๅบ๏ผๅฏ้ๅผ๏ผ
<li>open๏ผๅผๅฏ๏ผๆญคๆถ๏ผWidth ไปฃ่กจ่ง้ข็้ฟ่พน๏ผHeight ่กจ็คบ่ง้ข็็ญ่พน๏ผ</li>
<li>close๏ผๅ
ณ้ญ๏ผๆญคๆถ๏ผWidth ไปฃ่กจ่ง้ข็ๅฎฝๅบฆ๏ผHeight ่กจ็คบ่ง้ข็้ซๅบฆใ</li>
้ป่ฎคๅผ๏ผopenใ
:type ResolutionAdaptive: str
:param SampleType: ้ๆ ท็ฑปๅ๏ผๅๅผ๏ผ
<li>Percent๏ผๆ็พๅๆฏใ</li>... | |
<reponame>SaptakS/api
import http.client
import json
import math
import re
import time
from dateutil.parser import parse as parse_date
import requests
import lz4framed
from sentry_sdk import configure_scope, capture_exception
from flask import current_app, request, make_response
from flask.json import jsonify
from ... | |
<gh_stars>0
import datetime
import hashlib
import io
import json
import logging
import os
import socket
import getpass
from base64 import b64encode
try:
from urlparse import urlunparse
except ImportError:
from urllib.parse import urlunparse
from smb.SMBConnection import SMBConnection
from smb.base import Operation... | |
run(self):
"""
Run resize-revert instance
"""
DLOG.verbose("Resize-Revert-Instance for %s." % self._instance.name)
context = None
if self._instance.action_fsm is not None:
action_data = self._instance.action_fsm_data
if action_data is not None:
context = action_data.context
nfvi.nfvi_resize_revert_instance(... | |
'classmate',
'jakarta.el-api',
'jakarta.el',
'jakarta.json',
'jsonp-jaxrs',
'hibernate-validator',
'hibernate-validator-cdi',
'pax-web-jetty-bundle',
'pax-web-extender-war',
'jmh-core',
'jmh-generator-annprocess',
'kryo',
'commons-logging',
'weld-se-core',
'weld-servlet',
'jakarta.validation-api',
'pax-... | |
corresponds to the ``instance_id_token`` field
on the ``request`` instance; if ``request`` is provided, this
should not be set.
task_id (:class:`str`):
Required. Unique identifier of the
task this applies to.
This corresponds to the ``task_id`` field
on the ``request`` instance; if ``request`` is provided, this... | |
implemented for indefinite forms.
- ``algorithm`` -- String. The algorithm to use: Valid options are:
* ``'default'`` -- Let Sage pick an algorithm (default).
* ``'pari'`` -- use PARI
* ``'sage'`` -- use Sage
.. SEEALSO::
:meth:`is_reduced`
EXAMPLES::
sage: a = BinaryQF([33, 11, 5])
sage: a.is_reduced()
... | |
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | |
__all__ = [
'RunExposure',
'RunFmTest',
]
import tempfile
import os
import csv
import shutil
from itertools import chain
import pandas as pd
from ..base import ComputationStep
from ..generate.keys import GenerateKeysDeterministic
from ..generate.files import GenerateFiles
from ..generate.losses import GenerateLoss... | |
'''
screen_kmers.py
Generate kmers of the target sequence and screen out ones that don't pass
the sequence composition rules, that overlap Ns, and that don't fall within
specified Tm range.
'''
from Bio import SeqIO
import sys
import os
import pandas as pd
import numpy as np
from Bio.SeqUtils import MeltingTemp as mt
i... | |
self._PolyOutList)
else:
outRec = self._PolyOutList[e.outIdx]
op = outRec.pts
if (toFront and _PointsEqual(pt, op.pt)) or (
not toFront and _PointsEqual(pt, op.prevOp.pt)
):
return
op2 = OutPt(outRec.idx, pt)
op2.nextOp = op
op2.prevOp = op.prevOp
op.prevOp.nextOp = op2
op.prevOp = op2
if toFront:
outRec.... | |
d[i]],
[0, 0, 0, 1]])
T = np.dot(T, A)
# print(A)
return T
def invdyn(rb, qc, qcdot, qcddot, grav):
z0 = np.array([[0], [0], [1]])
R = np.identity(3)
Q = np.zeros((rb.ndof, 1))
grav = grav.reshape(3,1)
w = np.dot(np.transpose(R), np.zeros((3, 1)))
wdot = np.dot(np.transpose(R), np.zeros((3, 1)))
vdot = np... | |
## @file
# This file is used to implement of the various bianry parser.
#
# Copyright (c) 2021-, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
##
from re import T
import copy
import os
from edk2basetools.FMMT.PI.Common import *
from edk2basetools.FMMT.core.BiosTreeNode impor... | |
#!/usr/bin/python3
# -*- coding:utf-8 -*-
# Project: http://cloudedbats.org
# Copyright (c) 2016-2018 <NAME>
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
import os
import logging
import time
import wave
import pyaudio
import wurb_core
def default_settings():
""" Available settings... | |
+= self.fc_reg * tf.reduce_sum(tf.square(self.W3[i]))
self.loss_reg = loss_em + loss_W1 + loss_W2 + loss_W3
if self.b_num == 3:
self.score_ipv, self.score_cart, self.score_buy = self._create_inference()
self.loss_ipv = tf.losses.log_loss(self.labels_ipv, self.score_ipv)
self.loss_cart = tf.losses.log_lo... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | |
<reponame>brtieu/python-sasctl<gh_stars>10-100
#!/usr/bin/env python
# encoding: utf-8
#
# Copyright ยฉ 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import io
import json
import os
import shutil
import tempfile
import uuid
import zipfile
try:
import swat
except ... | |
. I11i
if 63 - 63: iIii1I11I1II1 / ooOoO0o
if 24 - 24: Oo0Ooo / iIii1I11I1II1 % OOooOOo * OoOoOO00 - iIii1I11I1II1
if 50 - 50: II111iiii
if 39 - 39: II111iiii . OoOoOO00 - Oo0Ooo * i1IIi . OoooooooOO
if 44 - 44: I1IiiI
def oOO0O0O0OO00oo ( ) :
lisp . lisp_set_exception ( )
if 39 - 39: IiII % OoOoOO00 * I1ii11iIi... | |
5, 1, -5): (0, 1),
(9, 5, 1, -4): (0, 1),
(9, 5, 1, -3): (0, 1),
(9, 5, 1, -2): (0, 1),
(9, 5, 1, -1): (0, 1),
(9, 5, 1, 0): (-1, 1),
(9, 5, 1, 1): (-1, 1),
(9, 5, 1, 2): (-1, 1),
(9, 5, 1, 3): (-1, 1),
(9, 5, 1, 4): (-1, 1),
(9, 5, 1, 5): (-1, 1),
(9, 5, 2, -5): (0, 1),
(9, 5, 2, -4): (0, 1),
(9, 5, 2, -3... | |
import time
#ls.ch1_read gives motor status, read.value gives only temperature
def run_articulatus_test1(t=5, name = 'TD'):
x_list = [0.75]
y_range = [4.9, 5.125,10]
#y_offset
# Detectors, motors:
dets = [pil300KW]
waxs_arc = [6, 42, 7]
samples = ['RZ_T4_Tooth']
name_fmt = '{sample}'
# param = '16.1keV'
as... | |
initialize moveable object slots.
(try_end),
#MM
(call_script, "script_multiplayer_mm_reset_stuff_after_round"),
#Auto-lower squad-size if too many players
(try_begin),
(multiplayer_is_server),
(assign,":num_players",0),
(try_for_range, ":player_no", "$g_player_loops_begin", multiplayer_player_loops_end),
... | |
ax2=ax.twinx()
ax2.scatter(TimeAxis,
self.Meta['R_Cut'],
linewidths=4, label = 'R_Cut', color='g')
if Species is not None:
for x in Species:
ax2.scatter(TimeAxis,
self.Meta['Cut' + x],
linewidths=4, label = 'R_Cut' + x)
if Errors is True:
ax2.errorbar(TimeAxis, self.Meta['R_Cut'],
self.Err['R_Cut'], co... | |
from ratelimit.decorators import ratelimit
from datetime import timedelta
from dateutil.tz import tzutc
from io import StringIO
from link_header import Link as Rel, LinkHeader
from urllib.parse import urlencode
import time
from timegate.utils import closest
from warcio.timeutils import datetime_to_http_date
from werkze... | |
s_zj = surfSrc.zjSort
xt = surfTar.xiSort
yt = surfTar.yiSort
zt = surfTar.ziSort
k = surfSrc.sortSource % param.K # Gauss point
aux = numpy.zeros(2)
directKt_sort(Ktx_aux, Kty_aux, Ktz_aux, int(LorY),
numpy.ravel(surfSrc.vertex[surfSrc.triangleSort[:]]),
numpy.int32(k), s_xj, s_yj, s_zj, xt, yt, zt, m, mKc... | |
import requests
from rdflib import Graph, URIRef
from rdflib.namespace import RDF, SKOS
from rdflib.util import guess_format
from rdflib.exceptions import ParserError
from rdflib.plugins.parsers.notation3 import BadSyntax
import skosify
import os
import gzip
import json
import logging
from io import BytesIO
import zipf... | |
# coding: utf-8
# 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")... | |
>>
#@+node:ekr.20090126093408.33: *7* << Create the third column of widgets >>
# The var names must match the names in leoFind class.
table = (
("Entire Outline","entire-outline",wx.RB_GROUP),
("Suboutline Only","suboutline_only_flag",0),
("Node Only","node_only_flag",0),
("Selection Only","selection-only",0))... | |
<reponame>GanstaKingofSA/RenPy-Universal-Player<filename>python-packages/ost.py<gh_stars>1-10
# Copyright (C) 2021 GanstaKingofSA (Hanaka)
# 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 wit... | |
(
res_hash VARCHAR(64) NOT NULL,
ses_hash VARCHAR(64) NOT NULL,
traffic_mode VARCHAR(7) NOT NULL,
traffic_profile VARCHAR(4) NOT NULL,
host_ip VARCHAR(128) NOT NULL,
cpu INTEGER NOT NULL,
start_time TIMESTAMP NOT NULL,
end_time TIMESTAMP )"""
self.__tables['tcp_client_vip_metrics'] = """CREATE TABLE tcp_clien... | |
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import logging
import re
from google.appengine.api import users
from gae_libs.handlers.base_handler import BaseHandler, Permission
from ... | |
# coding: utf-8
"""
weasyprint.tests.test_api
-------------------------
Test the public API.
:copyright: Copyright 2011-2014 <NAME> and contributors, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from __future__ import division, unicode_literals
import os
import io
import sys
import math
import con... | |
``tile_type``.
:param tags: A list of strings holding tag values.
:param clip: A Boolean indicating if the result should be clipped
(default: False).
:param margin: ...
:param limit: A max. number of features to return in the result.
:param params: ...
:param selection: ...
:param skip_cache: ...
:param cluste... | |
<filename>tests/test_dataframe/test_set.py<gh_stars>10-100
import pytest
import raccoon as rc
from raccoon.utils import assert_frame_equal
def test_set_cell():
actual = rc.DataFrame({'a': [1, 2, 3], 'b': [4, 5, 6], 'c': [7, 8, 9]}, index=[10, 11, 12], columns=['a', 'b', 'c'],
sort=False)
# change existing value
... | |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
isbg scans an IMAP Inbox and runs every entry against SpamAssassin.
For any entries that match, the message is copied to another folder,
and the original marked or deleted.
This software was mainly written <NAME> <<EMAIL>>
and maintained by <NAME> <<EMAIL>> since
nov... | |
assert np.allclose(expected_grad_3, grad_out_3)
def test_changing_param_quantizer_settings(self):
""" Test that changing param quantizer settings takes effect after computing encodings is run """
model = SmallMnist()
# Skew weights of conv1
old_weight = model.conv1.weight.detach().clone()
model.conv1.weight = t... | |
<reponame>vritxii/machine_learning_labs
# -*- coding:utf-8 -*-
from __future__ import division
import math
import json
import random
import pprint
import scipy.misc
import numpy as np
from time import gmtime, strftime
from six.moves import xrange
import tensorflow as tf
import tensorflow.contrib.slim as slim
from tenso... | |
action_size = self.num_opt_phase
action_space = spaces.Box(0.0, 1.0, (action_size,), dtype=np.float32)
else:
print("internal error : not supported action type: action_type={}".format(self.action_type))
# ์ ํธ ์ฌ์ดํด์์ ๋น์จ๋ก ํ๋ค๋ฉด.... PPO...
#
# action_size = ์ต์ ์๊ฐ ์ด์ Phase ์
# self.cycle_length, self.min_sum, self.optim... | |
<reponame>ARM-DOE/warno
import datetime
import requests
import logging
import psutil
import json
import os
import dateutil.parser
from flask import Flask, request, render_template
from flask_migrate import Migrate, upgrade
from flask_migrate import migrate as db_migrate
from flask_migrate import downgrade
from WarnoC... | |
subprocess.check_output(executables, universal_newlines=True).splitlines()
pass
res_ = [x for x in set(candidates) - set(exclusions) if self.should_copy(x)]
with open(cache_filename, 'w', encoding='utf-8') as lf:
lf.write('\n'.join(res_))
return res_
def add(self, what, to_=None, recursive=True):
if 'java-1... | |
{}".format(type(not_found_)))
if payload_ is not None and not isinstance(payload_, (dict, Payload)):
raise Exception("Expected payload_ to be a Payload, received: {}".format(type(payload_)))
if tag_ is not None and not isinstance(tag_, (bytes, str)):
raise Exception("Expected tag_ to be a str, received: {}".forma... | |
free rotor entropy evaluation - used for low frequencies below the cut-off if qh=grimme is specified
def calc_freerot_entropy(frequency_wn, temperature, freq_scale_factor):
"""
Entropic contributions (J/(mol*K)) according to a free-rotor description for a list of vibrational modes
Sr = R(1/2 + 1/2ln((8pi^3u'kT/h^2))... | |
- m.x246 + 728.4*m.x971 + 364.2*m.x976 + 121.4*m.x981 == 0)
m.c1742 = Constraint(expr= m.x242 - m.x247 + 728.4*m.x972 + 364.2*m.x977 + 121.4*m.x982 == 0)
m.c1743 = Constraint(expr= m.x243 - m.x248 + 728.4*m.x973 + 364.2*m.x978 + 121.4*m.x983 == 0)
m.c1744 = Constraint(expr= m.x244 - m.x249 + 728.4*m.x974 + 364.2*m.x... | |
<filename>src/oci/data_catalog/models/term_relationship_summary.py
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0... | |
<gh_stars>0
from pyteal import *
import sys
class Constants:
"""
Constant strings used in the smart contracts
"""
Creator = Bytes("Creator") # Identified the account of the Asset creator, stored globally
AssetId = Bytes("AssetId") # ID of the asset, stored globally
amountPayment = Bytes("amountPayment") # Amoun... | |
<reponame>conzty01/RA_Scheduler
from unittest.mock import MagicMock, patch
from scheduleServer import app
import unittest
from helperFunctions.helperFunctions import stdRet, AuthenticatedUser
class TestSchedule_addNewDuty(unittest.TestCase):
def setUp(self):
# Set up a number of items that will be used for these t... | |
else 1
dist_hs = kwargs['dist_hs']
center = kwargs['center']
matrix_method = kwargs['matrix_method']
lh = ph * ch # length of helix
objtype = sf.obj_dic[matrix_method]
if 'rs' in matrix_method:
err_msg = 'the regularized family methods requires es==0. '
assert np.isclose(es, 0), err_msg
# create tail
movez =... | |
range(borders):
core.ChangeGC(
gc, xcffib.xproto.GC.Foreground, [self.conn.color_pixel(colors[i])]
)
rect = xcffib.xproto.RECTANGLE.synthetic(
coord, coord, outer_w - coord * 2, outer_h - coord * 2
)
core.PolyFillRectangle(pixmap, gc, 1, [rect])
coord += borderwidths[i]
self._set_borderpixmap(depth, pixmap, gc... | |
import angr
import pyvex
import claripy
from angr.errors import SimReliftException, UnsupportedIRStmtError, SimStatementError, SimUninitializedAccessError
from angr.state_plugins.inspect import BP_AFTER, BP_BEFORE
from angr.state_plugins.sim_action_object import SimActionObject
from angr.state_plugins.sim_action import... | |
if ul[0] >= self.heatmap_size[0] or ul[1] >= self.heatmap_size[1] \
or br[0] < 0 or br[1] < 0:
# If not, just return the image as is
target_weight[joint_id] = 0
continue
# # Generate gaussian
size = 2 * tmp_size + 1
x = np.arange(0, size, 1, np.float32)
y = x[:, np.newaxis]
x0 = y0 = size // 2
# The gaussian... | |
va='center')
plt.show()
def save_to_netcdf(self, out_path):
"""Saves the present state of the grid to a netCDF4 file
:param out_path: Path to the output file
:type out_path: str
"""
# Save the data to NetCDF:
ncout = Dataset(out_path, mode='w', format='NETCDF4')
# Create data dimensions:
ncout.createDimensi... | |
<reponame>gordonwatts/desktop-rucio<filename>tests/grid/test_datasets.py
# Test out everything with datasets.
from src.grid.datasets import dataset_mgr, DatasetQueryStatus
from src.grid.rucio import RucioException
from tests.grid.utils_for_tests import simple_dataset, dummy_logger
from time import sleep
import datetim... | |
<reponame>mattijsstam/osmnx<gh_stars>0
"""Interact with the OSM APIs."""
import datetime as dt
import json
import logging as lg
import re
import socket
import time
from collections import OrderedDict
from hashlib import sha1
from pathlib import Path
from urllib.parse import urlparse
import numpy as np
import requests... | |
self.cmd.cli_ctx.cloud.name
if cloud_name.lower() == "azurecloud":
from msrestazure.tools import resource_id
cluster_resource_id = resource_id(
subscription=self.context.get_subscription_id(),
resource_group=self.context.get_resource_group_name(),
namespace="Microsoft.ContainerService",
type="managedClusters",
... | |
#!/usr/local/bin/python
# -*- coding: utf-8 -*-
import wx
#import wx.lib.buttons as buttons
import PyDatabase
import images
import string
import MyValidator
from PhrResource import ALPHA_ONLY, DIGIT_ONLY, strVersion, g_UnitSnNum
import MyThread
import time
import types
import os
class FrameMaintain(wx.Frame):
def _... | |
import os
import math
import yaml
import sys
import argparse
import pathlib
import itertools
from copy import copy
from enum import Enum, IntEnum
from abc import ABC
import PIL
from reportlab.lib import utils
from reportlab.pdfbase import pdfmetrics
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase.... | |
1.00 12.82 ? 67 PRO B CB 1
ATOM 2259 C CG . PRO B 1 66 ? 60.392 -37.253 -0.989 1.00 13.96 ? 67 PRO B CG 1
ATOM 2260 C CD . PRO B 1 66 ? 59.044 -37.723 -1.305 1.00 13.95 ? 67 PRO B CD 1
ATOM 2261 N N . MET B 1 67 ? 58.515 -38.127 3.253 1.00 11.76 ? 68 MET B N 1
ATOM 2262 C CA . MET B 1 67 ? 57.708 -37.557 4.292 1.00... | |
<reponame>fyndata/lib-cl-sii-python<filename>cl_sii/cte/f29/data_models.py
"""
CTE Form 29 Data Models
=======================
"""
from __future__ import annotations
import dataclasses
import logging
from dataclasses import field as dc_field
from datetime import date
from typing import (
Any,
ClassVar,
Iterator,
... | |
<reponame>hashberg-io/bases
"""
Functions to generate random data.
"""
# pylint: disable = global-statement
from contextlib import contextmanager
from itertools import chain, islice
from random import Random # pylint: disable = import-self
from types import MappingProxyType
from typing import Any, Dict, Iterator, Map... | |
import numpy as np
import sys
import time
import gc
from sklearn import neighbors
from sklearn import svm
from sklearn.ensemble import BaggingClassifier, RandomForestClassifier
from sklearn.multiclass import OneVsRestClassifier
from sklearn.metrics import accuracy_score
from sklearn.tree import DecisionTreeClassifier
f... | |
in PHYSICAL kpc; deltaC is in units of critical density """
# return (3.0 * mass / (4.0 * np.pi * critical_density * deltaC))**(1./3.)
collectRadii = np.zeros(len(sim.Densities), dtype = np.float64) # empty array of desired densities in Msun/kpc**3
collectMasses = np.zeros(len(sim.Densities), dtype = np.float64) # ... | |
"""network3.py
~~~~~~~~~~~~~~
A Theano-based program for training and running simple neural
networks.
Supports several layer types (fully connected, convolutional, max
pooling, softmax), and activation functions (sigmoid, tanh, and
rectified linear units, with more easily added).
When run on a CPU, this program is m... | |
Entering".format(self.username))
if self.user_token is not None:
headers = {"Content-Type" : "application/json"}
data = {"token": self.user_token}
res = requests.post(BASEURL + "editor/loadtasks", headers=headers, data=json.dumps(data))
print('SERVER SAYS:', res.text)
print(res.status_code)
pkg = res.json()
if ... | |
<filename>data-utils/config.py
resources = [
{
"name": "mousephenotype.org",
"keywords": [],
"pmids": [
"27626380",
"24652767",
"24197666",
"25127743",
"25343444",
"24642684",
"21677750",
"22968824",
"22940749",
"22991088",
"25992600",
"22566555",
"23519032",
"22211970",
"24194600",
"26147094",
"24... | |
# Parent class to MassConservationApproach, SemiDiffusiveApproach, and GeneralApproach
import scipy
import numpy.linalg
import time
import math
import sys
class BistabilityFinder(object):
def __parent_run_optimization(self):
# get expression needed to evaluate the current subclass variable
self.__mangled_name = ... | |
<reponame>nomadcoder-a/sedr<filename>lemur/manage.py
from __future__ import unicode_literals # at top of module
import os
import sys
import base64
import time
import requests
import json
from gunicorn.config import make_settings
from cryptography.fernet import Fernet
from lockfile import LockFile, LockTimeout
from ... | |
# -*- coding: utf-8 -*-
"""
Created on Tue May 14 11:23:19 2019
@author: Lee
"""
"""Goal is to run the surrounding 4 models based on the geometry input:
The surrounding 4 models will have varying secondary air flow rate:
25%, 50%, 125%, 150%.
The output will be static, and will be used to compare the 10... | |
turns)
turns = getattr(target_ex[0], ModelOutput.TOK)[:predict_turn + 1]
setattr(target_ex[0], ModelOutput.TOK, turns)
if self._support_batch_size == 0:
if self._meta_specs:
batch, = batch
_, ex, predict_turn = batch
ex = [self._dataset[i] for i in ex]
if predict_turn is not None:
truncate_target(ex, predict... | |
<gh_stars>100-1000
from django.contrib.auth.models import User
from django.test import TestCase
from dfirtrack_config.forms import SystemImporterFileCsvConfigForm
from dfirtrack_main.models import Analysisstatus, Systemstatus, Tag, Tagcolor
class SystemImporterFileCsvConfigFormTagSpecificTestCase(TestCase):
"""syst... | |
t1 = (0,) * size
h1 = hash(t1)
del t1
t2 = (0,) * (size + 1)
self.failIf(h1 == hash(t2))
@bigmemtest(minsize=_2G + 10, memuse=8)
def test_index_and_slice(self, size):
t = (None,) * size
self.assertEquals(len(t), size)
self.assertEquals(t[-1], None)
self.assertEquals(t[5], None)
self.assertEquals(t[size - 1]... | |
<gh_stars>0
from typing import List, Optional, Tuple
from framework import CardType, DeckList, Disruption, Manager, Card, Game
class LynaManager(Manager):
# Invoked
aleister = Card("Aleister the Invoker", CardType.MONSTER)
invocation = Card("Invocation", CardType.SPELL)
meltdown = Card("Magical Meltdown", CardTyp... | |
<reponame>CloudChef/CloudEntries<gh_stars>0
# Copyright (c) 2021 Qianyun, Inc. All rights reserved.
import time
import os
import copy
from cloudify import ctx
from cloudify.exceptions import NonRecoverableError
from cloudify.utils import decrypt_password
from abstract_plugin.platforms.common.utils import validate_para... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.