input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
> -1:
aJet = jets[electron.jetIdx]
aCSV = aJet.btagCSVV2
aDB = aJet.btagDeepB
aDC = aJet.btagDeepC
aDJ = aJet.btagDeepFlavB
if electron.pt >= 15:
self.hTree_bLepJetBtag.Fill(aCSV, ">15GeV e + CSVv2", 1.0)
self.hTree_bLepJetBtag.Fill(aDB, ">15GeV e + Deep CSV B", 1.0)
self.hTree_bLepJetBtag.Fill(aCSV, ">15GeV... | |
m.x626 - m.x630 == 0)
m.e299 = Constraint(expr= m.x191 - m.x619 - m.x623 - m.x627 - m.x631 == 0)
m.e300 = Constraint(expr= m.x192 - m.x620 - m.x624 - m.x628 - m.x632 == 0)
m.e301 = Constraint(expr= m.x181 - m.x585 - m.x589 - m.x593 - m.x597 == 0)
m.e302 = Constraint(expr= m.x182 - m.x586 - m.x590 - m.x594 - m.x598 == 0... | |
# Copyright (c) Microsoft Corporation
#
# All rights reserved.
#
# 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, including without limitation
# the rights... | |
# coding: utf-8
#
from __future__ import absolute_import
# Standard-library imports
import imp
import os.path
import sys
try:
from urllib.request import urlopen # Python 3
except ImportError:
from urllib2 import urlopen # Python 2
#
__version__ = '0.3'
# -----
# define `exec_` and `raise_` that are 2*3 compatibl... | |
# Generated with SMOP 0.41-beta
try:
from smop.libsmop import *
except ImportError:
raise ImportError('File compiled with `smop3`, please install `smop3` to run it.') from None
# PROJ_Cliquet_EIA_StochVol.m
@function
def PROJ_Cliquet_EIA_StochVol(numeric_param=None,M=None,r=None,q=None,T=None,psi_J=None,m... | |
<filename>hxl/scripts.py
"""
Console scripts
<NAME>
April 2015
This is a big, ugly module to support the libhxl
console scripts, including (mainly) argument parsing.
License: Public Domain
Documentation: https://github.com/HXLStandard/libhxl-python/wiki
"""
from __future__ import print_function
import argparse, jso... | |
<filename>infra/tools/antibody/compute_stats.py
# Copyright 2015 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 itertools
import json
def ratio_calculator(numerator, denominator):
"""Computes the ratio of the co... | |
lag duration time [fig2.2]_.
Parameters
----------
model_fit : lmfit.model.ModelResult
the result of a model fitting procedure
params : lmfit.parameter.Parameters, optional
if provided, these parameters will override `model_fit`'s parameters
Returns
-------
lam : float
the lag phase duration in ... | |
# -*- coding: utf-8 -*-
from __future__ import division
from collections import OrderedDict
from ..exceptions import CleoException
from .table_style import TableStyle
from .table_cell import TableCell
from .table_separator import TableSeparator
from .helper import Helper
class Table(object):
"""
Provides helpers ... | |
in zip(x,y,angles,labels):
line = plt.Line2D([0,xi],[0,yi],linestyle='dashed',color='lightgray',lw=0.8)
self.axes.add_line(line)
xo,yo = 0,0
if ang>90 and ang<180:
xo = -10
yo = 3
elif ang == 180:
xo = -15
yo = -3
elif ang>180 and ang<270:
xo = -12
yo = -10
elif ang == 270:
xo = -10
yo = -8
elif ang >27... | |
1)
support_set = [neighbours[i][0] for i in xrange(support_size)]
support_bbox = _find_limits(support_set)
crop_aspect_ratio = np.random.uniform(self.crop_ratio_limits_[0], self.crop_ratio_limits_[1])
do_mirror = self.mirror_ and np.random.uniform(0.0, 1.0) < self.max_mirror_prob_
glob_param = TransformParams(c... | |
(4x4 mxs
# in 1Q case) - whcih is what model.basis is. So, we just extract
# a builtin basis name for the projection basis.
if basis.name in ('pp', 'gm', 'std', 'qt'):
proj_basis_name = basis.name
else:
proj_basis_name = 'pp' # model.basis is weird so just use paulis as projection basis
if basis.name != targetM... | |
year in range(1900, 2100):
dt = date(year, 7, 9)
self.assertIn(dt, self.holidays)
self.assertNotIn(dt + relativedelta(days=-1), self.holidays)
self.assertNotIn(dt + relativedelta(days=+1), self.holidays)
def test_san_martin_day(self):
self.holidays.observed = False
self.assertNotIn(date(1930, 8, 10), self.holid... | |
'zh': u('\u6e56\u5317\u7701\u968f\u5dde\u5e02')},
'861398648':{'en': 'Xiaogan, Hubei', 'zh': u('\u6e56\u5317\u7701\u5b5d\u611f\u5e02')},
'861398649':{'en': 'Xiaogan, Hubei', 'zh': u('\u6e56\u5317\u7701\u5b5d\u611f\u5e02')},
'86145837':{'en': 'Jinan, Shandong', 'zh': u('\u5c71\u4e1c\u7701\u6d4e\u5357\u5e02')},
'8613... | |
self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response)
if cls:
return cls(pipeline_response, None, ... | |
lists the names, descriptions, and values of the special request parameters that the CreateQueue action uses:
DelaySeconds - The length of time, in seconds, for which the delivery of all messages in the queue is delayed. Valid values: An integer from 0 to 900 seconds (15 minutes). The default is 0 (zero).
MaximumMess... | |
#
# Copyright (c) 2018 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
#
# Unless required by applicable law or agreed to in w... | |
g_tankActiveCamouflage['historical'].get(vDesc.type.compactDescr)
if activeCamo is None:
activeCamo = g_tankActiveCamouflage.get(vDesc.type.compactDescr, 0)
camouflageID = vDesc.camouflages[activeCamo][0]
camouflageDesc = customization['camouflages'].get(camouflageID)
if camouflageDesc is not None:
__componentIDs... | |
<reponame>NoSDante/micropython-esp32
import uasyncio as asyncio
from machine import Pin, I2C, UART
from time import sleep
class Sensors():
I2C_SLOT = 1
I2C_SDA = 21
I2C_SCL = 22
I2C_FREQ = 400000
IMPORT_ERROR = "cannot import module"
I2C_ERROR = "cannot initialize I2C"
UART_ERROR = "cannot initialize UART"
... | |
<gh_stars>0
# region [Imports]
# * Standard Library Imports ---------------------------------------------------------------------------->
import os
import random
from math import ceil
import secrets
from typing import List, TYPE_CHECKING, Tuple
import asyncio
from urllib.parse import quote as urlquote
import re
from ... | |
x_forward_list = []
for n in range(nsamples):
_,(_,x_forward,_) = self.forward_sample(A[:,1:T_forward+1,:], T_forward-1, B = B, X0=X[:,0,:], A0=A[:,0,:], eps = eps)
x_forward_list.append(x_forward[...,None])
x_forward = torch.cat(x_forward_list,-1).mean(-1)
x_forward = torch.cat([X[:,[0],:], x_forward], 1)
if... | |
colormap. For example, 0.95 translates to a min/max of
mean(ratio) +/- (1.96*std(ratio))
cmap
The colormap used to display the ratio image. Diverging colormaps are a good
choice here (default is RdBu_r).
r_min
The minimum value for the ratio colormap. If None, uses the `prob` parameter
(see its description), and... | |
set default font to %s" %myFont)
try:
UIManager.getLookAndFeelDefaults().put("defaultFont", myFont )
# https://thebadprogrammer.com/swing-uimanager-keys/
UIManager.put("CheckBoxMenuItem.acceleratorFont", myFont)
UIManager.put("Button.font", myFont)
UIManager.put("ToggleButton.font", myFont)
UIManager.put("Radi... | |
# ---
# jupyter:
# jupytext:
# formats: jupyter_scripts//ipynb,scripts//py
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 1.0.0
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
# # series_tools:
#
# set of tools that work with str... | |
"CUser *" : return _znc_core.CWebSession_GetUser(self)
def IsLoggedIn(self) -> "bool" : return _znc_core.CWebSession_IsLoggedIn(self)
def IsAdmin(self) -> "bool" : return _znc_core.CWebSession_IsAdmin(self)
def SetUser(self, *args) -> "CUser *" : return _znc_core.CWebSession_SetUser(self, *args)
def ClearMessageLoo... | |
vul_lineno)
except Exception as e:
logger.debug(traceback.format_exc())
def analysis_functioncall(node, back_node, vul_function, vul_lineno):
"""
调用FunctionCall-->判断调用Function是否敏感-->get params获取所有参数-->开始递归判断
:param node:
:param back_node:
:param vul_function:
:param vul_lineno
:return:
"""
global scan_res... | |
from machine import I2C
import utime
import math
class MinIMU_v5:
"""
Init function
Valid values for aFullScale are 2, 4, 8, and 16 [g]
gFullScale are 125, 245, 500, 1000, and 2000 [dps]
mFullScale are 4, 8, 12, and 16 [guass]
gOdr are 1 -> 8 (13Hz -> 1.666kHz)
aOdr (Hz) are 1 -> 10 (13Hz -> 6.666kHz)
mOdr (H... | |
<filename>lambda/lambda_function.py
# -*- coding: utf-8 -*-
# This sample demonstrates handling intents from an Alexa skill using the Alexa Skills Kit SDK for Python.
# Please visit https://alexa.design/cookbook for additional examples on implementing slots, dialog management,
# session persistence, api calls, and mor... | |
# -*- encoding: utf-8 -*-
'''
:maintainer: HubbleStack / madchills
:maturity: 2016.7.0
:platform: Windows
:requires: SaltStack
'''
from __future__ import absolute_import
import copy
import fnmatch
import logging
import salt.utils
try:
import codecs
import uuid
HAS_WINDOWS_MODULES = True
except ImportError:
HAS_... | |
variable, and validate params
variable = self._check_args(variable=variable,
context=context,
params=params,
target_set=target_set,
)
try:
value = self._function(variable=variable,
context=context,
params=params,
**kwargs)
except ValueError as err:
err_msg = f"Problem with '{self}' in '{self.owner.name if s... | |
from.
:type storage_account_id: str
:param job_type: The type of job.
:type job_type: str
:param return_address: Specifies the return address information for the job.
:type return_address: ~storage_import_export.models.ReturnAddress
:param return_shipping: Specifies the return carrier and customer's account with ... | |
= FloatRangeTrait()
_default_value = 3.0
_good_values = [2.0, 3.0, 4.0, 5.0, 2.001, 4.999]
_bad_values = [
0,
1,
6,
LONG_TYPE(0),
LONG_TYPE(1),
LONG_TYPE(6),
1.999,
6.01,
"two",
"0.999",
"6.01",
None,
]
def coerce(self, value):
try:
return float(value)
except:
return float(LONG_TYPE(value))
# O... | |
<gh_stars>0
from py.path import local
from src.utils.logger import Log, create_logger
from typing import Dict, Union
from unittest.mock import MagicMock
import logging
import os
import pytest
import re
# Define the expected logging format for the `create_logger` function
EXPECTED_LOG_FORMAT = "%(asctime)s - %(name)s -... | |
<filename>mmtbx/regression/model/tst_model_biomt_mtrix.py
from __future__ import absolute_import, division, print_function
import iotbx.pdb
import mmtbx.model
import time
"""
Test multiplication of hierarchy and SS annotations in different combinations
of MTRIX and BIOMT records presence.
"""
single_mtrix_txt = """
M... | |
from __future__ import division
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import
# Standard imports
from future import standard_library
standard_library.install_aliases()
from builtins import str
from builtins import *
from past.utils import old_div
im... | |
['MSIL1C'],
'include_s2_sr': 'sr_refl',
'keep_intermediate_data': 'intermediate_data'
}
# If nothing to do just return
if self._xml_filename is None:
return
# Remove generated products that were not requested
products_to_remove = []
if not options['include_customized_source_data']:
products_to_remove.extend... | |
<filename>code/Practica2.py
#!/usr/bin/env python
# coding: utf-8
# # Pràctica 2: Neteja i anàlisis de les dades
#
# El següent notebook esta orientat a resoldre la pràctica 2 de l'assignatura *M2.951 - Tipologia i cicle de vida de les dades* del màster en Data Science de la UOC.
#
# ### Nota important
#
# Per pode... | |
<gh_stars>1-10
from typing import Sequence
import numpy as np
import theano
import theano.tensor as tt
from artemis.experiments import ExperimentFunction, capture_created_experiments
from artemis.general.checkpoint_counter import Checkpoints
from artemis.general.duck import Duck
from artemis.general.nested_structures... | |
<gh_stars>0
"""
------------------------------------------------------------------------------
The MIT License (MIT)
Copyright (c) 2016 Newcastle University
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... | |
usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000 (uint16_t)
voltage_battery : Battery voltage, in millivolts (1 = 1 millivolt) (uint16_t)
current_battery : Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current (int16_t)
battery_rema... | |
<reponame>lemiceterieux/nilearn<filename>nilearn/input_data/nifti_labels_masker.py
"""
Transformer for computing ROI signals.
"""
import numpy as np
import warnings
from joblib import Memory
from .. import _utils
from .._utils import logger, CacheMixin, _compose_err_msg
from .._utils.class_inspect import get_params
... | |
import multiprocessing as mp
import os
import tempfile
import shutil
import dask.dataframe as dd
import dask.diagnostics
import genomepy
from gimmemotifs.scanner import scan_regionfile_to_table
from gimmemotifs.utils import pfmfile_location
from loguru import logger
import numpy as np
import pandas as pd
import pickle... | |
-1), JzKet(1, -1), JzKet(1, 0))/3 + \
sqrt(3)*TensorProduct(JzKet(1, -1), JzKet(1, 0), JzKet(1, -1))/3 + \
sqrt(3)*TensorProduct(JzKet(1, 0), JzKet(1, -1), JzKet(1, -1))/3
assert uncouple(JzKetCoupled(3, -3, (1, 1, 1))) == \
TensorProduct(JzKet(1, -1), JzKet(1, -1), JzKet(1, -1))
assert uncouple(JzKetCoupled(2, 2,... | |
: ( 29086, 29088 ),
"DR1fOns_5" : ( 29088, 29089 ),
"DR1fAgeRec_5" : ( 29089, 29091 ),
"DR1fRec_5" : ( 29091, 29092 ),
"DR1f_6" : ( 29092, 29093 ),
"DR1f1_6" : ( 29093, 29097 ),
"DR1fAgeOns_6" : ( 29097, 29099 ),
"DR1fOns_6" : ( 29099, 29100 ),
"DR1fAgeRec_6" : ( 29100, 29102 ),
"DR1fRec_6" : ( 29102, 29103 ),... | |
"""Python wrappers around TensorFlow ops.
This file is MACHINE GENERATED! Do not edit.
Original C++ source file: string_ops.cc
"""
import collections
from tensorflow.python import pywrap_tfe as pywrap_tfe
from tensorflow.python.eager import context as _context
from tensorflow.python.eager import core as _core
from t... | |
/ Number.POSITIVE_INFINITY)
self.assertEqual(Number.NAN, Number.NEGATIVE_INFINITY / Number.NEGATIVE_INFINITY)
def test_infinity_from_add_subtract(self):
self.assertEqual(Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY + Number.POSITIVE_INFINITY)
self.assertEqual(Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINIT... | |
<gh_stars>0
import FWCore.ParameterSet.Config as cms
########################reconstruction_step/ MC_Tracing_v0 path modules
###added for cmssw_11_1
TrackProducer = cms.EDProducer("TrackProducer",
AlgorithmName = cms.string('undefAlgorithm'),
Fitter = cms.string('KFFittingSmootherWithOutliersRejectionAndRK'),
Ge... | |
<reponame>diogocs1/comps<gh_stars>0
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it un... | |
would be transferred to federal detention .",
'DA Rosen\'s November 7 presentation claimed honoring ICE holds would "produce an undetermined amount of cost savings by reducing probation costs", as individuals otherwise on probation would be transferred to federal detention.',
],
[
"Canberra 's response came from No... | |
<reponame>matiscke/eccentricWarmJupiter<gh_stars>0
""" modified from <NAME> script.
"""
import numpy as np
import juliet
from math import log10, floor
import decimal
import aux
# https://exoplanetarchive.ipac.caltech.edu/docs/poet_calculations.html
G = 6.67408e-11 # m3 kg-1 s-2
solarrad2m = 6.957e8 # solar radii in ... | |
# String form: either a repository or remote location
meta = {}
url = urlparse.urlparse(file_data)
if url.netloc:
meta['remote'] = file_data
else:
path = file_data
if not 'remote' in meta:
location = os.path.expanduser(path)
location_paths.append(os.path.dirname(location))
files_data.append(dict(path=path, lo... | |
import re
import string
from urllib.parse import urlsplit
from xml.sax.saxutils import unescape
import nltk
import numpy as np
from twitter_bot_type_classification.features.utils import URL_SHORTER_REGEX, URL_REGEX, EMOJI_REGEX, HASHTAG_REGEX, \
USERNAME_REGEX, NUMBER_CHAR_REGEX, \
get_expanded_url, URL_PATH_SPLIT,... | |
filter_min_counts_per_sample))
sample_names = r('''colnames(countsTable)''')
nempty_samples = sum(empty_samples)
if nempty_samples:
E.warn("%i empty samples are being removed: %s" %
(nempty_samples,
",".join([sample_names[x]
for x, y in enumerate(empty_samples) if y])))
r('''countsTable <- countsTable[, max_co... | |
import json
import os
import pytest
import requests
from .common import ADMIN_TOKEN
from .common import AUTH_PROVIDER
from .common import AUTH_USER_PASSWORD
from .common import CATTLE_TEST_URL
from .common import cluster_cleanup
from .common import create_project_and_ns
from .common import get_admin_client
from .commo... | |
<reponame>IMULMUL/etl-parser
# -*- coding: utf-8 -*-
"""
Microsoft-Windows-WinNat
GUID : 66c07ecd-6667-43fc-93f8-05cf07f446ec
"""
from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct
from etl.utils import WString, CString, SystemTime, Guid
from etl.... | |
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': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dynamic': 0.0,
'Runtime Dynamic': 0.0,
... | |
# -*- coding: utf-8 -*-
import json
import math
import os
import platform
import random
import re
import sys
import time
from collections import OrderedDict
from io import StringIO
import requests
import numpy as np
from scipy import optimize
__author__ = "<NAME> and <NAME>"
__version__ = "2022.06.14"
__license__ ... | |
enable
the user to choose the tokens to consider when computing probabilities.
Args:
sequences : List of sequences, path of fasta file or path to a folder with msa to a3m format.
batch_size: number of sequences to consider for the forward pass
tokens_list: List of tokens to consider
pass_mode: Mode of model eval... | |
* from cloud_images) as i) as i where cloud_type='openstack';"
rc, msg = config.db_execute(sql)
image_list = []
for row in config.db_cursor:
image_list.append(row)
target_image = image_list[image_index]
if image_name is not None:
if str(target_image["name"]) != str(image_name):
return HttpResponse(json.dumps({'... | |
1.29456))^Ts_Rank(correlation(IndNeutralize(close,IndClass.industry), adv50, 17.8256), 17.9171)) * -1)
# Alpha#71 max(Ts_Rank(decay_linear(correlation(Ts_Rank(close, 3.43976), Ts_Rank(adv180,12.0647), 18.0175), 4.20501), 15.6948), Ts_Rank(decay_linear((rank(((low + open) - (vwap +vwap)))^2), 16.4662), 4.4388))
def ... | |
from datetime import datetime
from enum import IntEnum
from typing import List, Optional, Union
from .channel import Channel, ChannelType
from .member import Member
from .misc import MISSING, DictSerializerMixin, Snowflake
from .team import Application
from .user import User
class MessageType(IntEnum):
"""An enumer... | |
import unittest
from typen._decorators import (
enforce_type_hints,
strict_type_hints,
)
from typen.exceptions import (
ParameterTypeError,
ReturnTypeError,
UnspecifiedParameterTypeError,
UnspecifiedReturnTypeError,
)
# Note: Type checking is found in test_enforcer.py
class TestEnforceTypeHints(unittest.TestCa... | |
import matplotlib.pyplot as plt
import numpy as np
from CASutils import colormap_utils as mycolors
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from cartopy.util import add_cyclic_point
from cartopy.mpl.ticker import LongitudeFormatter, LatitudeFormatter
import matplotlib.ticker as mticker
def conto... | |
- a) * s))
x += dx
a += 2 * w * dx + s * dx * dx
cuts.append(x)
w += s * dx
a = 0
else:
dx = nx - x
a += 2 * w * dx + s * dx * dx
x = nx
w += s * dx
if nx == nxL:
iL += 1
if nx == nxU:
iU += 1
if iL >= len(L) - 1:
break
if iU >= len(U) - 1:
break
return w
def func_59ff2411202c4e71bc7fa20b6f3053f9(U... | |
at the same time.")
elif matrix is not None:
if matrix.shape != (3, 3):
raise ValueError("Invalid shape of transformation matrix.")
self.params = matrix
elif params:
if translation is None:
translation = (0, 0)
if rotation is None:
rotation = 0
self.params = np.array([
[np.cos(rotation), - np.sin(rotation)... | |
to parse
unescape_names : bool
Remove extraneous quote marks around names. Sometimes other
programs are sensitive to the characters used in names, and it
is essential (at times) to quote node names for compatibility.
Returns
-------
TreeNode
The root of the parsed tree
Raises
------
RecordError
The follow... | |
# Copyright 2021 MosaicML. All Rights Reserved.
"""Utility for uploading to and downloading from cloud object stores."""
import dataclasses
import os
import sys
import textwrap
from typing import Any, Dict, Iterator, Optional, Union
import yahp as hp
from libcloud.storage.providers import get_driver
__all__ = ["Obje... | |
<filename>gemstash.py<gh_stars>0
#!/usr/bin/env python3
# Copyright 2015 <NAME>. See LICENSE for details.
"""
Server-free memcached replacement.
Gemstash provides a simple cache similar to memcached, appropriate for use in
standalone applications which do not have access to a memcached server. Its
usage should be fa... | |
<reponame>jmadamesila/TBCCpylinac
"""The picket fence module is meant for analyzing EPID images where a "picket fence" MLC pattern has been made.
Physicists regularly check MLC positioning through this test. This test can be done using film and one can
"eyeball" it, but this is the 21st century and we have numerous way... | |
import ply.lex as lex
import re
from parse.errors import Error as our_error
from parse.expressions.expressions_math import *
from parse.expressions.expressions_base import *
from parse.expressions.expressions_trig import *
from parse.sql_common.sql_general import *
from parse.sql_ddl.create import *
from parse.sql_ddl.... | |
[3, 2, 8, 10], [3, 1, 10, 12],
[4, 4, 13, 15], [4, 3, 15, 17], [4, 2, 17, 19], [4, 1, 19, 21],
[5, 4, 14, 16], [5, 3, 16, 18], [5, 2, 18, 20], [5, 1, 20, 22]]
class mpiinf3d28j3d():
"""Body joints from MPI-INF-3DHP."""
num_joints = 28
dim = 3
"""Color map"""
color = ['r']
cmap = num_joints * [0]
links = []
... | |
'security'))
self.ui.button_nat.clicked.connect(partial(self._load_rulebase, 'nat'))
self.ui.button_reports.clicked.connect(partial(self._load_reports, 'reports'))
self.ui.button_report_groups.clicked.connect(partial(self._load_reports, 'report-group'))
##############################################
# COMBO BOX E... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created: Aug 2017
@author: D34D9001@9R0GR4M13
"""
import kerri
import os
import time
import webbrowser
import random
import subprocess
import sys
import urllib
from bs4 import BeautifulSoup as bs
from termcolor import colored
###########
# STALKER #
###########
co... | |
<reponame>ryu-sw/alembic
##-*****************************************************************************
##
## Copyright (c) 2009-2011,
## <NAME>, Inc. and
## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
##
## All rights reserved.
##
## Redistribution and use in source and binary forms,... | |
<filename>src/pymor/algorithms/projection.py
# This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2020 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import numpy as np
from pymor.algorithms.rules impor... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 27 16:42:52 2019
@author: <NAME>
"""
import cv2
import numpy as np
import dlib
import time
import math
import sys
from os import path
file_dir = path.dirname(path.realpath(__file__))
import socket
detector = dlib.get_frontal_face_detector()
pred... | |
imported_comp_names = set()
for key, value in data['export_data'][entity_name].items():
if entity_name == GROUP_ENTITY_NAME:
# Check if there is already a group with the same name,
# and if so, recreate the name
orig_label = value['label']
dupl_counter = 0
while QueryBuilder().append(entity, filters={'label': {'... | |
Valiate that ROOT admin is able to deploy a VM for user in ROOT domain in a shared network with scope=all
"""
# Deploy VM as user in ROOT domain
self.apiclient.connection.apiKey = self.default_apikey
self.apiclient.connection.securityKey = self.default_secretkey
self.vmdata["name"] = self.acldata["vmROOTA"]["nam... | |
Psat)))
### Liquid Mixtures
def Amgat(xs, Vms):
r'''Calculate mixture liquid density using the Amgat mixing rule.
Highly inacurate, but easy to use. Assumes idea liquids with
no excess volume. Average molecular weight should be used with it to obtain
density.
.. math::
V_{mix} = \sum_i x_i V_i
or in terms o... | |
<filename>core/domain/auth_jobs_one_off.py
# coding: utf-8
#
# Copyright 2020 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org... | |
+ 187371129 -AA-GGGGATGCTAAGCCAATGAGTTGTTGTCTCTCAATGTG
s dae.chr0 0 30 + 100 AAA-GGGAATGTTAACCAAATGA-----------TTACGGTG
''',
'''a score=23262.0
s hg18 27578828 38 + 158545518 AAA-GGGAATGTTAACCAAATGA---ATTGTCTCTTACGGTG
s panTro1.chr6 28741140 38 + 161576975 AAA-GGGAATGTTAACCAAATGA---ATTGTCTCTTACGGTG
i panTro1.chr6 I ... | |
:]
pos = text.find("(")
# Remove orphan closing braces.
text = text.replace(")", " ")
return text
def _expand_macros(self, text):
macros = {}
new = ""
for line in text.splitlines(True):
if "=" in line:
head, tail = line.split("=")
tail = tail.replace("\n", "")
macros[head.strip()] = tail.strip()
else:
... | |
<reponame>sidneycadot/pydwf
"""The |pydwf.core.api.digital_out| module implements a single class: |DigitalOut|."""
from typing import Tuple, List
from pydwf.core.dwf_device_subapi import AbstractDwfDeviceSubApi
from pydwf.core.auxiliary.typespec_ctypes import typespec_ctypes
from pydwf.core.auxiliary.enum_types impo... | |
<gh_stars>0
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
fr... | |
Laungminbha Buddhist Monastery',
'Temple of the Emerald Buddha - Wat Phra Si Rattana Satsadaram / Wat Phra Kaew',
'วัดพุทธปัญญา เสนา Buddhapanya Monastery Sena',
'Wat Sam Phran',
'Wat Phra Chetuphon (Wat Pho)',
'Wat Suthat Thepwararam Ratchaworahawihan',
'သန္တိသုခတောရ Santisukha Forest Monastery',
'Wat Mangkon Kamalawa... | |
to forward-map the dataset containing the boxcar event
samples. If None (default) a FlattenMapper is employed to convert
multi-dimensional sample matrices into simple one-dimensional sample
vectors. This option can be used to implement temporal compression, by
e.g. averaging samples within an event boxcar using an ... | |
import json
import yaml
import re
from myst_parser.main import default_parser
def to_myst(model: str) -> str:
myst_file = ""
model_dict = json.loads(model)
for key in model_dict:
if key == "cells":
myst_file = _handle_cells(model_dict[key])
elif key == "metadata":
myst_file = _handle_metadata(model_dict[key])
... | |
<gh_stars>0
#!/usr/bin/env python
#
# Copyright 2017 University Of Southern California
#
# 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... | |
i in x_vals]))
logging.debug("y vals: " + " ".join([str(i) for i in y_vals]))
# if exp_env.is_prefilled:
# local_colors = prefilled_colors_web
# local_linestyles = prefilled_linestyles_web
# else:
# local_colors = colors
# local_linestyles = linestyles
if exp_env in label_translation:
label = label_translati... | |
{'name': 'TLS_DH_Anon_WITH_DES_CBC_SHA', 'protocol': 'TLS', 'kx': 'DH', 'au': 'Anon', 'enc': 'DES_CBC', 'bits': '56', 'mac': 'SHA', 'kxau_strength': 'MITM', 'enc_strength': 'LOW', 'overall_strength': 'MITM'},
'00001B': {'name': 'TLS_DH_Anon_WITH_3DES_EDE_CBC_SHA', 'protocol': 'TLS', 'kx': 'DH', 'au': 'Anon', 'enc': '3... | |
"""
Couple of functions needed for training the model.
"""
import pandas as pd
import numpy as np
from catboost import CatBoostRegressor, Pool
from sklearn.model_selection import train_test_split, KFold
from sklearn.preprocessing import StandardScaler
from catboost import CatBoostClassifier
from tqdm import tqdm_noteb... | |
pass
else:
raise NoViableAltException(self)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
self.exitRule()
return localctx
class GateContext(ParserRuleContext):
def __init__(self, parser, parent=None, invokingSt... | |
<reponame>JiaHe-yogurt/GNN
import networkx as nx
from sklearn import preprocessing
import numpy as np
import os
import collections
import networkx as nx
import matplotlib.pyplot as plt
import random
import numpy as np
from itertools import permutations, combinations
import tensorflow.compat.v1 as tf
tf.disable_eager_ex... | |
<filename>routing/active_paths_mixin.py<gh_stars>0
from operator import itemgetter
import logging
logger = logging.getLogger(__name__)
# own classes
from networking import Message
class ActivePathsMixin(object):
def __init__(self, *args, **kwargs):
self.__aggressive_teardown = False
self.__active_edges = {}
# ne... | |
# 'maximum_cycle24':Time('2014-02-01', format='iso'),
# 'minimum_cycle23':Time('1996-05-01', format='iso'),
# 'minimum_cycle24': Time('2008-12-01', format='iso')}
#ax2.plot(solar_df.index.values,
# solar_df['sunspot RI'],
# label='Monthly Mean',
# c='#1E88E5')
#ax2.plot(solar_df.index.values,
# solar_df['sunsp... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
sfftkplus.formats.roi
Copyright 2017 EMBL - European Bioinformatics Institute
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.o... | |
<reponame>StanPlatinum/VMI-as-a-Service
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Libxc Migration v2 streams
Record structures as per docs/specs/libxc-migration-stream.pandoc, and
verification routines.
"""
import sys
from struct import calcsize, unpack
from xen.migration.verify import StreamError, RecordE... | |
#!/usr/bin/env python3
# Author: <NAME>
# Contact: <EMAIL>
"""Define data preprocessing operations for **PETGEM**."""
# ---------------------------------------------------------------
# Load python modules
# ---------------------------------------------------------------
import numpy as np
import h5py
import meshio
i... | |
<gh_stars>0
# MIT License
# Copyright (c) 2021 <NAME>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, me... | |
postCellId="../VA4/0/"/>
</projection>
<projection id="NC_AVER_VA5_FMRFamide" postsynapticPopulation="VA5" presynapticPopulation="AVER" synapse="">
<connection id="0" preCellId="../AVER/0/" postCellId="../VA5/0/"/>
</projection>
<projection id="NC_AVFL_AVBL_Glutamate" postsynapticPopulation="AVBL" presynapticPopul... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.