input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<reponame>atubbs/spitfire<filename>spitfire/compiler/optimizer.py
# Copyright 2007 The Spitfire Authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
import __builtin__
import copy
import logging
import os.path
import re
from spitfire.com... | |
# plt.subplot(2, 1, 1, sharex=ax1)
# librosa.display.specshow(librosa.amplitude_to_db(self.chromSync, ref=np.max), bins_per_octave=BINS_PER_OCTAVE, fmin=self.fmin, y_axis='cqt_note', x_axis='time',x_coords=self.onset_times_graph, cmap=cmap)
# plt.title('Spectre syncronisé')
#
# plt.subplot(2, 1, 2, sharex=ax1)
# l... | |
import torch
import librosa
import numpy as np
import mir_eval
import separation_model as md
import data_set as dts
from shutil import copyfile
import os
class AudioSeparator:
r"""Implements a framework for using a SeparationModel to produce separated source for all files in the
validation set and measure the se... | |
tegar_ID 1 1 6 1 1 4 1 2 \
1 5 8 1 tegar_ID 3 2 3 2 3 2 3 2 1 1 4 9 7 1 1 tegar_ID 1 te\
gar_ID 3 1 tegar_ID 1 3 2 6 1 3 2 1 2 tegar_ID 1 1 4 9 7 1 1 t\
egar_ID 1 tegar_ID 3 1 tegar_ID 1 1 tegar_ID 1 tegar_ID 1 1 2 teg\
ar_ID 9 9 1 tegar_ID 1 1 1 2 1 1 6 3 2 7 8 9 7 1 tegar_ID 9 1\
tegar_ID 1 6 9 1 1 4 1 1 4 1 1 1 1 1... | |
#!/usr/bin/env python
# pyroute2 - ss2
# Copyright (C) 2018 <NAME>
#
# ss2 is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This p... | |
from __future__ import print_function
import os
import re
import sys
#from talibrt import abstract
# FIXME: initialize once, then shutdown at the end, rather than each call?
# FIXME: should we pass startIdx and endIdx into function?
# FIXME: don't return number of elements since it always equals allocation?
functio... | |
# -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.async_support.base.exchange import Exchange
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import ArgumentsRequ... | |
y_train_batch = iter(X_train).next()
except ValueError:
x_train_batch = iter(X_train).next()
y_train_batch = None
else:
x_train_batch = X_train[:batch_size]
y_train_batch = y_train[:batch_size] if y_train is not None else None
if isinstance(X_test, DataLoader):
assert y_test is None, (
"If `X_test` is of type... | |
"Setting hidden line removal"
if ax.getp('hidden'):
# turn hidden line removal on
self._script += "hidden on,...\n"
else:
# turn hidden line removal off
self._script += "hidden off,...\n"
def _set_colorbar(self, ax):
"""Add a colorbar to the axis."""
if DEBUG:
print "Setting colorbar"
cbar = ax.getp('colorb... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
Created on Sun May 30 17:28:21 2021
@author: OwYeong
"""
import cv2
import numpy as np
from matplotlib import pyplot as pt
from pykuwahara import kuwahara
import os
import glob
import argparse
import time
from my_utils import *
#Function Define Start
def resize_with_aspect_rati... | |
if (static_img is None or roi_affine is None
or static_affine is None):
raise ValueError("If using an affine to transform an ROI, "
"need to also specify all of the following",
"inputs: `static_img`, `roi_affine`, ",
"`static_affine`")
roi = reg.resample(roi, static_img, roi_affine, static_affine)
else:
# Assum... | |
from collections import defaultdict, namedtuple
import csv
import itertools
from pathlib import Path
import sys
from csvw.metadata import Column, ForeignKey, Datatype, Link
import pycldf
import pyclts
from segments import Tokenizer, Profile
from online_cognacy_ident.align import normalized_levenshtein
bipa = pyclts... | |
<reponame>git-afsantos/hpl-rv-gen
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: MIT
# Copyright © 2021 <NAME>
###############################################################################
# Imports
###############################################################################
from __future__ import print_fun... | |
<filename>GA.py
####### PART 1.A - EA #######
# Name : <NAME>
# Student ID : HW00281038
# Date : Oct. 1st 2017
##############################
import random
import math
import numpy as np
import itertools
import copy
import time
import pandas as pd
import matplotlib.pyplot as plt
import profile
import functools
impor... | |
% i):
layer = classifiers.hidden(layer, 2*hidden_size,
hidden_func=hidden_func,
hidden_keep_prob=hidden_keep_prob)
with tf.variable_scope('FC-top'):
layers = classifiers.hiddens(layer, 2*[hidden_size],
hidden_func=hidden_func,
hidden_ke... | |
#!python
#
# Copyright 2021 <EMAIL>. Internal use only; all rights reserved
#
# L1/L2 stress tester. Starts with one funded "funder" account which allocates
# funds to various child processes. The child processes then randomly perform
# various operations like onboarding L1->L2, exiting L2->L1, staking liquidity
# pool... | |
<reponame>gthreepwood/yats<gh_stars>0
#
# (C) Copyright 2003-2011 <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hop... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 applicab... | |
<reponame>revl/anglicize
#!/usr/bin/env python3
"""Perform anglicization of text in UTF-8 encoding.
The script works as a filter: it reads UTF-8 characters from its
standard input and writes the result to its standard output.
Alternatively, it can be used as a Python module:
from anglicize import Anglicize
print... | |
startZ+5, "bookshelf")
setBlock(startX+9, h+2, startZ+5, "bookshelf")
setBlock(startX+8, h+2, startZ+5, "bookshelf")
#EnchantingCorner
setBlock(startX+5, h+1, startZ+5, "enchanting_table")
setBlock(startX+5, h+3, startZ+5, "soul_lantern")
#Lights
#setBlock(startX+6, h+2, startZ+5, "wall_torch")
#setBlock(startX... | |
<filename>osuAlternative/bot.py
import discord
import datetime
import threading
import csv
import time
import asyncio
import psycopg2
import formatter
import controller
import documentation
from discord.ext import commands
client = commands.Bot(command_prefix = '!')
client.remove_command('help')
diffs = {}
diffs["ea... | |
<gh_stars>0
"""
dab-seq: single-cell dna genotyping and antibody sequencing
<NAME> 7.9.2019
functions required for the processing pipeline
two classes are defined:
* TapestriTube: variables and methods that operate on the level of a single Tapestri tube library
* SingleCell: variables and methods that operate on the... | |
description by adding new port classes. Without the ability to
# extend the port class list here we would have to enumerate all
# possible combinations of ports in the base interface classes.
#
def injectAfuIfcChanges(args, afu_ifc_db, afu_ifc_req):
fname = afu_ifc_req['file_path']
if ('module-ports' not in afu_ifc_... | |
)
if size.width() >= 0: widget.setMinimumWidth( size.width() )
if size.height() >= 0: widget.setMinimumHeight( size.height() )
class StatusBar( QW.QStatusBar ):
def __init__( self, status_widths ):
QW.QStatusBar.__init__( self )
self._labels = []
for w in status_widths:
label = QW.QLabel()
sel... | |
<reponame>Julian/cardboard
from cardboard import types
from cardboard.ability import (
AbilityNotImplemented, spell, activated, triggered, static
)
from cardboard.cards import card, common, keywords, match
@card("Words of Wind")
def words_of_wind(card, abilities):
def words_of_wind():
return AbilityNotImplemented... | |
row = layout.row(align=True, heading="Evaluation Time")
row.use_property_decorate = False
sub = row.row(align=True)
sub.prop(con, "use_eval_time", text="")
subsub = sub.row(align=True)
subsub.active = con.use_eval_time
subsub.prop(con, "eval_time", text="")
row.prop_decorator(con, "eval_time")
layout.prop(con,... | |
== 'e_cblp':
e_cblp_ = child_.text
e_cblp_ = self.gds_validate_string(e_cblp_, node, 'e_cblp')
self.e_cblp = e_cblp_
elif nodeName_ == 'e_cp':
e_cp_ = child_.text
e_cp_ = self.gds_validate_string(e_cp_, node, 'e_cp')
self.e_cp = e_cp_
elif nodeName_ == 'e_crlc':
e_crlc_ = child_.text
e_crlc_ = self.gds_valida... | |
[]
while True:
batch = self.c_queue.get()
if batch is None:
self.params.logger.info("queue sizes: %s"%str(qsizes))
for gate in self.gates:
self.params.logger.debug("begin gate.c_queue.put")
gate.c_queue.put(None)
self.params.logger.debug("end gate.c_queue.put")
break
qsizes = []
for gate in self.gates:
... | |
# Copyright Hybrid Logic Ltd. See LICENSE file for details.
"""Tests for :module:`flocker.volume.service`."""
from __future__ import absolute_import
import json
import os
from unittest import skipIf
from uuid import uuid4
from zope.interface.verify import verifyObject
from twisted.application.service import IServi... | |
<filename>graphql_compiler/tests/schema_transformation_tests/test_rename_schema.py
# Copyright 2019-present Kensho Technologies, LLC.
from textwrap import dedent
from typing import Set
import unittest
from graphql import parse
from graphql.language.printer import print_ast
from graphql.language.visitor import QUERY_DO... | |
<filename>api/registrations/views.py
from rest_framework import generics, permissions as drf_permissions
from rest_framework.exceptions import ValidationError, NotFound, PermissionDenied
from framework.auth.oauth_scopes import CoreScopes
from osf.models import AbstractNode, Registration, OSFUser
from api.base import p... | |
bragger braggers braille brainchild
brainchildren brainteaser brainteasers brakeman brakemen bramble
brambles brashly brashness brattier brattiest bratty bravura bravuras
brawler brawlers brawniness brazenly brazenness breadbasket
breadbaskets breadfruit breadfruits breakage breakages breaker
breakers breakup breakups ... | |
<filename>misc/user_agents.py
USER_AGENTS = {
# Browser
'Chrome': [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36",
"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36",
"Mozilla/5.0 (... | |
<gh_stars>1-10
import unittest
import mahjongpy
class TestPlayer(unittest.TestCase):
HANDS1 = mahjongpy.MahjongTile.make_hands_set('22456', '333567', '234') #タンヤオ
HANDS2 = mahjongpy.MahjongTile.make_hands_set('888', '333678', '123','11') #役無し
HANDS3 = mahjongpy.MahjongTile.make_hands_set('22345', '567', '123567') ... | |
"https://4new.io",
"logo": {
"src": "",
"width": "",
"height": "",
"ipfs_hash": ""
},
"support": {
"email": "",
"url": ""
},
"social": {
"blog": "",
"chat": "",
"facebook": "",
"forum": "",
"github": "",
"gitter": "",
"instagram": "",
"linkedin": "",
"reddit": "https://www.reddit.com/r/4newNetwork",... | |
Whether to setup the flux ramp at the end.
"""
if show_plot:
plt.ion()
else:
plt.ioff()
if reset_rate_khz is None:
reset_rate_khz = self._reset_rate_khz
self.log('reset_rate_khz is None. ',
f'Using default: {reset_rate_khz}')
n_channels = self.get_number_channels(band)
old_fb = self.get_feedback_enable_arra... | |
<filename>src/litprog/build.py<gh_stars>0
# This file is part of the litprog project
# https://github.com/litprog/litprog
#
# Copyright (c) 2018-2021 <NAME> (<EMAIL>) - MIT License
# SPDX-License-Identifier: MIT
import os
import re
import sys
import json
import time
import typing as typ
import fnmatch
import logging
im... | |
<gh_stars>0
"""
Given a rectangular 2D array, write a function that prints the elements in a clockwise
spiral order, starting at the upper left corner and ending at the center of the array.
For example:
1 2 3 4
5 6 7 8 --> 1 2 3 4 8 12 11 10 9 5 6 7
9 10 11 12
"""
import numpy as np
def array_spiral(arr):
"""
Giv... | |
<reponame>valentinalatorre/mocksurvey<gh_stars>1-10
"""
Classes
-------
SimBox: (and subclasses HaloBox and GalBox)
Contains information about the simulation box (e.g., the halo data), and populates galaxies given an HOD model available from `halotools`.
BoxField:
Basic class used to select a rectangular prism of ga... | |
provisioning_state: str
"""
_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'system_data': {'readonly': True},
'provisioning_state': {'readonly': True},
}
_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type'... | |
<reponame>cartoon-raccoon/dotfiles<gh_stars>0
##### cartoon-raccoon's qtile config file #####
from typing import List # noqa: F401
from libqtile import bar, layout, widget
from libqtile.config import Click, Drag, Group, ScratchPad, DropDown, Key, KeyChord, Match, Screen, Rule
from libqtile.lazy import lazy
from libqt... | |
iters = 0
while ((distSqP > 0.000001) and (iters < self.IKMaxIters)):
JPullPInv = np.linalg.pinv(self.reachBody.linear_jacobian(offset=self.reachBodyOffset))
delQ = JPullPInv.dot(delPt)
alpha = 5.0
#reuse same jacobian
while True :#apply current jacobian repeatedly until doesn't improve
newQ = self.skel.q + alph... | |
<reponame>KBIbiopharma/pybleau<filename>pybleau/app/plotting/plot_config.py
""" Module containing plot configurator objects. They are responsible for
holding/collecting all data (arrays and styling info) to make a Chaco plot.
They display data and styling choices using TraitsUI views, and use user
selections to collec... | |
values can be empty '
'objects ({}) in requests. Expected value: json-string/json-file/@json-file.',
arg_group='Identity')
with self.argument_context('healthcareapis workspace dicom-service delete') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('dicom_service_name', options_list=['-... | |
<filename>bots/invaders/agent.py<gh_stars>0
import os
import math
import sys
from typing import List, Tuple
# for kaggle-environments
from abn.game_ext import GameExtended
from abn.jobs import Task, Job, JobBoard
from abn.actions import Actions
from lux.game_map import Position, Cell, RESOURCE_TYPES
from lux.game_obje... | |
import requests
import os
import ast
import random
# --------------- Helpers that build all of the responses ----------------------
def build_speechlet_response(title, output, reprompt_text, should_end_session):
return {
'outputSpeech': {
'type': 'PlainText',
'text': output
},
'card': {
'type': 'Simple',
'ti... | |
129
fov_pix = 257
self._fov_pix = fov_pix
self._oversample = oversample
# Setting these to one choose default values at runtime
self._npsf = None
self._ndeg = None
# Legendre polynomials are more stable
self.use_legendre = True
# Turning on quick perform fits over filter bandpasses independently
# The s... | |
is not None:
self.ResourceTags = []
for item in params.get("ResourceTags"):
obj = ResourceTag()
obj._deserialize(item)
self.ResourceTags.append(obj)
memeber_set = set(params.keys())
for name, value in vars(self).items():
if name in memeber_set:
memeber_set.remove(name)
if len(memeber_set) > 0:
warnings.warn(... | |
None
class GBPLiborON(BaseModel):
resource_name: Optional[Literal["GBPLiborON"]] = "GBPLiborON"
h: Optional[YieldTermStructureHandle] = None
class USDLiborON(BaseModel):
resource_name: Optional[Literal["USDLiborON"]] = "USDLiborON"
h: Optional[YieldTermStructureHandle] = None
class Aonia(BaseModel):
resource... | |
<filename>picarServer/picar.py<gh_stars>0
#!/usr/bin/python3
# File name : picar.py
# Description : encapsulate an Adeept Robotic PiCar
import time
import threading
from iotServerLib import piStripLed, piIotNode, piLineTracking
from iotServerLib.iotCommon import ON, OFF, RGB
from piServices.piUtils import timePrint, ... | |
if len(seq) > seqLength:
seq = seq[:seqLength]
elif len(seq) < seqLength:
seq = string.ljust(seq, seqLength, '.')
mers = []
inds = []
for n in nmer:
mers.extend([seq[i:i+n] for i in range(len(seq)-n+1)])
inds.extend([np.arange(n)+i for i in range(len(seq)-n+1)])
return mers, inds
def itermer(seq, k=9, gapped... | |
pb = probe_designer.ProbeDesigner(genomes_grouped, filters,
probe_length=args.probe_length,
probe_stride=args.probe_stride,
allow_small_seqs=args.small_seq_min,
seq_length_to_skip=args.small_seq_skip,
cluster_threshold=cluster_threshold,
cluster_merge_after=cluster_merge_after,
cluster_fragment_length=cluster_fr... | |
data associated with them.
Returns
-------
list of tuples of int
list of unique antpair + pol tuples (ant1, ant2, pol) with data
associated with them.
"""
pols = self.get_pols()
bls = self.get_antpairs()
return [(bl) + (pol,) for bl in bls for pol in pols]
def get_feedpols(self):
"""
Get the unique antenn... | |
<reponame>akki2825/CorpusTools
import os
import codecs
from corpustools.corpus.io.textgrid11_pct import TextGrid, IntervalTier, readFile, Interval, Point, PointTier, _getMark
#from corpustools.corpus.io.textgrid import Interval, Point, PointTier , _getMark
from corpustools.corpus.classes import SpontaneousSpeechCorpus... | |
PyenvError as e:
click.echo(u"Something went wrong…")
click.echo(crayons.blue(e.err), err=True)
# Print the results, in a beautiful blue…
click.echo(crayons.blue(c.out), err=True)
# Find the newly installed Python, hopefully.
version = str(version)
path_to_python = find_a_system_python(version)
try:
assert pyt... | |
from django import forms
from elegislative_app.models import User
from elegislative_app import models
class RegisterForm(forms.ModelForm):
password1 = forms.CharField(label='Password', widget=forms.PasswordInput)
password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput)
dob = form... | |
from pathlib import Path
import argparse
# https://matplotlib.org/stable/api/tri_api.html
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
import pandas as pd
import seaborn as sns
from matplotlib.tri import Triangulation, UniformTriRefiner, LinearTriInterpolator, \
CubicTriInterpolator
fr... | |
<reponame>jkleczar/ttslab<gh_stars>0
# -*- coding: utf-8 -*-
""" Initial phoneset implementation for the Yoruba voice...
"""
from __future__ import unicode_literals, division, print_function #Py2
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import sys
import os
import re
import codecs
import unicodedata
from tempfile ... | |
<reponame>mkulikf5/bigiq-cloudinit
#!/usr/bin/env python
# coding=utf-8
# pylint: disable=broad-except,unused-argument,line-too-long
# Copyright (c) 2016-2018, F5 Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ... | |
# -*- coding: utf-8 -*-
# (c) 2009-2021 <NAME> and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Original PyFileServer (c) 2005 <NAME>.
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
"""
Implementation of a DAV provider that serves resource from a file system.
:cl... | |
of bits and m.bits to a list of bits at
each position"""
bits = []
totbits = 0
bgbits = 0
bg = self.background
UNCERT = lambda x: x*math.log(x)/math.log(2.0)
for letter in ACGT:
bgbits = bgbits + UNCERT(bg[letter])
for i in range(self.width):
tot = 0
for letter in ACGT:
Pij = pow(2.0, self.logP[i][letter])
... | |
GRAY = (0.5019607843137255, 0.5019607843137255, 0.5019607843137255)
GREY = (0.5019607843137255, 0.5019607843137255, 0.5019607843137255)
DARKGRAY = (0.6627450980392157, 0.6627450980392157, 0.6627450980392157)
DARKGREY = (0.6627450980392157, 0.6627450980392157, 0.6627450980392157)
SILVER = (0.7529411764705882, 0.7529... | |
<gh_stars>0
import os
import sys
import logging
import copy
import math
from abc import ABCMeta, abstractmethod
import mne
import numpy as np
# from scipy.fftpack import rfft, rfftfreq
from scipy.signal import welch, decimate
from scipy.signal import decimate, welch
from cycler import cycler
import matplotlib
from ma... | |
######################################################
#
# The Time Series Model based on SVD
#
######################################################
import copy
import numpy as np
import pandas as pd
from mssa.src.algorithms.svdWrapper import SVDWrapper as SVD
from mssa.src import tsUtils
from sklearn.metri... | |
and os.path.isdir(pose_dir):
shutil.rmtree(pose_dir)
os.makedirs(pose_dir, exist_ok=True)
return pose_dir
def parse_args():
parser = argparse.ArgumentParser(description='Train keypoints network')
# general
parser.add_argument('--cfg', type=str, required=True)
parser.add_argument('--videoFile', type=str, requir... | |
"""
Tests for xhr_handlers.py.
"""
import json
import os
import re
import StringIO
from django.contrib.auth import authenticate
from django.contrib.auth.models import User
from django.core.files.uploadedfile import UploadedFile
from django.core.urlresolvers import reverse
from django.http.request import HttpRequest
f... | |
<filename>ocs_ci/deployment/baremetal.py
import json
import os
import logging
from time import sleep
import yaml
import requests
from .flexy import FlexyBaremetalPSI
from ocs_ci.utility import psiutils
from ocs_ci.deployment.deployment import Deployment
from ocs_ci.framework import config
from ocs_ci.deployment.ocp ... | |
+ 'DATA' + str(idx) + '_FC_SPLIT_FACTOR - 1);\n\n')
buf_size = desp['DFC_BUF_SIZE'][idx] * desp['RES_ENGINE_NUM'][idx - len(desp['OP_NAME'])] * desp['FC_GROUP_FACTOR'][idx]
width = cal_width(buf_size)
code.append(indent(1) + 'bool more_to_read_from_buffer = true;\n')
code.append(indent(1) + 'bool more_to_collect_f... | |
#!/usr/bin/python3
from __future__ import absolute_import
from builtins import range
from past.builtins import basestring
from builtins import object
from .interface import tss_lib, ffi
from pytss import tspi_exceptions
import hashlib
def uuid_to_tss_uuid(uuid):
"""Converts a Python UUID into a TSS UUID"""
tss_uuid... | |
list contained in hpn.
The supplied search_dict has all options, which are culled by the supplied
hpn and exact_match flag.
Parameters
----------
hpn : list
List of HERA part numbers being checked as returned from self._proc_hpnlist
search_dict : dict
Contains information about all parts possible to search, k... | |
newmatrix = np.dot(T, newmatrix)
elif latticeparameters_has_elements:
B0matrix = CP.calc_B_RR(latticeparameters, directspace=1, setvolume=False)
# if verbose:
# print("newmatrix", newmatrix)
# print("B0matrix", B0matrix)
Xmodel, Ymodel, _, _ = calc_XY_pixelpositions(calibrationparameters,
Miller_indices,
absol... | |
# BSD 2-Clause License
#
# Copyright (c) 2021, Hewlett Packard Enterprise
# 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 noti... | |
<gh_stars>1-10
"""
This script creates figures for all ligands which parented a given ligand.
All compounds for the entire AutoGrow run will be compiled into a dictionary \
which is used to search when tracing lineages. We pickle these dictionaries so \
that if this script is run multiple times these dictionaries do n... | |
<reponame>robertsmoto/sodavault
from django.db import models
from itemsapp.models import Item, Part, ProductPartJoin
from itemsapp.models import Product, SimpleProduct, DigitalProduct, BundleProduct, VariableProduct
from contactapp.models import Company, Supplier, Location
from django.db.models import Sum, Avg
from dja... | |
<reponame>meddhafer97/Risk-management-khnowledge-based-system<filename>djangoProject1/venv/Lib/site-packages/owlready2/pymedtermino2/model.py
# -*- coding: utf-8 -*-
# Owlready2
# Copyright (C) 2019 <NAME>
# LIMICS (Laboratoire d'informatique médicale et d'ingénierie des connaissances en santé), UMR_S 1142
# University... | |
<filename>portal/models/qb_status.py
""" Questionnaire Bank Status Module
API to lookup user's status with respect to assigned questionnaire banks.
"""
from .overall_status import OverallStatus
from .qb_timeline import ordered_qbs, QBT, update_users_QBT
from .questionnaire_response import qnr_document_id, QNR_results... | |
data
def custom_action_response_descriptor_octopus_server_web_api_actions_tenant_variables_put_responder_spaces_with_http_info(self, base_space_id, id, **kwargs): # noqa: E501
"""custom_action_response_descriptor_octopus_server_web_api_actions_tenant_variables_put_responder_spaces # noqa: E501
Updates the variable... | |
cidr_ipv6)
if description is not None:
pulumi.set(__self__, "description", description)
if from_port is not None:
pulumi.set(__self__, "from_port", from_port)
if source_prefix_list_id is not None:
pulumi.set(__self__, "source_prefix_list_id", source_prefix_list_id)
if source_security_group_id is not None:
pulum... | |
<reponame>Bhaskers-Blu-Org2/petridishnn
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import numpy as np
import scipy.io.arff as arff
import bisect
import json
import os, sys
import subprocess
import tensorflow as tf
from tensorpack.dataflow import RNGDataFlow, BatchData, PrefetchData
from ... | |
import json
from app.tests import BaseTestClass
class TestParcelView(BaseTestClass):
"""This class contains all tests regarding parcels"""
def test__create_order(self):
"""This will test POST /parcels"""
res = self.client.post(
"api/v2/users/parcels", data=json.dumps(self.generic_parcel),
content_type="appli... | |
<reponame>davidleonfdez/face2anime
from abc import ABC, abstractmethod
from fastai.vision.all import *
from fastai.vision.gan import *
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.utils import spectral_norm
from face2anime.layers import (ConcatPoolHalfDownsamplingOp2d, CondConvX2UpsamplingOp2d, ... | |
g_param[OptionsDefine.SecretId], g_param[OptionsDefine.SecretKey], g_param[OptionsDefine.Token]
)
http_profile = HttpProfile(
reqTimeout=60 if g_param[OptionsDefine.Timeout] is None else int(g_param[OptionsDefine.Timeout]),
reqMethod="POST",
endpoint=g_param[OptionsDefine.Endpoint],
proxy=g_param[OptionsDefine.Ht... | |
ics[0], ics[1+i])
self.eval(ic)
return self('desolve(%s, %s(%s))'%(de, vars[1], vars[0]))
def solve_linear(self, eqns,vars):
"""
Wraps maxima's linsolve.
INPUT:
- ``eqns`` - a list of m strings; each representing a linear
question in m = n variables
- ``vars`` - a list of n strings; each
representing a va... | |
= lambda n, N, M, x: 1. - scipy.stats.hypergeom.cdf(x-1, M, n, N),
HypothesisFunction = lambda data, SignificanceLevel: BenjaminiHochbergFDR(data, SignificanceLevel=SignificanceLevel)["Results"],
FilterSignificant = True, KEGGDictionaryVariable = None, KEGGDictionaryOptions = {}, MultipleListCorrection = None, Mul... | |
# Copyright 2017, 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, soft... | |
<reponame>0u812/roadrunner<gh_stars>1-10
#
# @file TestXMLToken_newSetters.py
# @brief XMLToken_newSetters unit tests
#
# @author <NAME> (Python conversion)
# @author <NAME>
#
# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
#
# DO NOT EDIT THIS FILE.
#
# This file was generated automat... | |
)
query_filter_string, query_params = self._build_query(
searchable_keywords=searchable_keywords,
fuzzymatching=fuzzymatching,
limit=limit,
offset=offset,
fields=fields,
search_filters=search_params
)
query_filter_string = re.sub(
r'StudyInstanceUID =',
'series.StudyInstanceUID =',
query_filter_string
)
... | |
<reponame>Defense-Cyber-Crime-Center/ViperMonkey
"""
ViperMonkey - Strip useles lines from Visual Basic code.
Author: <NAME> - http://www.decalage.info
License: BSD, see source code or documentation
Project Repository:
https://github.com/decalage2/ViperMonkey
"""
#=== LICENSE ========================================... | |
distance between two points.
- The minimum distance between a point and an edge.
- The minimum distance between two edges.
Parameters
----------
entity1
A ConstrainedSketchVertex, Datum point, MeshNode, or Edge specifying the first entity from which to
measure.
entity2
A ConstrainedSketchVertex, Datum point... | |
<gh_stars>10-100
from collections import defaultdict
from itertools import chain
from enum import Enum
from core.simulator import JIT, iter_simulation_topology
from PySide6.QtWidgets import *
from PySide6.QtCore import *
from PySide6.QtGui import *
from diagram import DIRS, Schematic, Element
from core.descriptors imp... | |
rel_absence_ahu = property(__rel_absence_ahu.value, __rel_absence_ahu.set, None, None)
# Element part_load_factor_ahu uses Python identifier part_load_factor_ahu
__part_load_factor_ahu = pyxb.binding.content.ElementDeclaration(pyxb.namespace.ExpandedName(None, 'part_load_factor_ahu'), 'part_load_factor_ahu', '__... | |
the problem
occurs
4. A list of rows (integers) of the table's DataFrame where the
problem occurs
table : string
Name of a GTFS table
df : DataFrame
The GTFS table corresponding to ``table``
column : string
A column of ``df``
column_required : boolean
``True`` if and only if ``column`` is required
(and not... | |
"""Class implementation for dictionary.
"""
from typing import Any
from typing import Dict
from typing import Generic
from typing import TypeVar
from typing import Union
from apysc._event.custom_event_interface import CustomEventInterface
from apysc._type.any_value import AnyValue
from apysc._type.boolean ... | |
<reponame>awhite862/kelvin
import unittest
import numpy
from pyscf import gto, scf
from cqcpy import ft_utils
from kelvin.scf_system import SCFSystem
from kelvin import cc_utils
class CCUtilsTest(unittest.TestCase):
def setUp(self):
pass
def _test_fd(self, F, B, D, delta, name, thresh):
fd = (F - B)/(2.0*delta)... | |
### Import required python modules
import logging
from gevent import monkey; monkey.patch_all()
import platform
import os
from os import listdir, stat, makedirs, mkdir, walk, remove, pardir
from os.path import isdir, isfile, join, splitext, getmtime, basename, normpath, exists, expanduser, split, dirname, getsize, abs... | |
len(line.split()) == 1:
res = [str(i)+';' for i in sec_ids]
else:
if not (';' in line):
res = [str(i)+';'
for i in sec_ids
if (str(i)+';').startswith(text)]
return res
elif len(tokens) == 2:
first_tokens = tokens[0].split(' ') # 'vf 1' => ['vf', '1']
if len(first_tokens) == 2:
idx = int(first_tokens[1])
# ... | |
<reponame>fronzbot/AI-Challenge
#!/usr/bin/env python
import math
import random
from collections import deque
import sys
from optparse import OptionParser
#direction information
cdirections = ['N', 'E', 'S', 'W']
directions = {'N': (-1,0), 'S': (1,0), 'E': (0,1), 'W': (0,-1)}
#game parameters
min_players = 2
max_pla... | |
'\n') + '\n'
d['Editor-Extensions'] = [line.split('@')[0]
for line in output]
with open(f'{filepath}', 'w') as f:
f.writelines(lines)
if 'Pip-Packages' in d:
with open(f'{filepath}', 'r') as f:
lines = f.readlines()
for line in lines:
if '<pip:name>' in line or '<pip>' in line or '<python>' in line or '<pyt... | |
1, 1, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1],
[1, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1],
[0, 0, 0, 1, 1, 1, 0, 0, 1, 1... | |
n_group = R_intra_unique.size()[0]
# R_intra_unique.unsqueeze_(1)
# R_intra = []
# for i in range(n_group-1, -1, -1):
# R_intra.append(R_intra_unique[i])
# R_intra = torch.cat(R_intra, dim=0)
# R_intra = self.normalize(R_intra, dim=1).cuda()
# curr_seq_graph_state_in = torch.matmul(R_intra, torch.squeeze(curr_seq_gra... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.