input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<reponame>TugberkArkose/MLScheduler<filename>benchmarks/SimResults/combinations_spec_locality/cmp_perlbenchgamessbzip2calculix/power.py<gh_stars>0
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage'... | |
raritan.rpc
from raritan.rpc import (
Interface,
Structure,
ValueObject,
Enumeration,
typecheck,
DecodeException,
)
import raritan.rpc.event
import raritan.rpc.idl
import raritan.rpc.peripheral
import raritan.rpc.sensors
# interface
class DeviceManager(Interface):
idlType = "peripheral.DeviceManager:2.0.0"
... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Shared code between plugins.
Use python's help() for prettier help info.
"""
import gi
gi.require_version('Gimp', '3.0')
from gi.repository import Gimp
gi.require_version('Gegl', '0.4')
from gi.repository import Gegl
from gi.repository import GObject
from gi.repositor... | |
<filename>voodoopadplugins/scriptstuff/src/py2html.py
#!/usr/bin/python -u
# -*- coding: utf-8 -*-
""" Python Highlighter Version: 0.8
py2html.py [options] files...
options:
-h print help
- read from stdin, write to stdout
-stdout read from files, write to stdout
-files read from files, write to filename+'.htm... | |
<reponame>martok/py-symcircuit
import re
from typing import List, Dict, Set, Tuple, Union, Optional, Iterable
from sympy import StrPrinter, Eq, Symbol, symbols, Expr, Limit, cse
from sympy import Tuple as TTuple
from sympy.core.assumptions import _assume_defined
from sympy.printing.pycode import pycode
from sympy.solv... | |
"""
Class and function definitions for PieceWise Linear (PWL) representations
"""
import copy
import operator
from xml.dom.minidom import Document,Node
from probability import Distribution
from action import Action
CONSTANT = ''
class KeyedVector(dict):
"""
Class for a compact, string-indexable vector
@cvar epsilo... | |
<reponame>unitedstates/inspectors-general
#!/usr/bin/env python
import datetime
import itertools
import logging
import os
import re
from urllib.parse import urljoin, urlparse, urlunparse, urldefrag
from utils import utils, inspector, admin
# http://oig.hhs.gov/reports-and-publications/index.asp
archive = 1985
# opt... | |
<gh_stars>1-10
""" Destination.
Do not edit this file by hand.
This is generated by parsing api.html service doc.
"""
from ambra_sdk.exceptions.service import CanNotTrack
from ambra_sdk.exceptions.service import DupAetitle
from ambra_sdk.exceptions.service import FilterNotFound
from ambra_sdk.exceptions.service import... | |
#!/usr/bin/env python3
import re
import os
import sys
import json
import yaml
import glob
import shutil
import random
import logging
from pathlib import Path
logger = logging.getLogger('apiLogger')
path_to_src = Path(__file__, '../..').resolve()
path_to_data = path_to_src.joinpath('../data').resolve()
def find_path... | |
# coding: utf-8
# Author: <NAME>
# Contact: <EMAIL>
# Python modules
from PyQt5 import QtWidgets, QtCore, QtGui
from PyQt5.QtCore import pyqtSignal
import os
import time
import logging
import traceback
import copy
# Wizard modules
from wizard.core import launch
from wizard.core import assets
from wizard.core import u... | |
#########
# Copyright (c) 2017 GigaSpaces Technologies Ltd. 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 requi... | |
except Exception as ex:
print(ex)
if queue is not None:
queue.put(False)
if queue is not None:
queue.put(True)
def check_index_type(self, queue=None):
check_index_type = self.input.param("check_index_type", None)
try:
for index in self.fts_obj.fts_indexes:
type = index.get_index_type()
if type == check_inde... | |
# -*- coding: utf-8 -*-
import base64
import uuid
#from boto.s3.connection import S3Connection
#from boto.s3.key import Key
#from boto.exception import S3ResponseError
from mongoengine import (connect, Document, DictField, MapField,
ListField, StringField, IntField, URLField,
DynamicField)
from SuperGLU.Services.St... | |
of the variables
sage: TateAlgebra.create_key(ZZ)
Traceback (most recent call last):
...
TypeError: the base ring must be a p-adic ring or a p-adic field
sage: TateAlgebra.create_key(Zp(2), names=['x','y'], log_radii=[1])
Traceback (most recent call last):
...
ValueError: the number of radii does not match the ... | |
96: I11i + iIii1I11I1II1 % II111iiii
O00 = True
for Oo0o0ooOoO in oOoO0oOO . rloc_set :
if ( O00 ) :
oO0Ooo0OO = oOoO0oOO . print_eid_tuple ( )
oO0Ooo0OO = oOoO0oOO . star_secondary_iid ( oO0Ooo0OO )
oO0Ooo0OO += OOOOoO0O
Oo000o = i1
O00 = False
else :
oO0Ooo0OO , Oo000o , IIiiI1iii1 = ( "" , "" , "" )
if 45... | |
# Copyright © 2019. <NAME>. All rights reserved.
import numpy as np
import pandas as pd
from collections import OrderedDict
import math
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA
from sklearn.neighbors import NearestNeighbors
from sklearn.metrics import silhouette_score
from scipy.sp... | |
crypto, address, confirmations=1):
payload = {
"method": "get_credits",
"params": {
"filters": [
{"field": "address", "op": "==", "value": address},
{"field": "asset", "op": "==", "value": crypto.upper()},
]
},
"jsonrpc": "2.0",
"id": 0,
}
credits = self.authed_post_url(payload)['result']
payload = {
"me... | |
Shown in eq. 13
dii_avg : numpy.ndarray
Effective hard sphere diameter of the beads (i.e. groups or segments) in component (i.e. molecule) i.
epsilonii_avg : numpy.ndarray
Average bead (i.e. group or segment) potential well depth in component (i.e. molecule) i.
x0ii : numpy.ndarray
Matrix of sigmaii_avg/dii_eff
... | |
"""Tests for UI view permissions in the samplesheets app"""
from urllib.parse import urlencode
from django.conf import settings
from django.test import override_settings
from django.urls import reverse
from unittest import skipIf
# Projectroles dependency
from projectroles.app_settings import AppSettingAPI
from pro... | |
import sys
import os
import subprocess
import random
import math
import numpy
import sfpy
from .arithmetic import evalctx
from .arithmetic.canonicalize import Canonicalizer, Condenser
from .arithmetic import native, np
from .arithmetic import softfloat, softposit
from .arithmetic import ieee754, posit
from .fpbench i... | |
<reponame>xyTel/flowanalyzer-kubernetes<filename>flow_collector/netflow_v9.py
# Copyright (c) 2017, Manito Networks, LLC
# All rights reserved.
### Imports ###
import time, datetime, socket, struct, sys, os, json, socket, collections, itertools, logging, logging.handlers, getopt
from struct import *
from elasticsearch... | |
dihedrals:
for pb in p.bonded_to:
if pb is not p1 and p is not p2:
self.add_dihedral(pb, p, p1, p2, f)
for p in p2.bonded_to:
if angles:
if p is not p1:
self.add_angle(p1, p2, p, f)
if dihedrals:
for pb in p.bonded_to:
if pb is not p2 and p is not p1:
self.add_dihedral(p1, p2, p, pb, f)
if dihedrals:
for p... | |
== 'tty':
print(data)
return
if self.graphics == "zenity":
command = ['zenity', '--info', '--width=500', '--text=' + data]
elif self.graphics == "kdialog":
command = ['kdialog', '--msgbox', data]
else:
sys.exit(1)
subprocess.call(command, stderr=STDERR_REDIR)
def confirm_exit(self):
"""
Confirm exit from i... | |
"""Defines VehiclesManager class
----------------------------------------------------------------------------------------------------------
This file is part of Sim-ATAV project and licensed under MIT license.
Copyright (c) 2018 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.
For questions please contact:
<NAME> (etuncali [at]... | |
<reponame>HyunCello/Tutorial<gh_stars>1-10
#!/usr/bin/env python
"""driver_r1.py: ROS driver for Omorobot R1 and R1-mini"""
# For more information, please visit our website www.omorobot.com
# Want to discuss with developers using our robots? Please visit our forum website at http://omorobot1.synology.me
# Also note th... | |
tk.Label(box, text=x)
label.grid(column=2 * i, row=0,sticky="w")
self.labels.append(tk.StringVar())
menu = tk.OptionMenu(box, self.labels[i], *a)
menu.config(width="8")
menu.grid(column=i * 2 + 1, row=0, sticky="e")
self.labels[0].set(a[0])
self.labels[1].set(a[2])
#Decimal
label = tk.Label(box,... | |
query_block_size + memory_block_size)
indices = tf.range(0, index_length, delta=1, name="index_range")
indices = tf.reshape(indices, [1, -1, 1]) # [1, length, 1] for convs
kernel = tf.expand_dims(tf.eye(memory_block_size), axis=1)
gather_indices = tf.nn.conv1d(
tf.cast(indices, tf.float32),
kernel,
query_block_... | |
import torch
import torch.nn as nn
from lib.model.embedding import Embedding
class TemporalBlock(nn.Module):
"""
Reference 3D pose estimation model with temporal convolutions.
This implementation can be used for all use-cases.
"""
def __init__(self, num_joints_in, in_features, num_joints_out,
filter_widths, c... | |
the overall hit rate,
# instead of averaging the hit rates
#if info_by_band_pair[bp]["total_events"] == 0:
# info_by_band_pair[bp]["overall_hit_rate"] == 0
#else:
# info_by_band_pair[bp]["overall_hit_rate"] = info_by_band_pair[bp]["total_hits"]/info_by_band_pair[bp]["total_events"]
# Return info
return info_by... | |
ugsu = unique_game[s][u]
mrg = ugsu[-1]
game_problems = {}
for prevreport in ugsu[:-1]:
problems = set()
if mrg.is_inconsistent(prevreport, problems):
game_problems.setdefault(mrg, set()).update(problems)
if not game_problems:
self.gamesxref[mrg] = None
if mrg.section in self.matches:
for umkey in self.match... | |
88.2),
('b', 1, 23.3),
('c', 8, 42.0),
('d', 7, 100.9),
('c', 2))
actual = rowselect(table, lambda rec: rec['foo'] == 'a')
expect = (('foo', 'bar', 'baz'),
('a', 4, 9.3),
('a', 2, 88.2))
ieq(expect, actual)
ieq(expect, actual) # check can iterate twice
def test_selectre():
table = (('foo... | |
= pose_bones
for i, pmx_bone in sorted(enumerate(pmxModel.bones), key=lambda x: x[1].transform_order):
b_bone = pose_bones[i]
mmd_bone = b_bone.mmd_bone
mmd_bone.name_j = b_bone.name #pmx_bone.name
mmd_bone.name_e = pmx_bone.name_e
mmd_bone.is_controllable = pmx_bone.isControllable
mmd_bone.transform_order = pmx... | |
<gh_stars>0
#! /usr/bin/env python
import FWCore.ParameterSet.Config as cms
import sys
import os
import math
import re
import Validation.RecoTau.RecoTauValidation_cfi as validation
from optparse import OptionParser
from ROOT import *
__author__ = "<NAME> (<EMAIL>) and <NAME> (<EMAIL>)"
__doc__ = """Script to plot the... | |
if self.is_name_exists(
new_engine_id_name):
sg.Popup(
'{} is existing. Please '
'modify the name! You can '
'modify the config later thru '
'Engine->Manage->Edit'.format(
new_engine_id_name),
title=button_title,
icon=ico_path[platform]['pecg'])
continue
break
else:
sg.Popup('Please input engine id '
'nam... | |
None
if axis is None:
self.result = counts
elif axis == 'x':
if not raw_sum:
self.result = counts[[0], :]
else:
self.result = np.nansum(counts[1:, :], axis=0, keepdims=True)
elif axis == 'y':
if not raw_sum:
self.result = counts[:, [0]]
else:
if self.x == '@' or self.y == '@':
self.result = counts[:, [0]]
... | |
from gromet import * # never do this :)
# -----------------------------------------------------------------------------
# GroMEt instance
# -----------------------------------------------------------------------------
def generate_gromet() -> Gromet:
# ----- Metadata -----
# -- code span reference metadata
fil... | |
<filename>src/ur10_tests.py<gh_stars>0
# Adapted from ur5_reacher_6d.py
# Copyright (c) 2018, The SenseAct Authors.
# All rights reserved.
import time
import copy
import numpy as np
import sys
import baselines.common.tf_util as U
from multiprocessing import Process, Value, Manager, Queue
from baselines.trpo_mpi.trpo_... | |
predict_res = predict_once(data_fit, model, input_dim, time_step, predict_step)
predict_res = np.squeeze(predict_res)
step_to_train += predict_step
for i in range(predict_step):
data_list.append(predict_res[i])
step_to_train = step_to_train+step_high
if step_to_train <= low_step:
step_to_train = low_step
retu... | |
<reponame>zipated/src
# Copyright (C) 2013 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 list of c... | |
"""Objects representing distributions that can be sampled from."""
import collections
import itertools
import random
import math
import typing
import warnings
import numpy
import decorator
from scenic.core.lazy_eval import (LazilyEvaluable,
requiredProperties, needsLazyEvaluation, valueInContext, makeDelayedFunctio... | |
<filename>theme/views.py
from json import dumps
from django.contrib.auth.decorators import login_required
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login as auth_login
from dj... | |
fr.write('}\n')
except KeyError:
pass
fr.write('}\n')
fr.close() # close .tf file
if cde:
with open(rfilename) as f:
print f.read()
tfrm.write('terraform state rm '+tfp+'.'+rg+'__'+rname + '\n')
tfim.write('echo "importing ' + str(i) + ' of ' + str(count-1) + '"' + '\n')
tfcomm='terraform import '+tfp+'... | |
tableToMarkdown(
"Execute Job:", filtered_results, headers=headers, headerTransform=pascalToSpace
)
return CommandResults(
readable_output=readable_output,
outputs_prefix="Rundeck.ExecutedJobs",
outputs=filtered_results,
outputs_key_field="id",
)
def project_list_command(client: Client):
"""
This function r... | |
# coding=utf-8#
# Copyright (c) 2021, F5 Networks, 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... | |
#!/usr/bin/env python
# __BEGIN_LICENSE__
# Copyright (c) 2009-2013, United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All
# rights reserved.
#
# The NGT platform is licensed under the Apache License, Version 2.0 (the
# "License"); you may not use this ... | |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf8 -*-
# *****************************************************************
# ** PTS -- Python Toolkit for working with SKIRT **
# ** © Astronomical Observatory, Ghent University **
# *****************************************************************
## \package pts.c... | |
if form.is_valid():
form.save()
transaction.updated_by = request.user
transaction.save()
success_message(request, 'admin_edit_transaction', {})
admin_mail(request, 'transaction_updated',
{'transaction': transaction})
log_action(request, model_object=transaction,
action_flag=9, change_message='edited Transaction... | |
E501
List the complete time series of a person property. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.get_person_property_time_series_with_http_info(id_type_scope, id_type_code, code, property_key, async_req... | |
# -*- coding: utf-8 -*-
import os
import numpy as np
def _import_networkx():
try:
import networkx as nx
except Exception as e:
raise ImportError('Cannot import networkx. Use graph-tool or try to '
'install it with pip (or conda) install networkx. '
'Original exception: {}'.format(e))
return nx
def _import_... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import configparser
import os
import random
from string import ascii_letters, digits
from itertools import chain
import smtplib
from string import Template
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from gophish impor... | |
<reponame>WeZZard/BeanPorter<filename>src/BeanPorter/bpcml/BPCML.py<gh_stars>0
#!/usr/bin/env python3
from abc import abstractmethod
from typing import List, Dict, Set, Optional
import io
import yaml
import csv
import re
import os
import logging
from BeanPorter.bpcml.ASTContext import ASTContext
from BeanPorter.bpc... | |
<gh_stars>0
# Plotting specific imports:
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
## Plotting ##
def plot(x_name,y_names, x_array, y_arrays,y_axis, title='Figure',
legendlocation="best", y_colors=None,
y_format =None, x_format =None,figsize=(6,4),grid=True,formatter=False):
... | |
{7,D}
5 Ct u0 {1,S}
6 Cdd u0 {3,D}
7 Cd u0 {4,D}
8 S2d u0 {2,D}
""",
thermo = None,
shortDesc = u"""""",
longDesc =
u"""
""",
)
entry(
index = -1,
label = "Cs-C=S(Cds-Cdd-Cd)(Cds-Cds)Ct",
group =
"""
1 * Cs u0 {2,S} {3,S} {4,S} {6,S}
2 Cd u0 {1,S} {5,D}
3 CS u0 {1,S} {8,D}
4 Cd u0 {1,S} {7,D}
5 Cdd u0 {2,D} {... | |
#!/usr/bin/env python3
#----------------------------------------------------------------------------------------------------------------------#
# #
# Tuplex: Blazing Fast Python Data Science #
# #
# #
# (c) 2017 - 2021, Tuplex team #
# Created by <NAME> first on 1/1/2021 #
# License: Apache 2.0 #
#---------------------... | |
"""Module providing graphs available from KGOBO.
References
----------
Please cite:
```bib
@misc{kgobo,
title = "KG-OBO",
year = "2021",
author = "{<NAME> and <NAME>}",
howpublished = {\\url{https://github.com/Knowledge-Graph-Hub/kg-obo}},
note = {Online; accessed 14 September 2021}
}
```
"""
from ensmallen impo... | |
<reponame>kianheus/uwb-simulator
"""The main window of the UWBSimulator GUI
This file contains the code for the main window of the graphical user
interface (GUI) of the UWBsim. In the main window, simulation parameters
can be changed and the simulation can be started.
Classes:
MainWindow: The main window of the sim... | |
[]
for iwell in range(self.nwell):
well = self.wells[iwell]
ga_this = ga[self.posl[iwell]:self.posl[iwell]+self.nsizl[iwell]]
popl.append(ga_this.sum())
for ich in range(well.nchan):
if self.channels[iwell][ich] is not None: continue
k = (well.kchl[ich] * ga_this).sum()
kl.append(k)
if self.channels[iwell][ich... | |
cnt_odd = 0
for outcome, cnt in drow.counts.items():
if outcome[0][i] == outcome[0][j]: cnt_even += cnt
else: cnt_odd += cnt
exptn = float(cnt_even - cnt_odd) / total
fp = 0.5 + 0.5 * float(cnt_even - cnt_odd + 1) / (total + 2)
else:
raise NotImplementedError("Expectation values of weight > 2 observables are not... | |
type2="C224Y" type3="C235" type4="N239" k1="0.37656" k2="1.79912" k3="-1.21336" k4="0.0" periodicity1="1" periodicity2="2" periodicity3="3" periodicity4="4" phase1="0.00" phase2="3.141592653589793" phase3="0.00" phase4="3.141592653589793"/>
<Proper type1="N238" type2="C224I" type3="C235" type4="N239" k1="0.18828" k2="... | |
# Copyright 2014 Nervana Systems Inc., 2016 <NAME> 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 a... | |
for id in self.agent_map.values():
removeObject(id)
for o in self.handles:
for a in range(len(self.handles[o])):
h = self.handles[o][a]
if h is not None:
removeObject(h)
self.handles = {}
self.agent_map = {}
def draw_q(self, o, Q):
aa = Q[o] # get the action values
min_a = min(aa) # minimum of the action va... | |
{self.root}.")
@property
def root(self) -> Parameter:
"""Root of the hierarchical search space tree, as identified during
``HierarchicalSearchSpace`` construction.
"""
return self._root
def flatten(self) -> SearchSpace:
"""Returns a flattened ``SearchSpace`` with all the parameters in the
given ``Hierarchica... | |
<filename>Day 35/rain_alert/venv/lib/python3.9/site-packages/twilio/rest/messaging/v1/campaign.py
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.in... | |
``default_weight`` or 1) will be used
for all edges.
:param float default_weight: If ``weight_fn`` is not used this can be
optionally used to specify a default weight to use for all edges.
:param float null_value: An optional float that will treated as a null
value. This is the default value in the output matrix a... | |
import os
import importlib
import operator
import yaml
from core.checks import APTPackageChecksBase
from core import constants
from core.cli_helpers import CLIHelper
from core.log import log
from core.utils import mktemp_dump
from core.ystruct import YAMLDefOverrideBase, YAMLDefSection
class CallbackHelper(object):... | |
import os
import numpy as np
import h5py
import utils.normalization as normalization
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
import random
from scipy.spatial import ConvexHull
import functools
from scipy.spatial import Delaunay
import traceback
import sys
import tensorflow a... | |
k in (self.dyn_values[aname].dependencies or []):
self.debug("In update_dependencies(%s): "
" (%s,last read at %s, KeepTime is %s)"
%(aname,k,self._last_read.get(k,0),self.KeepTime))
old = self._locals.get(k)
updated = self.dyn_values[k].updated
if self.KeepTime and (
not updated or now>(updated+(self.KeepTime... | |
(data) = self.dettach_pickup_with_http_info(booking_id, **kwargs)
return data
def dettach_pickup_with_http_info(self, booking_id, **kwargs):
"""
Dettach a pickup location for a booking
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please define a `callback` fun... | |
<gh_stars>0
# -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2018.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-... | |
<filename>applications/connection_search/aciConSearch_test.py
################################################################################
# #
# Copyright (c) 2015 Cisco Systems #
# All Rights Reserved. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in c... | |
def head(self: DF, length: int = 5) -> DF:
"""
Get first N rows as DataFrame.
Parameters
----------
length
Length of the head.
Examples
--------
>>> df = pl.DataFrame(
... {
... "foo": [1, 2, 3, 4, 5],
... "bar": [6, 7, 8, 9, 10],
... "ham": ["a", "b", "c", "d", "e"],
... }
... )
>>> df.head(3)
shape... | |
k, v in self._generators.items()})
def generate(self,
size: Optional[int] = None,
key: Optional[str] = None,
context: Optional[ContextBase] = None) -> Any:
if self._with_context:
context = FlatContext()
if size is None:
return self.generate_record(key, context)
return [self.generate_record(key, context) for _... | |
"""
FIN module customisations for RLPPTM
License: MIT
"""
from collections import OrderedDict
from gluon import current, A, DIV, IS_EMPTY_OR, IS_INT_IN_RANGE, TAG
from core import FS, IS_ONE_OF, s3_str
ISSUER_ORG_TYPE = "pe_id$pe_id:org_organisation.org_organisation_organisation_type.organisation_type_id"
# ---... | |
= ' '.join([str(elem) for elem in output_INT_list])
print('Converted TXT to INTs:', npi, ' / ', nsi)
return output_INT_list, output_INT_string, npi, nsi
###################################################################################
def Tegridy_INT_to_TXT_Converter(input_INT_list):
'''Tegridy Intergers to ... | |
message.author != bot.user:
msg = message.content
if msg == "Within on stem.":
await asyncio.sleep(average_typing_speed * 3)
await message.channel.send("And dreadfully distinct.")
else:
pass
else:
pass
@bot.listen("on_message")
async def earth_diameter(message):
"""
"""
global average_typing_speed
if... | |
# -*- coding: utf-8 -*-
"""
Created on Tue Jun 9 14:10:25 2020.
@author: pielsticker
"""
import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow.keras import models
from tensorflow.keras import layers
from tensorflow.keras.initializers import glorot_uniform
from tensorflow.python.keras import bac... | |
<gh_stars>0
"""
This file reads in a pygsti dataset file and converts it to a valid
OpenQL sequence. FIXME: copy/paste error
"""
from os.path import join
import numpy as np
from pycqed.measurement.randomized_benchmarking import \
randomized_benchmarking as rb
from pycqed.measurement.openql_experiments import openql_h... | |
<reponame>Lingfeng-Wei/smart
import smart
import numpy as np
import sys, os, os.path, time
from astropy.table import Table
from astropy.io import fits
from numpy.linalg import inv, det
from ..utils.interpolations import trilinear_interpolation
###########################################################################... | |
<filename>linear_model/model_pick/random_forest/triplets_wei.py<gh_stars>0
import copy
import itertools
import re
import sys
from difflib import SequenceMatcher
import numpy as np
import pandas as pd
import scipy
import statsmodels.formula.api as sm
global tax_thr
tax_thr = 0
class Graph:
def __init__(self):
self.... | |
<filename>pygsti/tools/lindbladtools.py
"""
Utility functions relevant to Lindblad forms and projections
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms o... | |
<reponame>ChrisBarker-NOAA/tamoc<gh_stars>0
"""
Unit tests for the `particle_size_model` module of ``TAMOC``
Provides testing of the classes, methods and functions defined in the
`particle_size_models` module of ``TAMOC``. These tests check the behavior
of the class objects, the results of simulations, and the relate... | |
import collections
import subprocess
import contextlib
import warnings
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio import SeqIO
from Bio import BiopythonExperimentalWarning
with warnings.catch_warnings():
warnings.simplefilter('ignore', BiopythonExperimentalWarning)
from Bio import SearchIO
... | |
"""defines the BDF attributes"""
from __future__ import annotations
from collections import defaultdict
from typing import List, Dict, Optional, Any, Union, TYPE_CHECKING
from numpy import array # type: ignore
from pyNastran.utils import object_attributes, object_methods, deprecated
#from pyNastran.bdf.case_control_de... | |
document, preserving the order of the input documents in the combined document # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True
>>> thread = api.merge_document_pdf_with_http_info(input_file1, input_file2, async_req=True)
>>> resul... | |
+= 1
# We count the deleted contributions here too since they should have a corresponding addition contribution
self.assertEqual(num_expected_new_contributions + num_expected_new_deleted_contributions,
num_actual_new_contributions)
self.assertEqual(num_expected_new_deleted_contributions, num_actual_new_deleted_cont... | |
<reponame>pseudozach/lnbits-legend
import psycopg2
import sqlite3
import os
# Python script to migrate an LNbits SQLite DB to Postgres
# All credits to @Fritz446 for the awesome work
# pip install psycopg2 OR psycopg2-binary
# Change these values as needed
sqfolder = "data/"
pgdb = "lnbits"
pguser = "postgres"
pg... | |
<filename>wikigraphs/utils.py<gh_stars>1000+
# Copyright 2021 DeepMind Technologies Limited. 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/lic... | |
NetMRI.
:type EndTime: DateTime
| ``api version min:`` 2.5
| ``api version max:`` None
| ``required:`` False
| ``default:`` None
:param EndTime: The date and time the record was last modified in NetMRI.
:type EndTime: Array of DateTime
| ``api version min:`` 2.4
| ``api version max:`` 2.4
| ``required:`` F... | |
fail
status = fsf_write.CloseFile()
check_status("fsf_write.CloseFile", status)
assert (status == fsf.Status.SUCCESS)
def test_fsf_003_03(self):
"""
Exercise FSF 'Close File' API
Instantiate FSF using read utility, then CloseFile
"""
print("\n===================================================="
"\nTestFSFCl... | |
4): (0, 1),
(7, 3, -3, 5): (0, 1),
(7, 3, -2, -5): (-1, 1),
(7, 3, -2, -4): (-1, 1),
(7, 3, -2, -3): (-1, 0),
(7, 3, -2, -2): (0, 1),
(7, 3, -2, -1): (0, 1),
(7, 3, -2, 0): (1, 1),
(7, 3, -2, 1): (1, 1),
(7, 3, -2, 2): (1, 1),
(7, 3, -2, 3): (1, 1),
(7, 3, -2, 4): (1, 1),
(7, 3, -2, 5): (1, 0),
(7, 3, -1, ... | |
import os
import json
import mock
import pytest
from chalice.config import Config
from chalice import package
from chalice.constants import LAMBDA_TRUST_POLICY
from chalice.deploy.appgraph import ApplicationGraphBuilder, DependencyBuilder
from chalice.awsclient import TypedAWSClient
from chalice.deploy.deployer import... | |
<filename>PyLESA/heatpump.py
"""Heat pump module
Modelling a heat pump with modelling approaches of
simple, lorentz, generic regression, and standard test regression
"""
import os
import math
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf impor... | |
<reponame>cedricg92/event-manager
import datetime
import fnmatch
import gzip
import shutil
import tarfile
import time
import croniter
import hdfs
from watchdog.events import PatternMatchingEventHandler, FileCreatedEvent, FileModifiedEvent, FileMovedEvent, os, \
FileSystemEvent
def add_log_str(log_pattern, strlog):
... | |
import hashlib
import json
import logging
import uuid
from functools import wraps
from flask import redirect, Blueprint, abort, send_file, make_response, request
from prometheus_client import Counter
import features
from app import app, signer, storage, config_provider, ip_resolver, instance_keys
from auth.auth_con... | |
<filename>quantile_ml/utils_scoring.py
from collections import OrderedDict
import math
from quantile_ml import utils
import pandas as pd
from sklearn.ensemble import GradientBoostingRegressor, GradientBoostingClassifier
from sklearn.metrics import mean_squared_error, make_scorer, brier_score_loss, accuracy_score, expl... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2020-07-25 19:44:35
# @Author : <NAME> (<EMAIL>)
# @Link : http://iridescent.ink
# @Version : $1.0$
# from __future__ import print_fntion
import time
import torchlib as tl
import torchsar as ts
import torch as th
from torch.nn.parameter import Parameter
from col... | |
Wine": 0xB59F62,
"Apple-A-Day": 0x903F45,
"Appleblossom": 0xDAB5B4,
"Applegate": 0x8AC479,
"Applegate Park": 0xAEAD93,
"Applemint": 0xCDEACD,
"Applemint Soda": 0xF3F5E9,
"Applesauce": 0xF6D699,
"Applesauce Cake": 0xC2A377,
"Appletini": 0x929637,
"Appleton": 0x6EB478,
"Approaching Dusk": 0x8B97A5,
"Approval ... | |
assert result is True, "Testcase {} : Failed \n Error {}".format(
tc_name, result
)
step("Kill BGP on R2")
kill_router_daemons(tgen, "r2", ["bgpd"])
step(
"Verify that R2 keeps the stale entries in FIB & R1 keeps stale entries in RIB & FIB"
)
for addr_type in ADDR_TYPES:
protocol = "bgp"
next_hop = next_h... | |
= int(data.get("precision_id", None))
optimization_data.optimization_type_id = int(data.get("optimization_type_id", None))
optimization_data.dataset_id = int(data.get("dataset_id", None))
optimization_data.tuning_details = TuningDetailsInterface(data)
except ValueError:
raise ClientErrorException("Could not... | |
conference
Example: create simple conference::
conference_id = api.create_conference('+12018994444')
print(conference_id)
## conf-ixaagbn5wcyskisiy
Example: create conference with extra parameters::
conference_id = api.create_conference(from_ = "+12018994444", callback_url = "http://google.com",
callback_ti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.