input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
the spin multiplicity is 2
# For higher-order radicals the highest allowed spin multiplicity is assumed
conformer.spinMultiplicity = molecule.getRadicalCount() + 1
# No need to determine rotational and vibrational modes for single atoms
if len(molecule.atoms) < 2:
return (conformer, None, None)
linear = molecu... | |
uid, ids, context=None):
'''
Confirm the vouchers given in ids and create the journal entries for each of them
'''
if context is None:
context = {}
move_pool = self.pool.get('account.move')
move_line_pool = self.pool.get('account.move.line')
for voucher in self.browse(cr, uid, ids, context=context):
local_cont... | |
<filename>Website/FlaskWebsite/env/Lib/site-packages/matplotlib/tests/test_collections.py
import io
from types import SimpleNamespace
import numpy as np
from numpy.testing import assert_array_equal, assert_array_almost_equal
import pytest
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotl... | |
<gh_stars>0
# Copyright 2014 Juniper Networks. 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 appli... | |
# 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
from . import ... | |
the snapshot
# should affect only the snapshot, not the real backend
clone_view.commit()
self.assertIsNone(raw_view.storages.try_get(self.storagekey2))
self.assertEqual(self.storageitem2, snapshot_view.storages.try_get(self.storagekey2))
# finally commit to real db
snapshot_view.commit()
self.assertEqual(self.s... | |
of the tree iterator used by libc++
class stdmap_iterator:
def tree_min(self, x):
logger = lldb.formatters.Logger.Logger()
steps = 0
if x.is_null:
return None
while (not x.left.is_null):
x = x.left
steps += 1
if steps > self.max_count:
logger >> "Returning None - we overflowed"
return None
return x
def... | |
<filename>test/unit/events.py
"""Collection of events for unit tests."""
import pytest
import uuid
@pytest.fixture()
def standard_valid_input():
new_uuid = str(uuid.uuid4())
request_id = "request_id_" + new_uuid
return {
"request_id": request_id,
"metric_data": [
{
"metric_name": "theMetricname",
"dimensions"... | |
<filename>python/venv/lib/python2.7/site-packages/openstackclient/common/utils.py
# Copyright 2012-2013 OpenStack Foundation
#
# 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.apa... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | |
<reponame>gaybro8777/Optimus<filename>optimus/profiler/profiler.py
import configparser
import json
import logging
import os
from collections import defaultdict
import dateutil
import humanize
import jinja2
import pika
import pyspark.sql.functions as F
from pyspark.sql.types import ArrayType, LongType
from optimus.fun... | |
{
'key': key,
'props': props,
'provider': provider,
}
@property
def key(self) -> str:
"""The missing context key.
stability
:stability: experimental
"""
return self._values.get('key')
@property
def props(self) -> typing.Mapping[str,typing.Any]:
"""A set of provider-specific options.
stability
:stabi... | |
%s: no spades contigs', geneName)
return None
if len(contigList) == 0:
logger.warning('gene %s: empty contig list', geneName)
return None
logger.debug('gene %s: %d spades contigs', geneName, len(contigList))
geneProtein = self.translateGene(result.representativePaftolTargetDict[geneName].seqRecord)
Bio.SeqIO.wri... | |
# coding: utf-8
"""
OANDA v20 REST API
The full OANDA v20 REST API Specification. This specification defines how to interact with v20 Accounts, Trades, Orders, Pricing and more. To authenticate use the string 'Bearer ' followed by the token which can be obtained at https://www.oanda.com/demo-account/tpa/personal_to... | |
<reponame>ryoon/PyRTL
import unittest
import random
import io
import pyrtl
import six
from pyrtl import inputoutput
from pyrtl import analysis
from pyrtl.rtllib import testingutils as utils
full_adder_blif = """\
# Generated by Yosys 0.3.0+ (git sha1 7e758d5, clang 3.4-1ubuntu3 -fPIC -Os)
.model full_adder
.inputs x ... | |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""
==================
prospect.utilities
==================
Utility functions for prospect.
"""
import os, glob
from pkg_resources import resource_string, resource_listdir
import numpy as np
import astropy.io.fits
from astropy.t... | |
if len(self.selected) <= 0:
dlg=lib.MessageBoxOK("No data to plot. Open files first.",
"",style=wx.OK|wx.ICON_EXCLAMATION)
return
curfmodat=self.GetCurrentFMOData()
nfrg=curfmodat.nfrg
if nfrg <=1:
dlg=lib.MessageBoxOK("No plot data, since the number of fragment=1.",
"",style=wx.OK|wx.ICON_EXCLAMATION)
return
... | |
spec_scaling[item] * self.spectrum[item][0][:, 1]
if err_scaling[item] is None:
# Variance without error inflation
data_var = self.spectrum[item][0][:, 2] ** 2
else:
# Variance with error inflation (see Piette & Madhusudhan 2020)
data_var = (
self.spectrum[item][0][:, 2] ** 2
+ (err_scaling[item] * model_flux... | |
Bid: " +str("%.12f" % currVTHOBTCBid) +" | VTHO Ask: " +str("%.12f" % currVTHOBTCAsk))
#WAVES-BTC
if(response["market"] == "WAVES-BTC" and "bestBid" in response):
currWAVESBTCBid = float(response["bestBid"])
#print("B WAVES Bid: " +str("%.8f" % currWAVESBTCBid) +" | WAVES Ask: " +str("%.8f" % currWAVESBTCAsk))
i... | |
str) -> bool:
return Counter(s) == Counter(t)
"""
# - Group Anagrams -
# https://leetcode.com/problems/group-anagrams/
Given an array of strings strs, group the anagrams together. You can return
the answer in any order.
An Anagram is a word or phrase formed by rearranging the letters of a different
word or ph... | |
import tempfile
import typing
import asyncio
from urllib.parse import SplitResult, parse_qsl, urlencode, urlsplit
from rpcpy.types import Environ, Scope
from rpcpy.utils import cached_property
__all__ = [
"FormData",
"MutableHeaders",
"Headers",
"UploadFile",
"URL",
]
class URL:
def __init__(
self,
url: str... | |
<gh_stars>0
# -*- coding: utf-8 -*-
__author__ = 'ffuentes'
import graphene
import norduniclient as nc
from apps.noclook.forms import *
from apps.noclook.models import SwitchType as SwitchTypeModel
import apps.noclook.vakt.utils as sriutils
from apps.noclook.schema.types import *
from apps.noclook.views.edit import _n... | |
_fbthrift_py3lite_exceptions.ApplicationError(
_fbthrift_py3lite_exceptions.ApplicationErrorType.MISSING_RESULT,
"Empty Response",
)
async def nested_map_argument(
self,
struct_map: _typing.Mapping[str, _typing.Sequence[module.lite_types.SimpleStruct]]
) -> int:
resp = await self._send_request(
"SimpleService... | |
<reponame>bopopescu/Nova-31
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright 2010 OpenStack Foundation
#
# 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 L... | |
<gh_stars>10-100
import os
import numpy as np
import time
from scipy.signal import savgol_filter
import sys
import scipy.io as sio
import utils.utils as utils
def str2ind(categoryname, classlist):
return [i for i in range(len(classlist)) if categoryname == classlist[i]][0]
def filter_segments(segment_... | |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not u... | |
"""Base wayland abstractions
"""
# private variables used between classes in file
# pyright: reportPrivateUsage=false
from __future__ import annotations
import asyncio
import io
import logging
from mmap import mmap
import sys
import os
import socket
import secrets
from enum import Enum
from _posixshmem import shm_open,... | |
"""
saltfactories.utils.processes.salts
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Salt's related daemon classes and CLI processes implementations
"""
import atexit
import json
import logging
import os
import pprint
import re
import stat
import subprocess
import sys
import tempfile
import textwrap
import time
import weakr... | |
import os
import json
import pathlib
import bpy
import pprint
from . import Global
from . import NodeArrange
from . import Versions
from . import MatDct
from . import Util
from . import BumpToNormal
# region top-level methods
def srgb_to_linear_rgb(srgb):
if srgb < 0:
return 0
elif srgb < 0.04045:
return srgb / ... | |
"""
Profile (Multi-perspective single-record view)
Copyright: 2009-2022 (c) Sahana Software Foundation
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... | |
reorganization, and hence
no move operation, so the `position` and `save` arguments are
ignored; they are present for regularity purposes with the rest of
the deletion preparation methods.
:param node: the :class:`CTENode` to prepare for deletion.
:param position: this is ignored, but present for regularity.
:... | |
self.PL_cons_functor = self._lib.PL_cons_functor # FIXME:
# PL_EXPORT(void) PL_cons_functor_v(term_t h, functor_t fd, term_t a0);
self.PL_cons_functor_v = self._lib.PL_cons_functor_v
self.PL_cons_functor_v.argtypes = [term_t, functor_t, term_t]
self.PL_cons_functor_v.restype = None
# PL_EXPORT(void) PL_cons_list... | |
# Copyright (c) 2012-2014 Turbulenz Limited
"""
This file contains all of the code generation, formatting and default
templates for the build tools. This includes the set of variables
used to render the html templates, the format of dependency
information and the set of shared options across the code build tools.
"""
... | |
day = '19'
##############################
########## PARSING #########
##############################
def parse_input(day=day):
with open(f'2020/data/day_{day}.in', 'r', encoding='utf-8') as f:
rules, messages = f.read().strip().split('\n\n')
initial_rules, final_rules = {}, {}
for rule in rules.split('\n'):
if ... | |
http://hl7.org/fhir/ValueSet/ucum-common in valuesets.xml
"""
MicromolePerGramOfCreatinine = CommonUCUMUnitsCode("umol/g{creat}")
"""
From: http://hl7.org/fhir/ValueSet/ucum-common in valuesets.xml
"""
MicromolePerGramOfHemoglobin = CommonUCUMUnitsCode("umol/g{Hb}")
"""
From: http://hl7.org/fhir/ValueSet/ucum-c... | |
<gh_stars>1-10
import numpy as np
from scipy import constants as con
from scipy.optimize import minimize, dual_annealing, differential_evolution, shgo
import matplotlib.pyplot as plt
import find_nearest as fn
from matplotlib.colors import BoundaryNorm
from matplotlib.ticker import MaxNLocator
from matplotlib import rcP... | |
# Copyright 2020 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | |
affected pixels
Returns
-------
Nothing, modifies DQ extension of `flt_file` in place.
"""
import scipy.ndimage as nd
flt = pyfits.open(flt_file, mode='update')
sat = (((flt['DQ'].data & 256) > 0) & ((flt['DQ'].data & 4) == 0))
## Don't flag pixels in lower right corner
sat[:80,-80:] = False
## Fl... | |
path or in a URI-like format,
including scheme. A dataPath argument may include a single '*' wildcard character in the filename.
dims: tuple of positive int
Dimensions of input image data, ordered with the fastest-changing dimension first.
ext: string, optional, default "stack"
Extension required on data files t... | |
import math
from functools import reduce
import torch
import torch.nn as nn
import pytorch_acdc as dct
from torch.utils.checkpoint import checkpoint
class ACDC(nn.Module):
"""
A structured efficient layer, consisting of four steps:
1. Scale by diagonal matrix
2. Discrete Cosine Transform
3. Scale by diagonal m... | |
<filename>src/whoosh/util/times.py
# Copyright 2010 <NAME>. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list ... | |
has a color map
try:
self.cmap = src.colormap(1)
except ValueError:
pass
if crs is None:
crs = src.crs
if res is None:
res = src.res[0]
with WarpedVRT(src, crs=crs) as vrt:
minx, miny, maxx, maxy = vrt.bounds
except rasterio.errors.RasterioIOError:
# Skip files that rasterio is unable to read
continue
e... | |
<reponame>citrix-openstack-build/neutron
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 NEC 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
#
... | |
<reponame>MichaelKohler/mozfest-event-app-data-processor
import argparse, os, sys, traceback
import github3
import gspread
import io
import json
import logging
import os
import requests
import base64
from datetime import datetime, timedelta
from logging.config import dictConfig
from oauth2client.client import SignedJwt... | |
Nu: u.m**2/u.s
:param Roughness: roughness of channel
:type Roughness: u.m
:return: major head loss in general channel
:rtype: u.m
"""
ut.check_range([Length.magnitude, ">0", "Length"])
return (fric_channel(Area, PerimWetted, Vel, Nu, Roughness) * Length
/ (4 * radius_hydraulic_channel(Area, PerimWetted))
* V... | |
<gh_stars>1000+
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------------
# Name: tree/verticality.py
# Purpose: Object for dealing with vertical simultaneities in a
# fast way w/o Chord's overhead
#
# Authors: <NAME>
# <NAME>
#
# Copyright: Copyright © 2013-16 <NAME> and th... | |
# This file was automatically created by FeynRules 1.7.53
# Mathematica version: 8.0 for Linux x86 (64-bit) (February 23, 2011)
# Date: Tue 31 Jul 2012 19:55:14
from object_library import all_parameters, Parameter
from function_library import complexconjugate, re, im, csc, sec, acsc, asec
# This is a default para... | |
<gh_stars>1-10
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 Nicira, Inc.
# All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licen... | |
value of the `status_detail` property.
"""
self._status_detail = value
@property
def power_management(self):
"""
Returns the value of the `power_management` property.
"""
return self._power_management
@power_management.setter
def power_management(self, value):
"""
Sets the value of the `power_management` ... | |
linger_rate
else:
run_time = run_time_base
rate_func = base_rate
opt_line_anim = ShowCreation(colored_line) if draw_line else empty_animation
line_draw_anim = AnimationGroup(
opt_line_anim,
walker_anim,
run_time = run_time,
rate_func = rate_func)
return (line_draw_anim, rebased_winder(1))
wind_so_far = 0... | |
tree produced by PlSqlParser#dependent_handling_clause.
def exitDependent_handling_clause(self, ctx:PlSqlParser.Dependent_handling_clauseContext):
pass
# Enter a parse tree produced by PlSqlParser#dependent_exceptions_part.
def enterDependent_exceptions_part(self, ctx:PlSqlParser.Dependent_exceptions_partContext)... | |
(255, 255, 255, 255),
526: (71, 186, 255, 255),
527: (255, 174, 0, 255),
528: (139, 95, 0, 255),
529: (48, 214, 255, 255),
530: (61, 101, 125, 255),
531: (255, 130, 97, 255),
532: (128, 74, 59, 255),
533: (255, 200, 200, 255),
534: (174, 0, 0, 255),
535: (255, 255, 192, 255),
536: (160, 88, 0, 255),
537: (2... | |
<filename>rtg/module/rnnmt.py
import random
from typing import Optional, Callable
import torch
import torch.nn.functional as F
from torch import nn
from tqdm import tqdm
from rtg import log, TranslationExperiment as Experiment
from rtg import my_tensor as tensor, device
from rtg.data.dataset import Batch, BatchIterab... | |
" `roundcube`@`{0}` IDENTIFIED BY "
"' '".format(self.app.config.get(
'mysql', 'grant-host')))
EEMysql.execute(self, "grant all privileges"
" on `roundcubemail`.* to "
" `roundcube`@`{0}` IDENTIFIED BY "
"'{1}'".format(self.app.config.get(
'mysql', 'grant-host'),
rc_passwd))
EEShellExec.cmd_exec(self, "mysql r... | |
msg)
return
try:
func_name = self.instance.get(p[2])
sub_terms = p[3]
p[0] = func_name(*sub_terms)
except tsk.LanguageError as e:
msg = "Error parsing expression, function '{}' is not declared".format(p[1])
raise SemanticError(self.lexer.lineno(), msg)
def p_binary_op(self, p):
'''
binary_op : multi_op
| ... | |
made with the expected
# request object values.
assert len(call.mock_calls) == 1
_, args, _ = call.mock_calls[0]
assert args[0].parent == "parent_value"
def test_list_intents_flattened_error():
client = IntentsClient(credentials=credentials.AnonymousCredentials(),)
# Attempting to call a method with both a re... | |
in rl["authors"] if int(a["id"]) in author_ids_set]
except:
continue
try:
for ai in author_ids:
citations = rl["n_citation"] + 1
fos = [f['name'] for f in rl['fos']]
fos_with_citations = [(f, citations) for f in fos]
all_tags_per_author[ai].extend(fos_with_citations)
except:
continue
del json_lines
del rel_l... | |
# Lakeshore 370, Lakeshore 370 temperature controller driver
# <NAME> <<EMAIL>>, 2014
# Based on Lakeshore 340 driver by <NAME> <<EMAIL>>, 2010.
#
# 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;... | |
<reponame>SdgJlbl/vault-cli
import contextlib
import logging
import os
import pathlib
import sys
from typing import (
Any,
Dict,
Generator,
Mapping,
NoReturn,
Optional,
Sequence,
TextIO,
Tuple,
)
import click
import yaml
import vault_cli
from vault_cli import client, environment, exceptions, settings, types
... | |
parser.add_argument('userName')
args = parser.parse_args()
jobId = args["jobId"]
userName = args["userName"]
result = JobRestAPIUtils.PauseJob(userName, jobId)
ret = {}
if result:
ret["result"] = "Success, the job is scheduled to be paused."
else:
ret["result"] = "Cannot pause the job. Job ID:" + jobId
resp ... | |
# -*- coding: utf-8 -*-
"""
@file
@brief First approach for a edit distance between two graphs.
See :ref:`l-graph_distance`.
Code adapted from https://github.com/sdpython/mlstatpy
"""
import copy
import re
import json
import numpy as np
class Vertex:
"""
Defines a vertex of a graph.
"""
def __init__(self, nb, ... | |
!pip install -qq shap==0.35.0
# !pip install -qq shap
import shap
# !pip install -qq torch==1.7.1
!pip install -qq transformers
!pip install -qq sentence-transformers
# !pip -qq install transformers==3.3.1
!pip install -qq torch==1.8.1
from tensorboard.plugins.hparams import api as hp
import tensorflow as tf
# !pip in... | |
not userpass:
logger.error("Unable to get password from env variable: "
"TCF_PASSWORD" + aka)
continue
logger.info("%s: login in with user/pwd from environment "
"TCF_USER/PASSWORD", rtb._url)
else:
if args.userid == None:
userid = raw_input('Login for %s [%s]: ' \
% (rtb._url, getpass.getuser()))
if userid =... | |
from os.path import join, dirname, isfile
from PySide2.QtWidgets import QDialog, QMessageBox, QLayout
from PySide2.QtCore import Qt, Signal
from logging import getLogger
from numpy import pi, array, array_equal
from .....GUI.Dialog.DMatLib.DMatSetup.Gen_DMatSetup import Gen_DMatSetup
from .....Classes.Material import ... | |
= xgb.XGBClassifier(max_depth=9, n_estimators=450, learning_rate=0.01)
xgclass.fit(x_train,y_train)
#print(xgclass.best_params_)
print("In-sample accuracy: " + str(train_acc_score(xgclass)))
print("Test accuracy: " + str(test_acc_score(xgclass)))
print ("In-sample Precision Score: " + str(train_prec_score(xgclass)))
pr... | |
<reponame>ifm/nexxT<filename>nexxT/services/gui/MainWindow.py<gh_stars>1-10
# SPDX-License-Identifier: Apache-2.0
# Copyright (C) 2020 ifm electronic gmbh
#
# THE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
#
"""
This module provides a MainWindow GUI service for the nexxT framework.
"""
import logging
im... | |
<reponame>victor-estrade/SystGradDescent<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import itertools
import numpy as np
import pandas as pd
import mat... | |
, '53366' : 'servo'
, '53411' : 'set' , '53412' : 'seth' , '53413' : 'seton' , '53414' : 'setup' , '53415' : 'seven'
, '53416' : 'sever' , '53421' : 'severe' , '53422' : 'sew' , '53423' : 'sewn' , '53424' : 'sex'
, '53425' : 'sexy' , '53426' : 'sf' , '53431' : 'sg' , '53432' : 'sh' , '53433' : 'shack'
, '53434' : 'shad... | |
= params['page']
if 'per_page' in params:
query_params['per_page'] = params['per_page']
if 'sort_by' in params:
query_params['sort_by'] = params['sort_by']
if 'sort_direction' in params:
query_params['sort_direction'] = params['sort_direction']
if 'ip' in params:
query_params['ip'] = params['ip']
if 'features'... | |
# -*- coding: utf-8 -*-
from datetime import datetime
import json
import os
import socket
from django import forms
from django.conf import settings
from django.forms.models import formset_factory, modelformset_factory
from django.template.defaultfilters import filesizeformat
import commonware
import happyforms
import... | |
- make_all - Has the required: foo'),
('dynamake', 'DEBUG', '#1 - make_all - Has the output: all time: 1'),
('dynamake', 'DEBUG',
'#1 - make_all - Write the persistent actions: .dynamake/make_all.actions.yaml'),
('dynamake', 'TRACE', '#1 - make_all - Done'),
('dynamake', 'DEBUG', '#0 - make - Synced'),
('dynamake... | |
import sys
from pypy.rlib.debug import check_nonneg
from pypy.rlib.unroll import unrolling_iterable
from pypy.rlib.rsre import rsre_char
from pypy.tool.sourcetools import func_with_new_name
from pypy.rlib.objectmodel import we_are_translated
from pypy.rlib import jit
from pypy.rlib.rsre.rsre_jit import install_jitdrive... | |
:param pulumi.Input[str] description: Network security rule description.
:param pulumi.Input[Sequence[pulumi.Input[str]]] destination_address_prefixes: The destination address prefixes. CIDR or destination IP ranges.
:param pulumi.Input[Sequence[pulumi.Input[str]]] destination_port_ranges: The destination port ranges... | |
cms.vdouble(2.56363, 0.0),
SMB_12 = cms.vdouble(2.128, -0.956, 0.0, 0.199, 0.0,
0.0),
SMB_12_0_scale = cms.vdouble(2.283221, 0.0),
SMB_20 = cms.vdouble(1.011, -0.052, 0.0, 0.188, 0.0,
0.0),
SMB_20_0_scale = cms.vdouble(1.486168, 0.0),
SMB_21 = cms.vdouble(1.043, -0.124, 0.0, 0.183, 0.0,
0.0),
SMB_21_0_scale... | |
= root_folder_path
# TODO: if os.name == 'nt' and len (root_folder_path) == 2 and root_folder_path[2] == ':': self.macos_root_folder += '\\'
if self.is_linux:
log.warning('Since this is a linux (mounted) system, there is no way for python to extract created_date timestamps. '\
'This is a limitation of Python. C... | |
<filename>tencentcloud/bmeip/v20180625/bmeip_client.py
# -*- coding: utf8 -*-
# Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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 ... | |
asynchronously,
returns the request thread.
"""
kwargs['_return_http_data_only'] = True
if kwargs.get('async_req'):
return self.get_device_datasource_list_with_http_info(device_id, **kwargs) # noqa: E501
else:
(data) = self.get_device_datasource_list_with_http_info(device_id, **kwargs) # noqa: E501
return data
... | |
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.nn as nn
import numpy as np
import math
from modules.encoder import EncoderCNN
from modules.ff_decoder import FFDecod... | |
"name": 'Makuhita',
"value": "makuhita",
"image": "img/makuhita.png",
"exclude": ['swsh']
},
{
"name": 'Hariyama',
"value": "hariyama",
"image": "img/hariyama.png",
"exclude": ['swsh']
},
{
"name": 'Azurill',
"value": "azurill",
"image": "img/azurill.png"
},
{
"name": 'Nosepass',
"value": "nosepass",
... | |
- 31: ooOoO0o - iIii1I11I1II1 + iII111i . Oo0Ooo / IiII % iIii1I11I1II1
if 6 - 6: IiII * i11iIiiIii % iIii1I11I1II1 % i11iIiiIii + o0oOOo0O0Ooo / i1IIi
if 53 - 53: I11i + iIii1I11I1II1
lisp . lisp_ipc_write_xtr_parameters ( lisp . lisp_debug_logging ,
lisp . lisp_data_plane_logging )
return
if 70 - 70: I1ii11iIi1... | |
<filename>src/cool/Visitors/cil_visitor.py
from cool.AST.ast_hierarchy import * # Quitar el 'Cool.' para correrlo
from cool.AST.ast_cil import *
import cool.Visitors.visitor as visitor
import cool.Context.context2 as enviroment
## Falta el CASE y STRING no c que hacer con los .DATA
## Falta tambien funcion entry
clas... | |
format checking against ontology using equivalentClass.""")
@pytest.mark.cwl_conformance
@pytest.mark.cwl_conformance_v1_1
@pytest.mark.docker
@pytest.mark.command_line_tool
@pytest.mark.green
def test_conformance_v1_1_output_secondaryfile_optional(self):
"""Test optional output file and optional secondaryFile ... | |
<filename>neo/Prompt/Commands/Tokens.py
from neo.Prompt.Commands.Invoke import InvokeContract, InvokeWithTokenVerificationScript
from neo.Wallets.NEP5Token import NEP5Token
from neo.Core.Fixed8 import Fixed8
from neo.Core.UInt160 import UInt160
from prompt_toolkit import prompt
from decimal import Decimal
from neo.Core... | |
<filename>test/base/interactor.py
from __future__ import print_function
import os
import re
from json import dumps
from logging import getLogger
from requests import get, post, delete, patch
from six import StringIO
from six import text_type
from galaxy import util
from galaxy.tools.parser.interface import TestColle... | |
import abc
import numpy as np
import scipy.integrate as scint
from . import sv_abc as sv
class OusvSchobelZhu1998(sv.SvABC):
"""
The implementation of Schobel & Zhu (1998)'s inverse FT pricing formula for European
options the Ornstein-Uhlenbeck driven stochastic volatility process.
References:
- <NAME>., & <NAM... | |
# -*- coding: utf-8 -*-
"""This module provides access to the auth REST api of Camunda."""
from __future__ import annotations
import typing
import dataclasses
import enum
import datetime as dt
import pycamunda
import pycamunda.base
import pycamunda.resource
from pycamunda.request import QueryParameter, PathParameter... | |
<reponame>jkalleberg/NEAT<filename>source/SequenceContainer.py
import random
import copy
import pathlib
import bisect
import pickle
import sys
import numpy as np
from Bio.Seq import Seq
from source.neat_cigar import CigarString
from source.probability import DiscreteDistribution, poisson_list
# TODO This whole file ... | |
or (key_resp_light.keys == path1_corr):
key_resp_light.corr = 1
else:
key_resp_light.corr = 0
# a response ends the routine
continueRoutine = False
# check for quit (typically the Esc key)
if endExpNow or defaultKeyboard.getKeys(keyList=["escape"]):
core.quit()
# check if all components have fin... | |
<gh_stars>0
# Generated from names extracted from https://support.google.com/docs/table/25273
from gigamonkeys.formulas import Function
def DATE(*args) -> Function:
"""
Converts a provided year, month, and day into a date.
Learn more: https//support.google.com/docs/answer/3092969
"""
return Function("DATE", ar... | |
the consignment.
Examples of a participant are:
The Sender - the company sending the consignment
The Receiver - the company receiving the consignment
The Collection Address - the address from which the consignment is picked
up
The Delivery Address - the address to which the consignment should be
delivered"""
__... | |
Act & Assert
act_and_assert(source_markdown, expected_gfm, expected_tokens)
@pytest.mark.gfm
def test_paragraph_extra_f4():
"""
Test case extra f4: Collapsed link inside of full link
"""
# Arrange
source_markdown = """a[foo [bar][]][bar]a
[bar]: /url 'title'"""
expected_tokens = [
"[para(1,1):]",
"[text(1... | |
df[Y[0]] = pd.to_numeric(df[Y[0]])
# ate = df.groupby(X)[Y[0]].mean()
# print(ate)
return df
def old_marginal_repair(self, data, X, Y, method='MF'):
self.data = data # A continacy table as Matrix
self.columns = data.columns
self.X = X
self.Y = Y
rest = []
for att in self.columns:
if att not in X and att not... | |
# Copyright (c) 2020 <NAME> - <EMAIL>
# 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, merge, publish, d... | |
coin_flip == 1:
# filename.append(raw_filename + '_R')
# right = True
if self.parity == 'combined':
filename.append(raw_filename + '_L')
filename.append(raw_filename+'_R')
# filename is now a list of the correct filenames.
# now add warps if required
if self.number_of_warps != 0:
warp_choice = str(ran... | |
-> Optional[pulumi.Input[Sequence[pulumi.Input['CheckAlertChannelSubscriptionArgs']]]]:
return pulumi.get(self, "alert_channel_subscriptions")
@alert_channel_subscriptions.setter
def alert_channel_subscriptions(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['CheckAlertChannelSubscriptionArgs']]]]):
pulum... | |
import unittest
import numpy as np
import tinygfx.g3d as cg
from tinygfx.g3d import primitives
class TestCountedObject(unittest.TestCase):
def setUp(self):
self.obj = cg.CountedObject()
def test_count_incrementing(self):
obj_id = self.obj.get_id()
for _ in range(20):
next_id = cg.CountedObject().get_id()
self... | |
#!/usr/bin/env python3
# System imports
from math import sqrt
import sys
import unittest
# Import NumPy
import numpy_demo as np
major, minor = [ int(d) for d in np.__version__.split(".")[:2] ]
if major == 0: BadListError = TypeError
else: BadListError = ValueError
import Tensor
######################################... | |
<filename>frigate/object_processing.py
import base64
import copy
import datetime
import hashlib
import itertools
import json
import logging
import os
import queue
import threading
import time
from collections import Counter, defaultdict
from statistics import mean, median
from typing import Callable, Dict
import cv2
i... | |
= ''
plansopinstuid = ''
planseriesinstuid = ''
doseseriesuid = ''
doseinstuid = ''
planfilename = ''
dosexdim = 0
doseydim = 0
dosezdim = 0
doseoriginx = ""
doseoriginy = ""
doseoriginz = ""
beamdosefiles = []
pixspacingx = ""
pixspacingy = ""
pixspacingz = ""
posrefind = ""
image_orientation = []
im... | |
<filename>pyunfurl/provider_data/oembed.py
OEMBED_PROVIDER_LIST = [
[
"https://(\\S*\\.)?youtu(\\.be/|be\\.com/watch)\\S+",
"https://www.youtube.com/oembed?scheme=https&",
],
[
"http://(\\S*\\.)?youtu(\\.be/|be\\.com/watch)\\S+",
"https://www.youtube.com/oembed",
],
["https?://wordpress\\.tv/\\S+", "http://wor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.