input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<reponame>mikegashler/debatestuff
from typing import List, Mapping, Dict, Any, cast, Tuple, Optional, Set
import webserver
import urllib.parse
import json
import sessions
import random
import rec
import accounts
import traceback
import posts
import history
import notifs
from PIL import Image
# Load the feed page
with ... | |
<reponame>uibcdf/MolModMTs
from molsysmt._private.exceptions import NotWithThisFormError as _NotWithThisFormError
from molsysmt._private.exceptions import NotImplementedMethodError as _NotImplementedMethodError
from molsysmt._private.digestion import digest_item as _digest_item
from molsysmt._private.digestion import d... | |
a file using compressor specified by |infile| suffix.
Args:
infile: File to uncompress. Compression used is based on the
type of suffix of the name specified (e.g.: .bz2).
outfile: Name of output file.
"""
comp_str = infile.rsplit('.', 1)[-1]
comp_type = CompressionStrToType(comp_str)
assert comp_type and comp... | |
specified ``driver``.
* ``fields``: A list containing one or more fields to be returned
in the response. This may lead to some performance gain
because other fields of the resource are not refreshed.
* ``limit``: Requests at most the specified number of ports be
returned from the query.
* ``marker``: Specifies th... | |
columns are project name, edge start node id,
edge end node id, and edge operation.
:param filename:
:param additionalpaths: paths that describe nested keys within the edge dictionary identifying
those keys' value to be placed as columns in the CSV
:param nodeFilter: a function that accepts the node dictionary and... | |
from __future__ import division
from collections import defaultdict
from math import ceil
from .activesliceitem import ActiveSliceItem
from cadnano.gui.controllers.itemcontrollers.partitemcontroller import PartItemController
from .prexoveritem import PreXoverItem
from .strand.xoveritem import XoverNode3
from cadnano.g... | |
<reponame>lowdrant/CalibratePSEye<filename>CalibratePSEye.py
#!/usr/bin/env python3
"""
This software is copyrighted material (C) <NAME> 2020
The library is provided under the Apache 2.0 License,
as found at https://www.apache.org/licenses/LICENSE-2.0
OVERVIEW:
This file contains a robust (some might say ornery) i... | |
#!/usr/bin/env -S python -u
#
# Copyright (C) 2022 The Android Open Source Project
#
# 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 re... | |
<gh_stars>0
"""Generated message classes for resourceviews version v1beta1.
The Resource View API allows users to create and manage logical sets of Google
Compute Engine instances.
"""
from protorpc import messages
package = 'resourceviews'
class Label(messages.Message):
"""The Label to be applied to the resourc... | |
from OTLMOW.PostenMapping.Model.Post050100000 import Post050100000
from OTLMOW.PostenMapping.Model.Post050200100 import Post050200100
from OTLMOW.PostenMapping.Model.Post050200200 import Post050200200
from OTLMOW.PostenMapping.Model.Post050200300 import Post050200300
from OTLMOW.PostenMapping.Model.Post050302000 import... | |
from .fhirbase import fhirbase
class ConceptMap(fhirbase):
"""
A statement of relationships from one set of concepts to one or more
other concepts - either code systems or data elements, or classes in
class models.
Args:
resourceType: This is a ConceptMap resource
url: An absolute URI that is used to identify... | |
# Copyright 2021, Optimizely
# 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... | |
<gh_stars>1-10
import logging
import math
import os
import shutil
import time
import warnings
from datetime import datetime
import cloudpickle
import numpy as np
import pandas as pd
from featuretools.computational_backends.feature_set import FeatureSet
from featuretools.computational_backends.feature_set_calculator i... | |
<filename>src/kitti_data_utils.py
"""
# -*- coding: utf-8 -*-
-----------------------------------------------------------------------------------
# Refer: https://github.com/ghimiredhikura/Complex-YOLOv3
"""
from __future__ import print_function
import numpy as np
import cv2
import os
class Object3d(object):
''' 3d... | |
# -*- coding: utf-8 -*-
#
# The MIT License (MIT)
#
# Copyright (c) 2019 <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 right... | |
that appears on the welcome area of the login screen.<br/>Minimum length = 1<br/>Maximum length = 255.
"""
try :
return self._welcomemessage
except Exception as e:
raise e
@welcomemessage.setter
def welcomemessage(self, welcomemessage) :
ur"""Localized welcome message that appears on the welcome area o... | |
<reponame>clb1/RT-qSeq
from collections import defaultdict, Counter, namedtuple, OrderedDict
from copy import copy
import datetime
from operator import itemgetter, methodcaller, mul
from itertools import chain, combinations, combinations_with_replacement, groupby, permutations, product
from math import exp
import glob
... | |
Optmizing Shortcut: If the variable is a class then just
# call its type that class definition, i.e. 'mymodule.MyClass'
# instead of 'type(call(mymodule.MyClass))'.
# Remove the common leading namespace elements.
scope_parts = list(variable["nspath"])
if curr_ns is not None:
for part in curr_ns["nspath"]:
if sc... | |
import getpass, shutil, json, os, re, sys, subprocess
from time import sleep, perf_counter
from threading import Thread
import datetime as dt
from tkinter import ttk, filedialog, messagebox
import tkinter as Tk
# classes
from classes.logger import Logger
from classes.game import Game
from classes.backup import Backup
... | |
"""
Tests for attack.dictionaries module.
"""
import math
import os
import dataclasses
import pytest
import tempfile
from typing import List
from test_common.fs.ops import copy_files
from test_common.fs.temp import temp_dir
from cifra.attack.dictionaries import Dictionary, get_words_from_text, \
NotExistingLanguage,... | |
<reponame>chunglabmit/phathom
import argparse
import itertools
import logging
import json
import matplotlib
matplotlib.use("Agg")
import matplotlib.backends.backend_pdf
from matplotlib import pyplot
import numpy as np
import os
import sys
from phathom.utils import pickle_load
from phathom.registration.coarse import ri... | |
= list(unify_columns(X, [(0, None), (1, None), (2, None)], feature_names_in, min_unique_continuous=0))
assert(3 == len(X_cols))
assert(X_cols[0][1][0] == 1.0)
assert(X_cols[1][1][0] == 2.0)
assert(X_cols[2][1][0] == 3.0)
def test_unify_feature_names_numpy2():
X = np.array([[1, 2, 3], [4, 5, 6]])
X, n_samples = c... | |
# -*-coding:utf-8-*-
"""
工具模块
@author <NAME>
"""
import ctypes
import imghdr
import json
import os
import pickle
import re
import shutil
import threading
import time
import typing
import urllib.request
import webbrowser
from typing import List, Union
import pythoncom
import requests
import win32api
import win32com.c... | |
<reponame>akmaru/veriloggen
from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import thread_ram_copy
expected_verilog = """
module test;
reg CLK;
reg RST;
blinkled
uut
(
.CLK(CLK),
.RST(RST)
);
initial begin
CLK = 0;
forever begin
#5 CLK = !CLK;
end
end
... | |
<filename>ostap/logger/mute.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# =============================================================================
## @file
# Module with some simple but useful utilities
# - suppression of stdout/stderr
# @author <NAME> <EMAIL>
# @date 2013-02-10
#
# ========================... | |
sha1={2}"
.format(filing, document["sequence"], document["sha1"]))
else:
logger.info("Raw file for filing={0}, sequence={1}, sha1={2} already exists on S3"
.format(filing, document["sequence"], document["sha1"]))
# Upload text to S3 if requested
if store_text and document["content_text"] is not None:
raw_path =... | |
<filename>src/genie/libs/parser/ios/tests/test_show_platform.py
#!/bin/env python
import unittest
from unittest.mock import Mock
from pyats.topology import Device
from genie.metaparser.util.exceptions import SchemaEmptyParserError,\
SchemaMissingKeyError
from genie.libs.parser.ios.show_platform import ShowVersion,\
... | |
new_scale_factor = min(y_scale, x_scale)
new_scale_factor = max(1, new_scale_factor)
# only update and redraw if scaling has changed
if new_scale_factor != self.scale_factor:
self.scale_factor = new_scale_factor
self.update_image = True
def update_mouse_position(self, x, y):
'''
Helper function for adjusting ... | |
assert_out["unsafe_good"])
try:
timefloat = float(timestring)
except:
timefloat = 0.0
print "WARNING: logging zero time for " + sourcefile + " for " + tool.ID + "; this is probably a mistake"
count_add(tool_time, tool.ID, timefloat)
table.set(sourcefilekey, "toolassert/"+tool.ID, assert_out["html"])
if not o... | |
being sent
# Output:
# True/False
#-----------------------------------------------------------------------
def done(self, direction=SERVER):
# Client is still receiving payload
if direction == SERVER:
mbit = self.get_option_value(self.BLOCK2, 'mbit')
if mbit == 1:
return False
return True
# Client is done ... | |
<filename>src/spyglass/decoding/clusterless.py
"""Pipeline for decoding the animal's mental position and some category of interest
from unclustered spikes and spike waveform features. See [1] for details.
References
----------
[1] Denovellis, <NAME>. et al. Hippocampal replay of experience at real-world
speeds. eLife ... | |
<reponame>joshcoales/Hallo
import enum
import logging
from abc import ABCMeta
from datetime import datetime
from typing import List, Dict, Any, Union, Optional, TYPE_CHECKING, Type, Tuple
if TYPE_CHECKING:
from hallo.hallo import Hallo
from telegram import Update, Message
from hallo.destination import Destination, ... | |
[<instance>]
Options:
-h, --help Print this help
"""
instance_name = arguments['<instance>']
instance_name = self.activate(instance_name)
vmrun = VMrun(self.vmx, user=self.user, password=<PASSWORD>)
print(vmrun.listSnapshots())
def pop(self, arguments):
"""
Restore state that was pushed with `mech snapshot... | |
== expected
def test_erf_f_code():
x = symbols('x')
routine = make_routine("test", erf(x) - erf(-2 * x))
code_gen = FCodeGen()
source = get_string(code_gen.dump_f95, [routine])
expected = (
"REAL*8 function test(x)\n"
"implicit none\n"
"REAL*8, intent(in) :: x\n"
"test = erf(x) + erf(2.0d0*x)\n"
"end functio... | |
# Copyright 2019 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, softw... | |
import numpy as np
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import os
import glob
from scipy.stats import zscore
import importlib
import zipfile
import math
import utils
import scipy as sp
from scipy import io
import scipy.signal
from scipy.sparse.linalg import eigsh
import csv
impor... | |
<reponame>breandan/tensorflow<filename>tensorflow/contrib/rnn/python/ops/rnn_cell.py
# Copyright 2015 The TensorFlow 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... | |
<filename>pypassage/reference.py
# -*- coding: utf-8 -*-
from . import bibledata
from collections import defaultdict
from operator import itemgetter
from builtins import int # subclass of long on Py2
import warnings
import re
## Long term ##
# Implement string parsing
class Passage(object):
def __init__(self, book,... | |
<filename>tensorflow_model_analysis/eval_saved_model/util.py
# Copyright 2018 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-2.0
#
# Un... | |
import os
import time
from datetime import datetime
import numpy as np
import numpy.random as npr
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import tensorflow as tf
print(tf.__version__)
from tensorflow.python.client import device_lib
device_lib.list_local_devices()
from tensorflow.contr... | |
list0 = []
L3 = []
L4 = []
L5 = []
L6 = []
while sorted(L6) == sorted(L3) or sorted(L4) == sorted(L3) or sorted(L5) == sorted(L3):
L4 = []
L5 = []
a = random.randint(b, 8)
L1 = random.sample(range(1, 10), a)
L2 = random.sample(range(1, 10), a)
L3 = random.sample(range(1, 10), a)
L = L1 + L2
L6... | |
"""MySQL Plugin
This is designed to be a drop-in replacement for the newrelic java mysql plugin found at
https://github.com/newrelic-platform/newrelic_mysql_java_plugin
Like all other plugins, the config can be a dict, which will represent the config for a single instance.
It can also be a list of instances, each wit... | |
= 1,
temp_dir = None, remove_temp_dir = True,
metrics = ['accuracy', 'precision', 'recall', 'f1score'],
metric_average = 'macro',
params = {'epochs': 1, # number of iterations over the full set
'lr': 0.0001}):
""" Train a native discriminative learning model
Parameters
----------
data_train: dataframe or ... | |
#!/usr/bin/env python
# coding=utf-8
"""
This is a script for downloading and converting the microsoft coco dataset
from mscoco.org. This can be run as an independent executable to download
the dataset or be imported by scripts used for larger experiments.
"""
from __future__ import division, print_function, unicode_li... | |
# -*- coding: utf-8 -*-
import numpy as np
import pytest
from hypothesis import assume
from hypothesis import given
from hypothesis.extra.numpy import arrays
from hypothesis.strategies import integers
from hypothesis.strategies import sampled_from
from hypothesis.strategies import text
from nata.axes import Axis
from ... | |
generate build files.
:param autodeps_file: Absolute path to the expected .autodeps file.
:raises InvalidSignatureError:
"""
if self._no_autodeps_signatures:
with self._wrap_file_access(wrap=False):
with open(autodeps_file, 'r') as stream:
return json.load(stream)
else:
with self._wrap_file_access(wrap=False)... | |
in r])
return v, dv.LooseVersion(xrtversion)
except:
pass
def _addAction(self, module, elname, table, afunction, menu):
objName = '{0}.{1}'.format(module.__name__, elname)
elAction = qt.QAction(self)
elAction.setText(elname)
elAction.hovered.connect(
partial(self.showObjHelp, objName))
elAction.triggered.con... | |
= "licGP"
LIC_STATE = "licState"
LIC_VENDOR = "licVendor"
LIC_VERSION = "licVersion"
LIFE_CYCLE = "lifeCycle"
LIMIT = "limit"
LINE = "line"
LINK_AGGREGATION_PREF = "linkAggregationPref"
LINK_DOWN_TIMEOUT = "linkDownTimeout"
LINK_FAILURE_COUNT = "linkFailureCount"
LINK_FAILURE_COUNT_DELTA = "linkFailureCountDe... | |
+ str(result["status"]) + "</td></tr><tr>"
try:
table_body += "<td style='border:1px solid blue;border-bottom: double blue;width:5%;text-align:center'>PRIORITY</td>" \
"<td style='border:1px solid black;text-align:center'>" + result["priority"] + "</td></tr><tr>" \
"<td style='border:1px solid blue;border-bottom: d... | |
Suhner AG",
"000D87": "Elitegroup Computer System Co. (ECS)",
"000D88": "D-Link Corporation",
"000D89": "Bils Technology Inc",
"000D8A": "Winners Electronics Co., Ltd.",
"000D8B": "T&D Corporation",
"000D8C": "Shanghai Wedone Digital Ltd. CO.",
"000D8D": "Prosoft Technology, Inc",
"000D8E": "Koden Elect... | |
type: () -> None
schema = Tuple(Integer(gt=0), UnicodeString(), Constant('I love tuples'))
self.assertEqual(
schema.errors((1, 'test', 'I love tuples')),
[]
)
# too short
self.assertEqual(
schema.errors((1, 'test')),
[Error('Number of elements 2 does not match expected 3')]
)
# too long
self.assertEqual(... | |
leadtarget is closer than the target, if so the target is moving towards us, so just run to the unit.
if unit_obj.unit.distance_to(leadTarget) < unit_obj.unit.distance_to(enemy.position):
return enemy.position
if _debug_combat:
self._client.debug_sphere_out(Point3((leadTarget.position.x, leadTarget.po... | |
<gh_stars>1-10
# coding=utf-8
from tipoinstalacion.models import CT
from expects import expect, equal
with description('Calculando el TI de un CT'):
with context('si valores Nulos'):
with before.each:
self.c = CT()
expect(self.c.tipoinstalacion).to(equal(None))
with context('si 12kV>=tension>1kV'):
with before... | |
# the system UART, optimized specifically for our use case.
# includes: CRC generator, receive timeout timer, receive FIFO, fixed divisor
from nmigen import *
from nmigen.asserts import Past, Rose, Fell
from nmigen.lib.cdc import FFSynchronizer
from nmigen.lib.fifo import SyncFIFOBuffered
from boneless.arch.opcode imp... | |
<filename>examples/hifi/EnvironmentPrediction/Predictions/ConvLSTMPredictions/prednet.py
'''Code from: https://github.com/coxlab/prednet'''
# Ensure random seed
import numpy as np
import tensorflow as tf
import random as rn
np.random.seed(123)
rn.seed(123)
from keras import backend as K
tf.set_random_seed(123)
from k... | |
<reponame>TetrationAnalytics/imcsdk<filename>imcsdk/apis/server/storage.py
# Copyright 2016 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/license... | |
import datetime
import operator
from decimal import *
from django.forms import fields
from django.shortcuts import redirect, render, render_to_response, HttpResponseRedirect
from django.contrib.auth.decorators import login_required
from django.http import JsonResponse
from django.core.exceptions import ObjectDoesNotEx... | |
# -*- coding: utf-8 -*-
"""
GIS
"""
module = "gis"
MARKER = T("Marker")
# Expose settings to views/modules
_gis = s3.gis
# For Bulk Importer
s3.gis_import_csv = gis.import_csv
# This is needed for onvalidation
# The edit_L1..edit_L5 values are per country, and are in the gis_config
# records associated with each ... | |
`channel_admin`) for a user on a specific team.
Permissions:
Logged in as the user and `view_team` permission for the
team. Having `manage_system` permission voids the previous
requirements.
Api Reference:
`GetChannelMembersForUser <https://api.mattermost.com/#operation/GetChannelMembersForUser>`_
"""
url = ... | |
<filename>lingvo/core/layers_with_gpipe_test.py<gh_stars>0
# Lint as: python3
# Copyright 2019 The TensorFlow 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
#
#... | |
# -*- coding: utf-8 -*-
"""A searcher to find file entries within a file system."""
import re
import sre_constants
from dfvfs.lib import definitions
from dfvfs.lib import errors
from dfvfs.lib import glob2regex
from dfvfs.lib import decorators
from dfvfs.path import factory as path_spec_factory
class FindSpec(objec... | |
loss, sum(curr_items) match the curr_items_total.
We then remove and add back two nodes at a time and so on until we have reached the point
where we are adding back and removing at least half of the nodes.
"""
self.add_remove_servers_and_rebalance(self.cluster.servers[self.nodes_init:self.num_servers], [])
gen = s... | |
-1.1013040691614151e-01</leafValues></_>
<_>
<internalNodes>
0 -1 190 7.5654466636478901e-03</internalNodes>
<leafValues>
-1.2437944859266281e-01 3.3316314220428467e-01</leafValues></_>
<_>
<internalNodes>
0 -1 153 1.6171240713447332e-03</internalNodes>
<leafValues>
9.5025621354579926e-02 -6.2460541725158691e... | |
the score of cluster 1;
metric_values = {metrics[0]: 0.2, metrics[1]: 0.01}
set_static_metrics(metric_values)
score_cluster_1 = get_scheduling_score(
clusters[0], metric_values, metric_weights, scheduled_to=clusters[0]
)
score_cluster_2 = get_scheduling_score(
clusters[1], metric_values, metric_weights, schedule... | |
the expected
# request object values.
assert len(call.mock_calls)
_, args, _ = call.mock_calls[0]
assert args[0].name == "name_value"
@pytest.mark.asyncio
async def test_get_inspect_template_flattened_error_async():
client = DlpServiceAsyncClient(credentials=credentials.AnonymousCredentials(),)
# Attempting t... | |
skill in sorted(char.db.skills):
skill_str += " {c" + skill + "{n: {w" + str(char.db.skills[skill]) + "{n\t"
caller.msg(skill_str)
caller.msg("""
To see a list of skills, enter '{whelp skills{n', with a description of each
under '{whelp {c<skill name>{n'. Stats cost 1 point regardless of their current
rank, while sk... | |
none
export_policy: default
vserver: "{{ vserver }}"
hostname: "{{ netapp_hostname }}"
username: "{{ netapp_username }}"
password: "{{ <PASSWORD> }}"
https: False
unix_permissions: 777
snapshot_policy: default
time_out: 0
- name: Create FlexVol with QoS adaptive
na_ontap_volume:
state: present
name: ansib... | |
<reponame>zhouguangfu/FreeROI
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Dataset definition class for PyBP GUI system.
"""
import re
import os
import sys
import nibabel as nib
import numpy as np
from PyQt4.QtCore import *
from PyQt4.QtGui imp... | |
),
tf.float32,
)
# [1, 1, hidden_size]
no_next_hidden = tf.reshape(no_next_hidden, (1, 1, hidden_size))
# [batch_size, 1, hidden_size]
no_next_hidden = tf.repeat(no_next_hidden, tf.shape(hidden)[0], axis=0)
# [batch_size, seq_len + 1, hidden_size]
# Note: The no relation embedding comes first, this matters for ... | |
import binascii
import array
from functools import reduce
import time
import serial
PN532_PREAMBLE = 0x00
PN532_STARTCODE1 = 0x00
PN532_STARTCODE2 = 0xFF
PN532_POSTAMBLE = 0x00
PN532_HOSTTOPN532 = 0xD4
PN532_PN532TOHOST = 0xD5
# PN532 Commands
PN532_COMMAND_DIAGNOSE = 0x00
PN532_COMMAND_GETFIRMWAREVERSION = 0x02
PN5... | |
pw_aff(arg1)
except:
return union_pw_aff(arg0).ge_set(arg1)
ctx = arg0.ctx
res = isl.isl_pw_aff_ge_set(isl.isl_pw_aff_copy(arg0.ptr), isl.isl_pw_aff_copy(arg1.ptr))
obj = set(ctx=ctx, ptr=res)
return obj
def gist(arg0, arg1):
try:
if not arg0.__class__ is pw_aff:
arg0 = pw_aff(arg0)
except:
raise
try:
if ... | |
<filename>opensilexClientToolsPython/models/observation_unit_dto.py
# coding: utf-8
"""
OpenSilex API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: INSTANCE-SNAPSHOT
Generated by: https://github.com/swagger-api/swagger-c... | |
###########################################################################
# ____ _____________ __ __ __ _ _____ ___ _ #
# / __ \/ ____/ ___/\ \/ / | \/ (_)__ _ _ __|_ _/ __| /_\ (R) #
# / / / / __/ \__ \ \ / | |\/| | / _| '_/ _ \| || (__ / _ \ #
# / /_/ / /___ ___/ / / / |_| |_|_\__|_| \___/|_| \___/_/ \_\ #
# /_____... | |
setting is to use the entire set of\n"\
"chromosomes from the data."
)
pre.add_argument(
"-trans",
dest="trans",
required=False,
default=False,
action="store_true",
help=
"Whether to parse trans- (inter-chromosomal) PETs. The default is to\n"
"ignore trans-PETs. Set this flag to pre-process all PETs."
)
pr... | |
<filename>projectq/libs/math/_quantummath.py
# Copyright 2020 ProjectQ-Framework (www.projectq.ch)
#
# 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... | |
of Care and Abuse (CECA): a retrospective
# interview measure. *Journal of Child Psychology and Psychiatry*, 35(8), 1419-1435.
#
# """
# score_name = "CECA"
#
# # create copy of data
# data = data.copy()
#
# if columns is not None:
# # if columns parameter is supplied: slice columns from dataframe
# _assert_has_columns... | |
'/Portals/findOne'.replace('{format}', 'json')
path_params = {}
query_params = {}
if 'filter' in params:
query_params['filter'] = params['filter']
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_... | |
<gh_stars>10-100
# -*- coding: utf-8 -*-
# Copyright 2014 OpenMarket Ltd
# Copyright 2017 Vector Creations Ltd
# Copyright 2019-2020 The Matrix.org Foundation C.I.C.
#
# 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 ... | |
<filename>tests/st/auto_monad/test_auto_monad_gpu.py
# Copyright 2020 Huawei Technologies Co., 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... | |
= p - mid_point
d = d / np.linalg.norm(d)
points_radial.InsertNextTuple3(d[0], d[1], d[2])
# Record the type of the point (1 = endo, 2 = epi)
points_label.InsertNextTuple1(1)
# Record the segment ID
seg_id = determine_la_aha_segment_id(p, la_idx, aha_axis, mid_line, part_z)
points_aha.InsertNextTuple1(seg_id)
... | |
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228,
'Renaming Unit/Peak Dynamic': 3.58947,
'Renaming Unit/Runtime Dynamic': 0.172807,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 3.13934,
'S... | |
res or "RSN" not in res:
raise Exception("Unexpected GET_CAPABILITY proto response: " + str(res))
res = dev[0].get_capability("auth_alg")
if "OPEN" not in res or "SHARED" not in res:
raise Exception("Unexpected GET_CAPABILITY auth_alg response: " + str(res))
res = dev[0].get_capability("modes")
if "IBSS" not in... | |
Parameters
----------
N : :class:`~infrastructure.InfrastructureNetwork`
An InfrastructureNetwork instance .
T : int
Number of time steps to optimize over.
layers : list
Layer IDs of N included in the optimization..
actions : list
An array of actions from a previous optimization. Likely taken from an
INDPResu... | |
[ 'data+information+infosphere+management+master+product+server'],
'infosphere_master_data_management_server_product_information_management': [ 'infosphere+master+data+management+server+product+information+management'],
'infosphere_metadata_workbench': ['infosphere+metadata+workbench'],
'infosphere_optim': ['infosph... | |
instance. The URL and its arguments will vary depending
on the query.
"""
return None
def _add_attribute_type(self, key, label, default_value=None):
"""
Adds a new type of attribute to the list of attributes
understood by this query. Meant to be used by the constructors
in derived classes.
"""
if len(self.at... | |
"""Collection of functions related to data."""
from functools import partial
import torch
def scale_features(X, approach='standard'):
"""Scale feature matrix.
Parameters
----------
X : torch.Tensor
Tensor of shape (n_samples, n_channels, lookback, n_assets). Unscaled
approach : str, {'standard', 'percent'}
... | |
биты',
'wpn_budget':0.01,
'wpn_name_new':'Летающие танки новые',
'wpn_name_mid':'Летающие танки устаревшие',
'wpn_name_old':'Летающие танки под списание',
'wpn_age_mid':10,
'wpn_age_old':20,
'wpn_a':0.05,
'wpn_b':0.0002,
'wpn_c':1.4,
'wpn_ammo_1_name':'Стреловидные пули',
'wpn_ammo_1_capacity':5000,
'wpn_am... | |
Enum637(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
ASTERISK = "*"
PAGES = "pages"
PARENT_NOTEBOOK = "parentNotebook"
PARENT_SECTION_GROUP = "parentSectionGroup"
class Enum638(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
ID = "id"
SELF = "self"
CREATED_DATE_TIME = "createdDateTime"
CREATED... | |
#
# 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... | |
a conversion chain between two types
"""
def get_all_conversion_chains_to_type(self, to_type: Type[Any])\
-> Tuple[List[Converter], List[Converter], List[Converter]]:
"""
Utility method to find all converters to a given type
:param to_type:
:return:
"""
return self.get_all_conversion_chains(to_type=to_type)
... | |
oprot):
if oprot._fast_encode is not None and self.thrift_spec is not None:
oprot.trans.write(oprot._fast_encode(self, [self.__class__, self.thrift_spec]))
return
oprot.writeStructBegin('CancelOperation_args')
if self.req is not None:
oprot.writeFieldBegin('req', TType.STRUCT, 1)
self.req.write(oprot)
oprot.wri... | |
from copy import deepcopy
from datetime import datetime
# Exempting Bandit security issue (Using Element to parse untrusted XML data is known to be vulnerable to XML attacks)
#
# We don't currently allow untrusted/user-provided XML so this is not a risk
from typing import Optional
from lxml.etree import SubElement, E... | |
= np.delete(self.freqs, (-1))
rowsum = sum(abs(self.dyn[-1][:]))
# Trim left
colsum = sum(abs(self.dyn[:][0]))
while colsum == 0 or np.isnan(rowsum):
self.dyn = np.delete(self.dyn, (0), axis=1)
self.times = np.delete(self.times, (0))
colsum = sum(abs(self.dyn[:][0]))
colsum = sum(abs(self.dyn[:][-1]))
# Trim r... | |
knowledge_graph: KgeKnowledgeGraph = self.get_knowledge_graph(kg_id)
knowledge_graph.load_file_set_versions(versions=entry['versions'])
def load_provider_metadata(self, kg_id, metadata_text: str) -> bool:
"""
Metadata assumed to be a YAML string to be parsed into a Python dictionary
:param kg_id:
:param metadata... | |
it, jt, ix, jx):
if 0 < jt <= m.ncp_t and 0 < jx <= m.ncp_x:
return m.Red[it, jt, ix, jx] == m.ve[it, jt, ix, jx] * m.dp * m.rhog[it, jt, ix, jx] / m.mug
else:
return Constraint.Skip
# Nup
def a45_rule(m, it, jt, ix, jx):
if 0 < jt <= m.ncp_t and 0 < jx <= m.ncp_x:
return m.Nup[it, jt, ix, jx] == 0.03 * (m.Red[... | |
from chunkypipes.components import *
import multiprocessing
import math
import datetime
import sys
import os
import time
class Pipeline(BasePipeline):
def dependencies(self):
return ['pandas', 'numpy', 'matplotlib', 'fpdf', 'Pillow', 'pypdf2', 'statistics', 'xlrd']
def description(self):
return 'Pipeline made f... | |
Pool 3300: 0 0
Pool 4000: 0 0
Pool 4500: 0 0
Pool 5000: 0 0
Pool 20000: 0 0
Message logging pool summary:
Alloc Free
Pool 100: 0 0
Pool 200: 0 0
Pool 500: 0 0
Pool 2200: 0 0
Pool 4500: 0 0
BMP pool summary:
Alloc Free
Pool 100: 0 0
Pool 200: 0 0
Pool 300: 0 0
Pool 400: 0 0
Pool 5... | |
<reponame>callowayproject/epub-creator
from django import template
from django.template.loader import get_template
common_second_words = ('al', 'da', 'de', 'del', 'dela', 'della', 'di', 'du', 'el', 'la', 'le', 'mc', 'o\'', 'san', 'st', 'sta', 'van', 'vande', 'vanden', 'vander', 'von',)
common_third_words = ('van', 'de... | |
<gh_stars>100-1000
""" Logic to write ELF files.
"""
import io
import logging
from collections import defaultdict
from ...arch.arch_info import Endianness
from ... import ir
from .headers import ElfMachine
from .headers import SectionHeaderType, SectionHeaderFlag
from .headers import SymbolTableBinding, SymbolTableTyp... | |
<filename>pygit/pygit.py
#! /usr/bin/python3.6
import os
import sys
import shutil
import shelve
import argparse
import logging
from datetime import datetime
from subprocess import Popen, PIPE, STDOUT
from pathlib import Path, PurePath, PureWindowsPath
from send2trash import send2trash
BASE_DIR = Path.home()
DESKTOP... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.