input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
from wallaby import *
import constants as c
import movement as m
#---------------------------------------------States-------------------------------------------
def BlackLeft():
return(get_create_lcliff_amt() < c.LCLIFF_BW)
def NotBlackLeft():
return(get_create_lcliff_amt() > c.LCLIFF_BW)
def BlackRight():
ret... | |
serial, which is ATMLXXXXYYYYYYY
# where XXXX is the board identifier.
# This can be verified by looking at readme.htm, which also uses the board ID to redirect to platform page
device['target_id'] = device['target_id_usb_id'][4:8]
platform_data = self.plat_db.get(device['target_id'],
device_type='atmel',
verbos... | |
),
Element( u'N405', Properties(desc=u'Location Qualifier', req_sit=u'S', data_type=(u'ID',u'1',u'2'), position=5,
codes=[u'B1', u'DP'] ) ),
Element( u'N406', Properties(desc=u'Location Identifier', req_sit=u'S', data_type=(u'AN',u'1',u'30'), position=6,
codes=[] ) ),
),
Segment( u'PER', Properties(syntax='',req_si... | |
<reponame>Agnarsh/functions
# *****************************************************************************
# © Copyright IBM Corp. 2018. All Rights Reserved.
#
# This program and the accompanying materials
# are made available under the terms of the Apache V2.0 license
# which accompanies this distribution, and is ava... | |
return an analog filter, otherwise a digital filter is
returned.
output : {'ba', 'zpk', 'sos'}, optional
Type of output: numerator/denominator ('ba'), pole-zero ('zpk'), or
second-order sections ('sos'). Default is 'ba'.
Returns
-------
b, a : ndarray, ndarray
Numerator (`b`) and denominator (`a`) pol... | |
'-':
tzoff *= -1
tz = GeneratedsSuper._FixedOffsetTZ(
tzoff, results.group(0))
input_data = input_data[:-6]
time_parts = input_data.split('.')
if len(time_parts) > 1:
micro_seconds = int(float('0.' + time_parts[1]) * 1000000)
input_data = '%s.%s' % (
time_parts[0], "{}".format(micro_seconds).rjust(6, "0"), )
... | |
dératiser déréaliser
dérégionaliser déréglementer déréguler dérembourser déréprimer
déresponsabiliser dérestaurer dérider dérigidifier dériver dérober dérocher
dérocter déroder déroquer dérouiller dérouler dérouter déroyaliser dérueller
déruraliser dérussiser désabonner désabouter désabriter désabuser désaccentuer
... | |
found')
return value
#
def load_resources(self, resfile:str, *, delimiter:str=',', strict:bool=True, escaped:bool=False) -> dict:#, keyname:Union[str,int]='Key', valname:Union[str,int]='Value') -> dict:
resources:dict = {}
respath:str = os.path.join(os.path.dirname(self.filename), resfile)
# keycol = keyname if i... | |
# python standard imports
import re
from copy import copy
from pathlib import Path
# third-party imports
from yaml import safe_load, safe_dump
# internal imports
from .tokens import TokenType, StringBuilder
from .citation import Citation
from .regex_mods import process_pattern, match_regexes
_DEFAULT_CITATOR = None
... | |
bytecode='U'
data = 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA'
header = { 'coinbase': 0,
'timestamp': 0,
'number': 0,
'difficulty': 0,
'gaslimit': 0,
}
gas = 1000000
new_vm = evm.EVM(constraints, address, data, caller, value, bytecode, gas=gas, world=world)
new_vm._push(32)
new_vm._push(48)
last_exception, last_retu... | |
<gh_stars>0
#
#*******************************************************************************
# Copyright 2014-2020 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... | |
"""
Connection to TaHoma API.
Connection to Somfy TaHoma REST API
"""
import json
import logging
import pprint
import traceback
import urllib.parse
import requests
BASE_URL = "https://tahomalink.com/enduser-mobile-web/enduserAPI/" # /doc for API doc
BASE_HEADERS = {"User-Agent": "mine"}
_LOGGER = logging.getLogger... | |
<gh_stars>1-10
# coding: utf-8
"""
Eclipse Kapua REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
i... | |
Space for comments on flags (str)
'typ', # Type of data (str='xyzf')
'sectime' # Secondary time variable (date2num)
]
NUMKEYLIST = KEYLIST[1:16]
# Empty key values at initiation of stream:
KEYINITDICT = {'time':0,'x':float('nan'),'y':float('nan'),'z':float('nan'),'f':float('nan'),
't1':float('nan'),'t2':float('nan... | |
<reponame>teammdm/seminar
from Bio import SeqIO
import numpy as np
import os
import io
import h5py
from queue import Queue
import signal_pb2
import nanopolish_pb2
import raw_current_pb2
class ResquiggledFAST5():
""" <2do> dokumentacija"""
def __init__(self, path_to_file):
if not os.path.isfile(path_to_file):
rai... | |
from collections import OrderedDict
from typing import Type, Union
from flask import jsonify
from werkzeug.wrappers import Response
from werkzeug.exceptions import BadRequest, InternalServerError
from marshmallow import Schema, EXCLUDE, RAISE
from marshmallow.fields import List
from marshmallow.exceptions import Valida... | |
# DescendantReportExtra addon
#
# Notes by <NAME>, 2021
# Much of the code for this addon was copied from two existing Gramps plugins:
#
# gramps/plugins/descendtree.py
# gramps/plugins/ancestortree.py
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 <NAME>
# Copyright (C) 2007-2012 <NAME>
#... | |
<reponame>mongodb/dsi<filename>dsi/tests/test_config.py<gh_stars>1-10
# -*- coding: UTF-8 -*-
"""Tests for dsi/common/config.py"""
import os
import unittest
import yaml
from six.moves import range
from six.moves import zip
import dsi.common.whereami as whereami
from dsi.common import config
from dsi.common.config im... | |
##########################################################################
#
# Copyright (c) 2017, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of... | |
2)
rot_mat = cv2.getRotationMatrix2D(image_center, angle_deg, 1.0)
result = cv2.warpAffine(
image, rot_mat, image.shape[1::-1], flags=cv2.INTER_LINEAR
)
return result
def crop_rectangle(
image: np.ndarray, crop: Tuple[int, int, int, int]
) -> np.ndarray:
return image[
compute.clamp(crop[2], 0, len(image) - 1)... | |
<gh_stars>10-100
# type: ignore
"""
This code is taken from the OneIE
The script extracts IE annotations from ACE2005 (LDC2006T06).
Usage:
python process_ace.py \
"""
import glob
import json
import os
import re
from argparse import ArgumentParser
from dataclasses import dataclass
from typing import Any, Dict, List,... | |
num_filters]
X_pad = np.pad(Xr, npad, 'constant')
out_s[0 if self.batch_size == 1 else 1] = int(np.ceil(out_s[0 if self.batch_size == 1 else 1] / stride_par))
out_s[1 if self.batch_size == 1 else 2] = int(np.ceil(out_s[1 if self.batch_size == 1 else 2] / stride_par))
conv_output = np.zeros(out_s)
if self.ba... | |
durations_act_to = activities.get_durations(ids_act_to)
ids_fac_from = map_ids_fac_from[ids_person_act]
ids_fac_to = activities.ids_facility[ids_act_to]
centroids_from = facilities.centroids[ids_fac_from]
centroids_to = facilities.centroids[ids_fac_to]
# origin edge and position
ids_edge_from = facilities.ids_... | |
# Software License Agreement (BSD License)
#
# Copyright (c) 2009, <NAME>, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the abov... | |
#Import the relevant libraries
import numpy as np
import csv
import random
## Train data
# Loading in data using csv and np
path = 'F:/Data Mining/Assignment 1/data'
train = open(path + '/train.data', 'rt')
reader = csv.reader(train, delimiter=',', quoting=csv.QUOTE_NONE)
x = list(reader)
train_data = np.ar... | |
u"velocity: rotation",
u"interpretation of experiments: PHENIX",
u"decay: weak interaction",
u"potential: stability",
u"model: relativistic",
u"axion: decay constant",
u"tube",
u"orbifold: singularity",
u"interaction: nonlinear",
u"quarkonium: leptonic decay",
u"detector: surface",
u"anti-B: radiative decay"... | |
Notes
-----
Population has rows which are the names of the individuals (e.g. portfolios)
and columns which are the genes (e.g. assets).
The propagation, i.e. population.history, has rows which are the time stamps,
and columns which are the names of the individuals (e.g. portfolios).
Examples
--------
None
... | |
<reponame>GavinDuggan/python-spanner-orm<filename>spanner_orm/condition.py
# python3
# 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
#
# https://www.apache.org/lic... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# standard modules
import csv
import math
# third party modules
import luigi
import matplotlib; matplotlib.use('Agg')
import matplotlib.pyplot as plt
import dadi
import pickle
import random
# local modules
from alleletraj.const import MUTATION_RATE
from vcf import Polari... | |
import cv2
import numpy as np
import os
import time
import tkinter as tk
import PIL.Image, PIL.ImageTk
################################################################################
class ImageBox(tk.Canvas):
"""create a frame that displays the desired image with supported effects"""
HISTORY_SIZE = 100
########... | |
from collections import namedtuple
from autograd import value_and_grad, vector_jacobian_product
from autograd.extend import primitive, defvjp
import autograd.numpy as np
import autograd.numpy.random as npr
import autograd.scipy.stats.multivariate_normal as mvn
import autograd.scipy.stats.t as t_dist
from autograd.sci... | |
<reponame>amitkr2410/JETSCAPE-analysis
"""
macro for plotting analyzed jetscape events
"""
# This script plots histograms created in the analysis of Jetscape events
#
# Author: <NAME> (<EMAIL>)
# General
import os
import sys
import yaml
import argparse
# Data analysis and plotting
import ROOT
import numpy as np
im... | |
<gh_stars>1-10
# Copyright (c) 2006-2009 The Trustees of Indiana University.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# - Redistributions of source code must retain the above copyri... | |
<gh_stars>10-100
import json
import logging
from rdr_service.lib_fhir.fhirclient_1_0_6.models import observation as fhir_observation
from rdr_service.lib_fhir.fhirclient_1_0_6.models.fhirabstractbase import FHIRValidationError
from sqlalchemy.orm import subqueryload
from sqlalchemy.orm.attributes import flag_modified
... | |
= ros_msg_.id
pb_msg_.parent = ros_msg_.parent
pb_msg.groups.append(pb_msg_)
yield pb_msg
rospy.sleep(0.01)
class usb_cam_image_raw_compressedDepthServicer(ros_grpc.usb_cam_image_raw_compressedDepthServicer):
def __init__(self):
self.pub = None
self.Msg = roslib.message.get_message_class('sensor_msgs/Compress... | |
new_var, key=ME_TAG, role=ME_TAG)
self.graph.add_edge(new_var, n, key=ME_TAG+"-of", role=ME_TAG+"-of")
used_nodes = [TOP_NODE]
discontinuous=[]
top_align, throwup_discon = fix_helper((None,""),TOP_NODE)
if len(throwup_discon) > 0:
for (r_h, h, r_d, d) in throwup_discon:
logger.info("there should no throwup_disc... | |
sports|
"""
survey = self.md_to_pyxform_survey(md, {'name': 'sports'})
data = [{"Sport": "Basketball", "sport": "Soccer",
'_submission_time': '2016-11-21T03:43:43.000-08:00'}]
export_builder = ExportBuilder()
export_builder.set_survey(survey)
temp_zip_file = NamedTemporaryFile(suffix='.zip')
export_builder.to_... | |
(51, 'K'): 10,
(51, 'L'): 10,
(51, 'M'): 10,
(51, 'N'): 10,
(51, 'O'): 10,
(51, 'P'): 10,
(51, 'Q'): 10,
(51, 'R'): 10,
(51, 'S'): 10,
(51, 'T'): 10,
(51, 'U'): 10,
(51, 'V'): 10,
(51, 'W'): 10,
(51, 'X'): 10,
(51, 'Y'): 10,
(51, 'Z'): 10,
(51, '_'): 10,
(51, 'a'): 10,
(51, 'b'): 10,
(51, 'c'): 10,
... | |
<reponame>benchenas/BenchENAS<gh_stars>1-10
import numpy as np
import hashlib
import copy
from compute import Config_ini
from algs.evocnn.genetic.statusupdatetool import StatusUpdateTool
class Unit(object):
def __init__(self, number):
self.number = number
class ConvUnit(Unit):
def __init__(self, number, filter_w... | |
check:
raise ProofGenerationException("Implication failed when spawning constraint %s: %s & %s -/-> %s\n" % (str(con), r1.label(), r2.label(), con.root.label()))
else:
r1,v1 = rvList[0]
antecedents = [v1]
check, implication = csys.manager.justifyImply(r1, con.root)
if not check:
raise ProofGenerationException("I... | |
mail_user_mail_folder_delete_single_value_extended_property(client,
user_id,
mail_folder_id,
single_value_legacy_extended_property_id,
if_match=None):
return client.delete_single_value_extended_properties(user_id=user_id,
mail_folder_id=mail_folder_id,
single_value_legacy_extended_property_id=single_value_legacy... | |
map -> backward map
self.reverse_map: Dict[nd.Node, Union[nd.Node, nd.Map]] = {}
#: mapping from forward_node -> BackwardResult for that node
self.result_map: Dict[nd.Node, BackwardResult] = {}
#: mapping from forward name to gradient name for arrays
self.array_grad_map: Dict[str, str] = {}
# checks if backwar... | |
O0 . I1Ii111
if 45 - 45: I1Ii111
if 83 - 83: OoOoOO00 . OoooooooOO
if 58 - 58: i11iIiiIii + OoooooooOO % OoooooooOO / IiII / i11iIiiIii
if 62 - 62: OoO0O00 / I1ii11iIi11i
if 7 - 7: OoooooooOO . IiII
def lisp_is_x86 ( ) :
O000OOO0OOo = platform . machine ( )
return ( O000OOO0OOo in ( "x86" , "i686" , "x86_64" ) )... | |
device:
:param phase:
:return:
"""
model.eval()
nll = AverageMeter()
aux_data = None
for batch in data_loader:
imgs = batch['image'].to(device)
caps = batch['tokens'].to(device)
# TODO Refactor
if model.decoder.uses_aux_data:
aux_data = batch['emotion'].to(device)
logits, caps_sorted, decode_lengths, al... | |
# ref ID: 7
config = {
"name": "Dungeon Arena", #plugin name
"type": "generator", #plugin type
"description": ["Dungeon Arena"] #description
}
import sys
from collections import defaultdict
if __name__ == "__main__":
sys.path.extend(["."])
import os
os.chdir("..")
del (os)
from pgu import gui
from math impor... | |
if x == SAHPI_ET_OEM:
return "OEM"
if x == SAHPI_ET_USER:
return "USER"
if x == SAHPI_ET_DIMI:
return "DIMI"
if x == SAHPI_ET_DIMI_UPDATE:
return "DIMI_UPDATE"
if x == SAHPI_ET_FUMI:
return "FUMI"
return repr( x )
def toSaHpiEventTypeT( s ):
if s == "RESOURCE":
return SAHPI_ET_RESOURCE
if s == "DOMAIN":
... | |
by the EPO or use --all if you intend to"
" shutdown the whole cluster", node)
return constants.EXIT_FAILURE
elif powered is None:
_stdout_fn("Node %s does not support out-of-band handling, it can not be"
" handled in a fully automated manner", node)
elif powered == opts.on:
_stdout_fn("Node %s is already in des... | |
from ciw.auxiliary import *
from itertools import cycle
import copy
from operator import add, mul, sub, truediv
from random import (expovariate, uniform, triangular, gammavariate,
lognormvariate, weibullvariate)
class Distribution(object):
"""
A general distribution from which all other distirbutions will inherit.
... | |
<reponame>pmassolino/hw-sike
import random;
def print_value_VHDL_memory(file, word_size, value, final_size, fill_value):
file.write((("{0:0"+str(word_size)+"b}").format(value)))
file.write('\n')
final_size = final_size - 1
if(final_size > 0):
for i in range (final_size):
file.write((("{0:0"+str(word_size... | |
#!/usr/bin/python
# coding: utf-8
import sys,os
import math
import IRKE_COMMON
import ACP
import ctypes
from Fasta_reader import *
from sequenceUtil import *
from datetime import datetime
import time
import argparse
import resource
import numpy as np
me = 0
TOKEN = ""
MIN_CONNECTIVITY_RATIO = 0.0
MIN_ASSEMBLY_LENGTH... | |
in user_signatures:
cla.log.debug(f'{fn} - user not in one of the approval lists - '
'marking signature approved = false for '
f'user: {user}, project_id: {project}, company_id: {company_id}, '
f'signature: {signature.get_signature_id()}')
signature.set_signature_approved(False)
signature.save()
event_data = (f'... | |
import sys
import math
import os
import time
import random
import copy
# --------------------
# OBJ : operations
# DESC: Dictionary object in which the keys are a string expression and the item is a lambda function.
# --------------------
operations = {
"const": lambda p: p[0],
"add" : lambda p: p[0].evaluate() + p[... | |
char_bw, _ = self.char_lstm_backward(utils.reverse_sequence(chars_embeds.transpose(0, 1), gpu=self.use_gpu))
bw = char_bw[-1, :, :]
fw = char_fw[-1, :, :]
tok_rep = torch.cat([word_embeds[word_idx].unsqueeze(0), fw, bw], 1)
tok_rep = torch.tanh(self.tok_2_embed(tok_rep))
else:
tok_rep = word_embeds[word_idx].uns... | |
""" Cisco_IOS_XR_sysadmin_entity_mib
This module contains a collection of YANG
definitions for Cisco IOS\-XR SysAdmin configuration.
Copyright(c) 2015\-2017 by Cisco Systems, Inc.
All rights reserved.
"""
from collections import OrderedDict
from ydk.types import Entity, EntityPath, Identity, Enum, YType, YLeaf, YL... | |
"Mono",
"1378-9": "Nanticoke",
"1380-5": "Narragansett",
"1382-1": "Navajo",
"1383-9": "<NAME>",
"1384-7": "<NAME>",
"1385-4": "<NAME>",
"1387-0": "<NAME>",
"1389-6": "Nomalaki",
"1391-2": "Northwest Tribes",
"1392-0": "Alsea",
"1393-8": "Celilo",
"1394-6": "Columbia",
"1395-3": "Kalapuya",
"1396-1": "Mol... | |
of this FederatedConnection.
The username on the service account.
:param serviceaccountuser: The serviceaccountuser of this FederatedConnection.
:type: str
"""
self._attrs["serviceaccountuser"] = serviceaccountuser
def to_dict(self):
return {k: v for (k, v) in self._attrs.items() if v is not None}
class Fed... | |
bone.bone.use_local_location = False
drivers = self.GetDrivers(bone.name,'location')
if axisFlip != None:
print(axisFlip)
uVec[axisFlip] *= -1
#if axisFlip == 0:
# ux = -ux
#elif axisFlip == 1:
# uy = -uy
#elif axisFlip == 2:
# uz = -uz
self.AddPositionDriver(prop, axisOrder[0], bone, drivers, 0, uVec[0... | |
<reponame>tsadakane/TIGRE
"""Three-dimensional Shepp-Logan head phantom
Variations of three-dimensional Shepp-Logan head phantom.
Copyright
=========
3-clause BSD License
Copyright 2021 SADAKANE, Tomoyuki
https://github.com/tsadakane/sl3d
This code is inspired by the following MATLAB codes:
* <NAME> (2021)... | |
= 'stopped'
elif isinstance(status, int):
status = 'stopped[%s]' % exitcodedict.get(status, status)
return '<%s(%s, %s%s)>' % (
type(self).__name__,
self._name,
status,
self.daemon and ' daemon' or ''
)
def join(self, timeout=None):
"""
Wait cooperatively until child process terminates or timeout occurs.
... | |
elif reactNum == 3:
row["reactedType"] = "Wow"
elif reactNum == 4:
row["reactedType"] = "Heart"
elif reactNum == 5:
row["reactedType"] = "Angry"
elif reactNum == 6:
row["reactedType"] = "Haha"
else:
print("Invalid react Type")
return
try:
query = "INSERT INTO MAKES_GENERAL_REACT(post_id, user_id, reacted_ty... | |
-np.log10(p_val), gene_name, ha="center", va="center", fontsize=8))
adjust_text(texts, arrowprops=dict(width=0.15, headwidth=0, color='gray', alpha=0.6), ax=ax)
# save the final result
path, plot_name = get_path_and_name_from_kwargs(name="volcano_{g1}_{g2}_annotation_{p}", g1=g1, g2=g2,
p=col_mapping[col].replace(... | |
<gh_stars>100-1000
# Copyright Contributors to the OpenCue 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 required by applic... | |
328, 32, 328, 41),
woosh.Token(woosh.OP, ',', 328, 41, 328, 42),
woosh.Token(woosh.NAME, 'self', 328, 43, 328, 47),
woosh.Token(woosh.OP, '.', 328, 47, 328, 48),
woosh.Token(woosh.NAME, '_name', 328, 48, 328, 53),
woosh.Token(woosh.OP, ',', 328, 53, 328, 54),
woosh.Token(woosh.OP, '**', 328, 55, 328, 57),
woosh.Token(w... | |
<filename>edb/edgeql/parser/grammar/sdl.py
#
# This source file is part of the EdgeDB open source project.
#
# Copyright 2019-present MagicStack Inc. and the EdgeDB authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may o... | |
ENTRY_AC, PUB_ID
FROM INTERPRO.SUPPLEMENTARY_REF
"""
)
for accession, pub_id in cur:
try:
e = entries[accession]
except KeyError:
continue
else:
e.literature[pub_id] = citations[pub_id]
# Cross-references
cur.execute(
"""
SELECT X.ENTRY_AC, X.AC, LOWER(D.DBSHORT)
FROM INTERPRO.ENTRY_XREF X
INNER JOIN ... | |
view_no(self):
return self._data.view_no
@property
def sent_preprepares(self):
return self._data.sent_preprepares
@property
def prepares(self):
return self._data.prepares
@property
def commits(self):
return self._data.commits
@property
def requested_pre_prepares(self):
return self._data.requested_pre_p... | |
import json
import logging
import os
from textwrap import dedent
from tasks.cephfs.cephfs_test_case import CephFSTestCase
from tasks.cephfs.fuse_mount import FuseMount
from teuthology.exceptions import CommandFailedError
from teuthology.misc import sudo_write_file
log = logging.getLogger(__name__)
class TestVolumeCl... | |
<filename>parseUserTimeline.py<gh_stars>0
import argparse, collections, fnmatch, json, math, mysql.connector as sql, os, requests, sys, time
from ConfigParser import SafeConfigParser
from datetime import datetime
from mysql.connector import errorcode
from requests import HTTPError
from requests import ConnectionError
... | |
<reponame>Jinsongl/UQRA
#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 <NAME> <<EMAIL>>
#
# Distributed under terms of the GNU-License license.
"""
"""
from uqra.experiment._experimentbase import ExperimentBase
import uqra.utilities.helpers as helpers
import numpy as np, scipy a... | |
<reponame>spielkind/python-otcextensions<filename>otcextensions/sdk/auto_scaling/v1/_proxy.py<gh_stars>0
# 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/LICEN... | |
import csv
from copy import deepcopy
from progressbar import ProgressBar
from retrydialog import RetryDialog
from database import *
from apimodules import *
from apithread import ApiThreadPool
from collections import deque
import StringIO
import codecs
import os
import platform
import subprocess
from export import Exp... | |
not in params) or (params['batch'] is None):
raise ValueError("Missing the required parameter `batch` when calling `put_dispatch_tags_batch`")
collection_formats = {}
resource_path = '/dispatch/dispatches/tags'.replace('{format}', 'json')
path_params = {}
query_params = {}
header_params = {}
form_params = ... | |
metric of weight normalize are implemented. 'minmax' whether
to log normalize the weights and scale the weights between 1
and 2. 'log' whether to log normalize weight+1. 'log10' whether to
use log base 10 normalize weight+1.
null
If flag is set, then samples in condition1 and condition2 are shuffled
shuffleGenes
... | |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | |
<reponame>noorbeast/BlenderSource<filename>release/scripts/addons_contrib/sun_position/sun_calc.py<gh_stars>1-10
from mathutils import *
import math
import datetime
from . properties import *
Degrees = "\xb0"
def format_time(theTime, UTCzone, daylightSavings, longitude):
hh = str(int(theTime))
min = (theTime - in... | |
10:
log_contents = log_capture_string.getvalue()
if len(log_contents) > 0:
break
ray._private.import_thread.logger.removeHandler(ch)
assert "actor" in log_contents
assert "has been exported {} times.".format(
ray_constants.DUPLICATE_REMOTE_FUNCTION_THRESHOLD) in log_contents
def test_redis_module_failure(ray... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Content-related interfaces.
"""
from __future__ import print_function, absolute_import, division
__docformat__ = "restructuredtext en"
import sys
logger = __import__('logging').getLogger(__name__)
# pylint:disable=inherit-non-class,too-many-ancestors,no-self-argument,a... | |
<reponame>Goldfish64/CorpBot.py<filename>Cogs/Xp.py
import asyncio
import discord
import datetime
import random
from discord.ext import commands
from operator import itemgetter
from Cogs import Settings
# This is the xp module. It's likely to be retarded.
class Xp:
# Init with the bot reference, and a r... | |
25: continue
if abs(x_start-50) > 30: continue
# use different data if shuffle:
# if shuffle_time:
# experiment, condition, mouse, trial = mouse_trial_list[np.random.randint(len(mouse_trial_list))]
# else:
# experiment, condition, mouse, trial = experiment_real, condition_real, mouse_real, trial_real
''' just u... | |
will be set to ``True``
unless explicitly set to ``False`` in `kwargs` (e.g. active = False)
"""
kwargs = self._prepare_create_user_args(**kwargs)
user = self.user_model(**kwargs)
return self.put(user) # type: ignore
def delete_user(self, user: "User") -> None:
"""Deletes the specified user.
:param user: The ... | |
path_menu(self, searchpaths, operator, props_default, prop_filepath,
filter_ext, filter_path, display_name, add_operator):
'''
'''
pass
def path_resolve(self):
'''
'''
pass
def pop(self):
'''
'''
pass
def prepend(self, draw_func):
'''
'''
pass
def property_overridable_library_set(self):
''... | |
# This file is part of GridCal.
#
# GridCal is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GridCal is distributed in the hope that... | |
<filename>qatrack/service_log/tests/test_views.py
import json
from django.conf import settings
from django.contrib.auth.models import Permission, User
from django.core.serializers.json import DjangoJSONEncoder
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.test import RequestFa... | |
# coding: utf-8
"""
Cloud Manager API
This API allows access to Cloud Manager programs, pipelines, and environments by an authorized technical account created through the Adobe I/O Console. The base url for this API is https://cloudmanager.adobe.io, e.g. to get the list of programs for an organization, you would ma... | |
<reponame>LinkGeoML/LGM-Classification
import numpy as np
import pandas as pd
import geopandas as gpd
from shapely.geometry import Point
from shapely.wkt import loads
import itertools
import os
from collections import Counter
import pickle
from sklearn.preprocessing import LabelEncoder, MinMaxScaler
from sklearn.featu... | |
##########################################################################
#
# Copyright (c) 2019, Hypothetical Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source... | |
"""
# Determine new ant locations
for player in range(self.num_players):
player_hills = sorted(self.player_hills(player),
key=lambda hill: (hill.last_touched, random()))
for hill in player_hills:
# hill must not be razed or occupied to be used
# player must have food in hive to spawn
if (self.hive_food[player] ... | |
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to ... | |
# coding: utf-8
# public items
__all__ = ["loaddfits", "savefits", "loadnetcdf", "savenetcdf"]
# standard library
from datetime import datetime
from pytz import timezone
from logging import getLogger
from uuid import uuid4
from pathlib import Path
from pkgutil import get_data
# dependent packages
import tomli
imp... | |
<filename>DIP/fluo_beads_sim/fluorescent_beads.py
# -*- coding: utf-8 -*-
"""
Experiments with simulation of images of fluorescent beads for evaluation of precision of their localization.
In other words, for generationg ground truth data for tracking / segmentation evaluations.
@author: ssklykov
"""
# %% General impor... | |
<reponame>xylar/e3sm_to_cmip<gh_stars>1-10
'''
Utilities related to converting MPAS-Ocean and MPAS-Seaice files to CMOR
'''
from __future__ import absolute_import, division, print_function
import re
import numpy as np
import netCDF4
from datetime import datetime
import sys
import xarray
import os
import cmor
import s... | |
<filename>python/paddle/distributed/auto_parallel/completion.py
# Copyright (c) 2021 PaddlePaddle 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.... | |
<reponame>chncwang/mindspore<filename>model_zoo/official/nlp/tinybert/src/tinybert_for_gd_td.py<gh_stars>1-10
# 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 th... | |
contabiliza todas as jogadas,
# isto é, numa mesa de 4 jogadores essa lista tem tamanho 4.
# Como só me interesso pela jogada dos outros jogadores,
# só preciso das n-1 primeiras entradas dessa lista.
if carta_ja_jogada != '':
# Se tem carta jogada, adiciona na lista
lista_de_entrada_do_decisor.append(self.... | |
\n in_assignment will return True if the Sim is on any type of \n asignment for its current career.\n \n in_specific_assignment will return True only if the current\n active assignment matches the assignment specified.\n ',
in_assignment=AssignmentActiveFactory(),
in_specific_assignment=AssignmentSpecificFactory(),
... | |
<filename>wrapless.py
from protocol import Protocol
from typing import Optional
import logging
import struct
from dataclasses import dataclass
from enum import Enum
from usb.core import USBTimeoutError
from Crypto.Cipher import AES
from Crypto.Hash import HMAC, SHA256
from Crypto.Random import get_random_bytes
from cr... | |
interested genes
### return data frame: Select only the genes interested in the data frame
result_df = df.loc[df.index.intersection(entrezIDs)].reindex(entrezIDs)
repo_genes, interested_genes = set(df.index), set(entrezIDs)
if not repo_genes.issuperset(interested_genes):
unfound = interested_genes - repo_genes
l... | |
<gh_stars>100-1000
# 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, over... | |
* np.cos(angle_rad) + yc
if (iring != 0 or not (iseg == nrings and "DARK" in kwargs)):
counter += 1
if not any(counter == np.array([1, 9, 52, 60])):
ap = ap + proper.prop_polygon(wf, 6, hexrad, xhex, yhex,
ROTATION=angle)
if (iring != 0):
xhex = -x * np.cos(angle_rad) - y * np.sin(angle_rad) + xc
yhex = -x * n... | |
include in the sighash, for a taproot script path spend.
"script_taproot": default_script_taproot,
# The inner pubkey for a taproot script path spend (32 bytes).
"pubkey_inner": default_pubkey_inner,
# The negation flag of the inner pubkey for a taproot script path spend.
"negflag": default_negflag,
# The leaf ve... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.