input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>data/humu22768-sup-0001-suppmat/Supp_Data_S1/DataS1/Scripts/utils.py
'''
################################################################################################################
Manuscript Title: Evaluation of tools used to predict the impact of missense variants is hindered by two types of circularit... | |
the TAW array and returns it
:return: TAW array
"""
s = self._static
taw = s['taw']
return taw
def initialize(self):
"""
initialize the models initial state
:return:
"""
initial = initialize_initial_conditions_dict(self._cfg.initial_pairs)
self._info('Initialize initial model state')
m = self._maste... | |
<filename>looptime/loops.py
from __future__ import annotations
import asyncio
import selectors
import time
import weakref
from typing import TYPE_CHECKING, Any, Callable, MutableSet, TypeVar, cast, overload
_T = TypeVar('_T')
if TYPE_CHECKING:
AnyFuture = asyncio.Future[Any]
AnyTask = asyncio.Task[Any]
else:
AnyF... | |
<filename>contributions/api/controllers/contributions.py<gh_stars>1-10
# Copyright 2020 Board of Trustees of the University of Illinois.
#
# 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
#
# ht... | |
<reponame>gstoica27/Swin-Transformer<filename>models/csam.py
from __future__ import print_function
from calendar import c
import random
import pdb
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from positional_encodings import PositionalEncoding2D
"""
Modified from: ht... | |
<reponame>Sonam-1112/inventory_management_python
import tkinter as tk
from tkinter import *
# from My_Billing_Software import root
from tkinter.ttk import Treeview
from tkinter import ttk
from tkinter import Toplevel,messagebox
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
import seaborn as sns... | |
<gh_stars>10-100
#!/pxrpythonsubst
#
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and ... | |
for outputline in os.popen(comm_s).readlines():
print(outputline)
tokens = outputline.split()
if (len(tokens)>4):
if (tokens[1] == "peak"):
peak = float(tokens[3])
fprime_peak = float(tokens[7])
f2prime_peak = float(tokens[5])
elif (tokens[1] == "infl"):
infl = float(tokens[3])
fprime_infl = float(tokens[7]... | |
access to the openassetio.managerAPI.Host
object representing the process that initiated the API session.
@return `List[Dict[str, primitive]]` Attributes for each entity.
Values must be singular plain-old-data types (ie. string,
int, float, bool), keys must be strings.
"""
raise NotImplementedError
def setEnti... | |
import calendar
import math
import pandas as pd
import time
import twstock
import requests
from datetime import datetime, timedelta
from dateutil import relativedelta
from db.Connection import session
from enum import Enum
from model.StockHistory import StockHistory
from sys import float_info
from talib import abstract... | |
#
# ColorHandPose3DNetwork - Network for estimating 3D Hand Pose from a single RGB Image
# Copyright (C) 2017 <NAME>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the Li... | |
None:
raise ValueError('type must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
operation_id='create_gateway_virtual_connection')
headers.update(sdk_headers)
params = {
'version': self.version
}
data = {
'name': name,
'type': type,
... | |
<filename>thetis/coupled_timeintegrator.py
"""
Time integrators for solving coupled 2D-3D system of equations.
"""
from .utility import *
from . import timeintegrator
from .log import *
from . import rungekutta
from abc import ABCMeta, abstractproperty
import numpy
class CoupledTimeIntegratorBase(timeintegrator.TimeI... | |
of the tensor is reduced
by 1. If `keepdims` is `True`,
the reduced dimension is retained with length 1.
# Returns
A tensor with the standard deviation of elements of `x`.
"""
return T.std(x, axis=axis, keepdims=keepdims)
def var(x, axis=None, keepdims=False):
"""Variance of a tensor, alongside the specified ... | |
show event handlers on Check_MK Micro Core
if is_cmc and title == _("Event handlers"):
continue
elif not is_cmc and title == _("Alert handlers"):
continue
colvalue = siteline[i + 1]
url = defaults.url_prefix + ("check_mk/switch_master_state.py?site=%s&switch=%s&state=%d" % (siteid, colname, 1 - colvalue))
oncli... | |
import sys
import os
import random
import math
import warnings
import time
import numpy as np
import cv2
# This cv2 setting is needed since the transforms.Compose in torchvision
# doesn't work in multi-threaded mode when the cv2 is used. See here:
# https://github.com/pytorch/pytorch/issues/45198
# https://github.com... | |
jdbc_query_executor >= trash1
record_deduplicator >> trash2
pipeline = pipeline_builder.build(title='JDBC Query Executor').configure_for_environment(database)
sdc_executor.add_pipeline(pipeline)
try:
snapshot = sdc_executor.capture_snapshot(pipeline, start_pipeline=True).snapshot
sdc_executor.stop_pipeline(pipel... | |
"-c",
"advice.detachedHead=false",
"checkout",
"origin/" + branch]),
stderr=subprocess.STDOUT,
shell=True) # Jenkins hangs without this
for line in text.splitlines():
printer.string("{}{}".format(prompt, line.decode()))
checked_out = True
except subprocess.CalledProcessError as error:
printer.string("{}git re... | |
# /usr/bin/env python3.6
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are... | |
# Copyright 2020-2021 Canonical Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | |
<filename>build_tools/scripts/bazel_to_cmake.py
#!/usr/bin/env python3
# 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
#
# https://www.apache.org/licenses/LICENSE-... | |
the output. This is
# because the same compile error is likely present in other variations of the same shader and
# outputting the same error multiple times is not useful.
def _wait_all(self, ignore_output=False):
exception_description = None
while len(self.queue) > 0:
this_job_exception = self._wait_first(ignore... | |
(active_ctrl.operational != constants.OPERATIONAL_ENABLED))):
return
# Check the application state and take the approprate action
for app_name in constants.HELM_APPS_PLATFORM_MANAGED:
# Handle initial loading states
try:
app = kubeapp_obj.get_by_name(context, app_name)
status = app.status
except exception.Kub... | |
# -*- coding: utf-8 -*-
# (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import mock
import shutil
from schematics import Model
from schematics.types import IntType, StringType, ModelType
import pytest
from six import PY3
from stackstate_checks.checks import A... | |
>= 0)
if use.size == 0:
# There are no reference stars in this list of stars. That's okay!
useRefstars = False
else:
# Get good observations of reference stars
# This must be two steps because we first need the indices to
# avoid out-of-bounds
goodRefObsGO, = np.where((objRefIDIndex[obsObjIDIndexGO] >= 0) &
((... | |
import datetime
import random
import time
from typing import Optional, Union
import re
import aiohttp
import json
from os import environ
from discord import (
utils, Embed, Colour, NotFound, Activity, ActivityType, Forbidden, TextChannel, Webhook, AsyncWebhookAdapter
)
from discord.ext import commands, tasks
from dis... | |
<reponame>aieri/charm-nova-cloud-controller
# Copyright 2016 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | |
import datetime
import decimal
import json
import time
from unittest import skipIf
import django
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.utils import timezone
import stripe
from mock import Mock, patch
from ..actions import (
accounts,
charges,
coupons,
custome... | |
* Pending: The command has not been sent to the instance.
* In Progress: The command has been sent to the instance but has not reached a terminal state.
* Delayed: The system attempted to send the command to the target, but the target was not available. The instance might not be available because of network issues,... | |
entry.viewer()
self.assertEquals(set(result.keys()), all_params)
self.assertEquals(
result['queryer_attribute_urls'],
'{"layer_test": {"label": "%s"}}' % mapserv
)
result = entry.edit()
self.assertEquals(set(result.keys()), set(['lang', 'debug', 'extra_params']))
result = entry.editjs()
self.assertEquals(set(r... | |
lambda self, name: _swig_getattr(self, DaeBuilder, name)
__repr__ = _swig_repr
__swig_getmethods__["t"] = _casadi.DaeBuilder_t_get
if _newclass:
t = _swig_property(_casadi.DaeBuilder_t_get)
__swig_getmethods__["x"] = _casadi.DaeBuilder_x_get
if _newclass:
x = _swig_property(_casadi.DaeBuilder_x_get)
__swig_getm... | |
<reponame>UB-UNIBAS/fdb2eprints
from simple_elastic import ElasticIndex
from rdb_harvest import HarvestFDBData
from xml.etree import ElementTree as ET
from datetime import datetime
from itertools import zip_longest
import logging
import collections
import html
import os
import re
import json
import requests
from csv... | |
[c_void_p]
isl.isl_map_is_single_valued.restype = c_bool
isl.isl_map_is_single_valued.argtypes = [c_void_p]
isl.isl_map_is_strict_subset.restype = c_bool
isl.isl_map_is_strict_subset.argtypes = [c_void_p, c_void_p]
isl.isl_map_is_subset.restype = c_bool
isl.isl_map_is_subset.argtypes = [c_void_p, c_void_p]
isl.isl_map_... | |
longer have the same original meaning, as exampled below.
#
# Run the code cell below to normalize each numerical feature. We will use [`sklearn.preprocessing.MinMaxScaler`](http://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.MinMaxScaler.html) for this.
# In[7]:
# Import sklearn.preprocessing.St... | |
str,
message: Optional[str] = None):
"""
A Condition that may apply to a resource.
:param str last_transition_time: LastTransitionTime is the last time this condition transitioned from one status to another.
:param str reason: A Reason for this condition's last transition from one status to another.
:param str st... | |
<gh_stars>1000+
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import itertools
import re
from inspect import isclass, getdoc
try:
from collections.abc import OrderedDict, Hashable
except ImportError:
# TODO Remove this to drop Python2 support
from collections import OrderedDict, ... | |
import networkx as nx
import matplotlib.pyplot
import numpy as np
import pickle
from relax import nonzeroColumnMethodRelaxation
from random_strategy import greedyInitialStrategy
from random_strategy import randomStrategy
from random_strategy import enumerateAll
from max_iteration import maxIterationComb
from compute_re... | |
|0⟩⟨0| ⊗ |1⟩⟨1| + |1⟩⟨1| ⊗ Z`\n
:return: CZ gate (or controlled Pauli-Z gate)
:rtype: np.ndarray
"""
Pauli_Z_gate = QuantumCircuitMatrix.Pauli_Z_Gate()
return QuantumCircuitMatrix.CU_Gate(Pauli_Z_gate)
### Pauli gates ###
# Pauli-X gate for a single qubit
# (equivalent to the NOT gate for classical computers
... | |
different measures.
returns v, z, z_one_tailed, OrderedUniqueDoses, OrderedAverageValues
z and z_bwtn_mean are (1, Nmeasures) row vectors containing Z'- and
between-mean Z'-factors for the corresponding measures.
When ranges are zero, we set the Z' factors to a very negative
value."""
xs, avers, stds = loc_shr... | |
import os
import pandas as pd
import numpy as np
import pprint
import copy
from windc_data import *
from terminaltables import SingleTable
from textwrap import wrap
class WindcEnvironment:
_versions = {"windc_2_0_1": windc_2_0_1, "windc_2_1": windc_2_1}
_load_options = {
"windc_2_0_1": {
"bea_use",
"bea_supply"... | |
check_params_update_kwargs(params_dict, kwargs, 'auc', print_params)
a = self.do_json_request('2/AUC.json', timeout=timeoutSecs, params=params_dict)
verboseprint("\nauc result:", dump_json(a))
return a
def gbm(self, data_key, timeoutSecs=600, retryDelaySecs=1, initialDelaySecs=5, pollTimeoutSecs=30,
noPoll=False,... | |
# coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# 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 l... | |
"""
Module contains functions for solving for the steady state density matrix of
open quantum systems defined by a Liouvillian or Hamiltonian and a list of
collapse operators.
"""
__all__ = ['steadystate', 'steady', 'steadystate_floquet',
'build_preconditioner', 'pseudo_inverse']
import functools
import time
import ... | |
"Heraldic Mail with Surcoat", [("heraldic_armor_new_a",0)], itp_type_body_armor|itp_covers_legs, 0,
7800, weight(25)|body_armor(44)|leg_armor(15)|difficulty(15), imodbits_armor, init_heraldic_item("tableau_heraldic_armor_a")],
["byrnie_a_tunic", "Red Robe with Cape", [("byrnie_a_tunic",0)], itp_type_body_armor|it... | |
self.node[next_seed]['numStrongEdges'] += 1
self.node[one_neighbor]['numStrongEdges'] += 1
if self.node[one_neighbor]['numStrongEdges'] + 1 >= mu and self.node[one_neighbor]['category'] != 'core':
self.node[one_neighbor]['category'] = 'core'
self.core_nodes.add(one_neighbor)
'''check if the new core degree will m... | |
"""
Keras implementation of CapsNet in Hinton's paper Dynamic Routing Between Capsules.
The current version maybe only works for TensorFlow backend. Actually it will be straightforward to re-write to TF code.
Adopting to other backends should be easy, but I have not tested this.
Usage:
python capsulenet.py
python c... | |
= None
try:
conn = pypyodbc.connect(ODBC_STRING)
cur = conn.cursor()
except:
print(sys.exc_info()[1])
return
sql = ''' SELECT * FROM dbo.SysObjects WHERE ID = object_id(N'%s') AND OBJECTPROPERTY(ID, 'IsTable') = 1 ''' % table
cur.execute(sql)
for row in cur.fetchall():
ret = True
#cur.commit()
cur.close()... | |
is a
# writer, then use that instead.
pools = [pool for profile, pool in list(self._pools.items())
if profile in rw_profiles]
else:
# There are no readers or writers, indicating that
# the entire service is likely offline. In this case,
# we have no option but to bail out.
raise ServiceUnavailable("No servers a... | |
<filename>src/database/DatabaseIO.py
from datetime import datetime
from typing import List, Dict, Union
import mysql.connector
import os
import json
from src.utils.types import ItemGroup
class DatabaseIO:
cnx = None
def establishConnection(self) -> None:
try:
self.cnx = mysql.connector.connect(user=os.getenv('db... | |
<reponame>righthan/policy_diffusion
'''
module that contains Alignment class and sub classes
'''
from __future__ import division
import numpy as np
from numba import jit
import itertools
import abc
#TODO: use alignment algorithm
#repsrents two aligned pieces of text
class Alignment(object):
def __init__(self,left_... | |
# Pre Installed Imports
import os
from flask import Flask, templating, request, escape, session, redirect, make_response
from flask_wtf import FlaskForm
from flask_wtf.recaptcha import RecaptchaField
from wtforms import StringField, SubmitField, PasswordField
from wtforms.validators import DataRequired, Email, Eq... | |
import ast
import marshal
import os
import struct
import sys
import time
from types import ModuleType
import importlib
import importlib.abc, importlib.util, importlib.machinery
from . import prep
runner = ast.parse("""
import henrio as hio
_hio_interpret_call = hio._hio_interpret_call
load_hio = hio.load_hio
""", "<... | |
of points
``B = (b_1, b_2, ..., b_k)`` such that no element of ``G`` apart
from the identity fixes all the points in ``B``. The concepts of
a base and strong generating set and their applications are
discussed in depth in [1], pp. 87-89 and [2], pp. 55-57.
An alternative way to think of ``B`` is that it gives the... | |
This should avoid recording duplicate certificates.
# Unfortunately, crt.sh does not have fingerprints for comparison
# with Censys results.
if name_value not in collected_subdomains:
self.c.execute("INSERT INTO 'certificates' VALUES (NULL,?,NULL,?,NULL,NULL,NULL,?,?,?)",
(domain,issuer,start_date,exp_date,name_va... | |
#!/usr/bin/python
import sys, os
import numpy as np
currentpath = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..'))
sys.path.append(currentpath)
from TBotTools import pid, geometry, pgt
from time import time
import pygame
import pygame.gfxdraw
import pygame.locals as pgl
from collections import deque
fro... | |
'nucl_acid_amp' getter.")
return self._nucl_acid_amp
@nucl_acid_amp.setter
@enforce_string
def nucl_acid_amp(self, nucl_acid_amp):
"""
The setter for the nucleic acid amplification.
Args:
nucl_acid_amp (str): The nucleic acid amplification.
Returns:
None
"""
self.logger.debug("In 'nucl_acid_amp' setter.... | |
False
self.services[serv_id]['kill_chain'] = False
self.services[serv_id]['act_corr_id'] = None
self.services[serv_id]['message'] = None
# Add error field
self.services[serv_id]['error'] = None
return serv_id
#############################
# K8S Wrapper input - output
#############################
def k8s_... | |
sort_keys=True)
{"a": 0, "b": 0, "c": 0}
>>> from StringIO import StringIO
>>> io = StringIO()
>>> simplejson.dump(['streaming API'], io)
>>> io.getvalue()
'["streaming API"]'
Compact encoding::
>>> import simplejson
>>> simplejson.dumps([1,2,3,{'4': 5, '6': 7}], separators=(',',':'))
'[1,2,3,{"4":5,"6":7}]'... | |
<gh_stars>0
import napari
import numpy as np
import os
import pandas as pd
from pathlib import Path
from sampling import sample_tracks, sample_track_terminations, sample_objects
from skimage.measure import regionprops
from typing import Union, Iterable
from data_io import single_zarr
# ------------------
# SampleVie... | |
"""
This file is part of the Semantic Quality Benchmark for Word Embeddings Tool in Python (SeaQuBe).
Copyright (c) 2021 by <NAME>
:author: <NAME>
"""
from os.path import join, basename, dirname
import unittest
from seaqube.nlp.seaqube_model import SeaQuBeCompressLoader, BaseModelWrapper
from seaqube.nlp.... | |
currently registered': 'Nenhum relatório de Inundação atualmente registrado',
'No GPS data currently registered': 'No GPS data currently registered',
'No Groups currently defined': 'Não há Grupos definidos atualmente',
'No Groups currently registered': 'Nenhum Grupo atualmente registrado',
'No Homes currently regis... | |
<filename>problog/util.py
"""
problog.util - Useful utilities
-------------------------------
Provides useful utilities functions and classes.
..
Part of the ProbLog distribution.
Copyright 2015 <NAME>, DTAI Research Group
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file... | |
<reponame>scibian/radosgw-agent
import boto
import functools
import json
import logging
import os
import random
import socket
import sys
import urllib
from urlparse import urlparse
from boto.exception import BotoServerError
from boto.s3.connection import S3Connection
from radosgw_agent import request as aws_request
f... | |
<gh_stars>10-100
# Copyright 2020 Dynatrace 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 ... | |
'G*3b'
kaihimore(moves)
if oute.oute == 0:
depth1.append(moves)
if Bboard.B>0:
moves = 'B*3b'
kaihimore(moves)
if oute.oute == 0:
depth1.append(moves)
if Bboard.R>0:
moves = 'R*3b'
kaihimore(moves)
if oute.oute == 0:
depth1.append(moves)
if board.s3c =='':
if Bboard.P>0 and (Bboard.b3b !='P' and Bboard.... | |
<reponame>DeanKamen/I-BERT-for-HUBERT<gh_stars>10-100
# coding=utf-8
# Copyright (c) 2019, NVIDIA CORPORATION. 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://... | |
<filename>cloudbridge/providers/gcp/resources.py
"""
DataTypes used by this provider
"""
import hashlib
import inspect
import io
import logging
import math
import re
import uuid
from collections import namedtuple
import googleapiclient
from cloudbridge.base.resources import BaseAttachmentInfo
from cloudbridge.base.re... | |
than current'),
# ('F', 'Create from selection'),
('R', 'Retrieve selection'),
('S', 'Store selection'),
('ESC or RIGHTMOUSE', 'exit when done')
])
elif action == 'wall':
self.feedback.instructions(context, "Select Polygons", "Click & Drag to select polygons in area", [
('SHIFT', 'deselect'),
('CTRL', 'contain... | |
"it_IT": "Pest",
"ja_JP": "ペシュト",
"ko_KR": "페슈트",
"pl_PL": "Peszt",
"pt_BR": "Peste",
"ru_RU": "Пешт"
},
"PETERBOROUGH": {
"de_DE": "Peterborough",
"es_ES": "Peterborough",
"fr_FR": "Peterborough",
"it_IT": "Peterborough",
"ja_JP": "ピーターバラ",
"ko_KR": "피터버러",
"pl_PL": "Peterborough",
"pt_BR": "Peterboroug... | |
#!/usr/bin/env python
# Licensed as BSD by <NAME> of the ESRF on 2014-08-06
################################################################################
# Copyright (c) 2014, the European Synchrotron Radiation Facility #
# All rights reserved. #
# #
# Redistribution and use in source and binary forms, with or witho... | |
import io
import numpy as np
from scipy.interpolate import CubicSpline
from utils import C_bohr
from scipy import constants
try:
import py3nj
except ModuleNotFoundError:
pass
# print("'py3nj' module is not installed!\n")
class Spectrum:
def __init__(self, H, grid, spectrum='absorption'):
# TODO: allow for set... | |
lineEdit in self.list_pipe_section_entries:
lineEdit.setText("")
for lineEdit in self.list_beam_section_entries:
lineEdit.setText("")
def flip_element_ids(self):
self.flip = not self.flip
temp_initial = self.lineEdit_element_id_initial.text()
temp_final = self.lineEdit_element_id_final.text()
self.lineEdit_el... | |
'thermostat', 'battery': None, }
# }
testdata = {
# Anna
"7ffbb3ab4b6c4ab2915d7510f7bf8fe9": {
"location": "c34c6864216446528e95d88985e714cc",
"selected_schedule": "Normal",
"active_preset": "away",
"sensors": [{"id": "illuminance", "state": 35.0}],
},
"a270735e4ccd45239424badc0578a2b1": {
"location": "0f4f2... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#############################################################################
## This file is part of Tango Control System: http://www.tango-controls.org/
##
## $Author: <NAME>, <EMAIL>
## copyleft : ALBA Synchrotron Controls Section, www.cells.es
##
## Tango Control Syste... | |
will be "millibar" (equivalent to Hectopacal) for the Baro.
Parameters
----------
baro :
The uncalibrated baro Datastream
"""
assert baro.sensor_type == "baro"
if self._check_calibration(baro, "baro", factory=True) is True:
baro.data = (baro.data + 101325) / 100.0
baro.is_factory_calibrated = True
return ba... | |
we need.
nmet = len(fit.set.prior_list)
names = fit.set.prior_list
res = fit.fit_results[:,voxel[0],voxel[1],voxel[2]]
crao = fit.cramer_rao[:,voxel[0],voxel[1],voxel[2]]
conf = fit.confidence[:,voxel[0],voxel[1],voxel[2]]
stats = fit.fit_stats[:,voxel[0],voxel[1],voxel[2]]
do_crao = False if max(crao) == 0.0 ... | |
# === imports =================================================================
#from flask import *
from flask import flash, render_template, redirect, abort, jsonify, request, url_for
from flask import send_file
import os
import sys
import subprocess as sub
import json
from datetime import datetime
from werkzeug.uti... | |
if table_id is None:
table_id = -1
table_id = _execute.make_int(table_id, "table_id")
if table_name is None:
table_name = ""
table_name = _execute.make_str(table_name, "table_name")
if config is None:
config = ""
config = _execute.make_str(config, "config")
parameters = _ops.convert_to_tensor(parameters, _dtyp... | |
switch_name.startswith("sw-leaf-bmc"):
lag_number = 255
# sw-spine ==> sw-spine
elif switch_name.startswith("sw-spine"):
is_primary, primary, secondary = switch_is_primary(switch_name)
lag_number = 256
elif switch_name.startswith("sw-edge"):
is_primary, primary, secondary = switch_is_primary(switch_name)
lag_n... | |
<gh_stars>0
##########################################################################
#
# CUDA code generator
#
# This routine is called by op2_fortran which parses the input files
#
# It produces a file xxx_kernel.CUF for each kernel,
# plus a master kernel file
#
#####################################################... | |
<filename>src/script.py
from copy import deepcopy
from antlr4 import *
from antlr4.tree.Tree import TerminalNodeImpl
import os
from src.MyParser import MyErrorListener
from src.context_free_grammar import Grammar
from src.graph import Graph
from src.matrix_algorithms import evalCFPQ
from src.my_grammarLexer import my... | |
<gh_stars>0
#
# Copyright (C) 2015 by <NAME>.
import os, sys
ms_home = os.environ['MS_HOME'] # where source code is located
ms_data = os.environ['MS_DATA'] # dir for initial input data and final output
ms_temp = os.environ['MS_TEMP'] # dir for intermediate data files
rh_home = os.environ['RHOANA_HOME'] # where source ... | |
<filename>chapter_4_modeling/train_audiokeras.py
'''
================================================
## VOICEBOOK REPOSITORY ##
================================================
repository name: voicebook
repository version: 1.0
repository link: https://github.com/jim-schwoebel/voicebook
author: <NAME>
author c... | |
import tensorflow as tf
import pickle
from model.model_2D.base_model import BaseModel
from model.model_2D.ops_enet import drop_connect, max_unpool, PReLU
class ENet(BaseModel):
def __init__(self, sess, conf):
super(ENet, self).__init__(sess, conf)
self.wd = 2e-4 # (weight decay)
self.lr = 5e-4 # (learning rate)
... | |
"""
Defines SmartCache and supporting functions
"""
#***************************************************************************************************
# Copyright 2015, 2019 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government r... | |
states.
source_encs:
A tensor of shape [src_batch, src_len, source_dim].
source_paddings:
A tensor of shape [src_batch, src_len].
target_ids:
Initial empty list of decoded ids. [num_hyps, 0].
"""
p = self.params
source_encs = encoder_outputs.encoded
num_hyps = py_utils.GetShape(source_encs)[1] * num_hyps_per... | |
r"""Y-Path Factory :mod:`abelfunctions.ypath_factory`
=================================================
This module defines the y-skeleton of the Riemann surface. That is, a means of
not only computing the a- and b-cycles of the first homology group of the
Riemann surface but also mechanisms for travelling from one sh... | |
optional
list of y-direction cosines, of length ``numRays``; if ``None``, a
list of 0.0s for ``m`` is created
n : list, optional
list of z-direction cosines, of length ``numRays``; if ``None``, a
list of 0.0s for ``n`` is created
Exr : list, optional
list of real part of the electric field in x direction for eac... | |
'''Python Wrappers for Kaldi table IO (:kaldi:`io.html`)
In Kaldi the archive does not carry information about its contents and the user is required to
use the proper Reader or Writer. This module follows this approach and provides wrappers for
RandomAccess and Sequential readers, and for the Writers. The classes ar... | |
import numpy as np
from numba import jit
from collections import OrderedDict, deque
import itertools
from utils.nms_wrapper import nms_detections
from utils.log import logger
from utils import bbox as bbox_utils
from tracker import matching
from utils.homography import Homography
from utils.kalman_filter import Kalma... | |
there are no servers configured for the property.
* `liveness_test` - (Optional) Contains information about the liveness tests, which are run periodically to determine whether your servers respond to requests. You can have multiple `liveness_test` arguments. If used, requires these arguments:
* `name` - (Required) A ... | |
<reponame>hawkowl/twisted
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.conch.endpoints}.
"""
import os.path
from struct import pack
from errno import ENOSYS
from zope.interface.verify import verifyObject, verifyClass
from zope.interface import implementer
from twis... | |
<reponame>AlexandrosBeskos/manifold-mcmc-for-diffusions
import logging
import numpy as onp
import jax.numpy as np
import jax.numpy.linalg as nla
import jax.scipy.linalg as sla
from jax import lax, api
import jax.experimental.optimizers as opt
from mici.systems import (
EuclideanMetricSystem, cache_in_state, multi_cach... | |
########
# Copyright (c) 2014 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 requir... | |
from __future__ import absolute_import, division, print_function
import numpy as np
import pandas as pd
import six
import scipy.optimize as spo
import pyswarm
import sklearn.base as sklb
import sklearn.metrics as sklm
import sklearn.utils.validation as skluv
class FunctionMinimizer(sklb.BaseEstimator):
def __init__... | |
input to check Input array.
:type x: array
:param include_infs: Whether to include infs and -infs in the check. Default is True.
:type include_infs: bool, optional
:return Boolean as to whether the input value is a nan or not.
"""
x_scalar = ivy.to_scalar(x) if ivy.is_native_array(x) else x
if not x_scalar == x_... | |
* kept_space_ratio + best_guess * lost_space_ratio)
new_max_included = round(self.max_included * kept_space_ratio + best_guess * lost_space_ratio)
if new_max_included <= new_min_included or kept_space_ratio == 0.0:
return FixedHyperparameter(best_guess, self.null_default_value).was_narrowed_from(kept_space_ratio, se... | |
<gh_stars>0
#!/usr/bin/env python3
from argparse import ArgumentParser
from collections import Counter
import pickle
import sys
import numpy as np
import sklearn.base
from tpot.builtins import StackingEstimator
import tqdm
import zss
from janus.pipeline import pipeline_to_tree as pt
from janus.repair.tree_pairs impor... | |
TagBase.__init__(self, name, inline=True)
def render_open(self, parser, node_index):
valid_chars = self.valid_chars
color = self.params.split()[0:1][0].lower()
self.color = "".join([c for c in color if c in valid_chars])
if not self.color:
return u""
return u'<span style="color:%s">' % self.color
... | |
"color": BLUE_C,
"tick_frequency": 10
},
"x_min": -2.1,
"x_max": 2.1,
"y_min": -2.1,
"y_max": 2.1,
"center_point": FRAME_WIDTH*0.25*LEFT + FRAME_HEIGHT*0.25*UP + 0.3*UP + 1.7*LEFT,
},
"sin_axes_config": {
"number_line_config": {
"include_tip": True,
},
"x_axis_config": {
"color": BLUE_C,
"tick_frequency"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.