input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dynamic': 0.0,
'Runtime Dynamic': 0.0,
... | |
<filename>fsleyes/gl/shaders/arbp/parse.py
#!/usr/bin/env python
#
# parse.py - Very simple parser for ARB assembly shader programs.
#
# Author: <NAME> <<EMAIL>>
#
"""This module provides functions for use with OpenGL ``ARB_vertex_program``
and ``ARB_fragment_program`` assembly source code. It defines a simple
templati... | |
one output node are not processed
h = np.zeros(len(self.output_nodes))
for i, out_node in enumerate(self.output_nodes):
h[i] = self.process_node(out_node)
return h
def nodes(self) -> List["ne.neat.genes.NodeGene"]:
"""
Returns all the genome's node genes. Order: inputs, bias, outputs and
hidden.
"""
return ... | |
<filename>nepc/nepc.py
"""This package provides the following functionality for NRL Evaluated Plasma
Chemistry (NEPC) style databases:
- create data files for building a NEPC database from common sources (e.g. LXCat)
- build a NEPC style database on a MySQL server
- establishing a connection to a local or remote da... | |
#!/usr/bin/env python
from translate.convert import html2po
from translate.convert import po2html
from translate.convert import test_convert
from translate.misc import wStringIO
class TestHTML2PO:
def html2po(self, markup, includeuntagged=False, duplicatestyle="msgctxt", keepcomments=False):
"""Helper to convert ht... | |
import ast
import json
import math
import re
from copy import deepcopy
from functools import partial
from types import FunctionType
from typing import Type, Tuple, Sequence, Dict, Callable, Any, Optional, List
from django.apps import apps
from django.conf.urls import url
from django.db.models import QuerySet, Model
fr... | |
"rttMonApplNumCtrlAdminEntry": {},
"rttMonApplPreConfigedReset": {},
"rttMonApplPreConfigedValid": {},
"rttMonApplProbeCapacity": {},
"rttMonApplReset": {},
"rttMonApplResponder": {},
"rttMonApplSupportedProtocolsValid": {},
"rttMonApplSupportedRttTypesValid": {},
"rttMonApplTimeOfLastSet": {},
"rttMonApplVers... | |
pos in box]
return getCoords(x, y, w, h, pagesize)
def getFrameDimensions(data, page_width, page_height):
"""Calculate dimensions of a frame
Returns left, top, width and height of the frame in points.
"""
box = data.get("-pdf-frame-box", [])
if len(box) == 4:
return [getSize(x) for x in box]
top = getSize(da... | |
#!/usr/bin/python
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | |
self.multifile.addSignature(certificate, chain or '', pkey or '', password or '')
self.multifile.close()
if not multifileFilename.renameTo(self.packageFullpath):
self.notify.error("Cannot move %s to %s" % (multifileFilename, self.packageFullpath))
if self.p3dApplication:
# No patches for an application; just mo... | |
<filename>Veerappan_bnfo601_exam2/Veerappan_BLAST_prot.py<gh_stars>0
"""
<NAME>
BNFO 601 - Exam 2
Question 2. Protein BLAST
"""
import math
from PAM import PAM
class BLAST(object):
FORWARD = 1 # These are class variables shared by all instances of the BLAST class
BACKWARD = -1
ROW = (0, 1)
COLUMN =... | |
from sympy import (
acos,
acosh,
asinh,
atan,
cos,
Derivative,
diff,
Dummy,
Eq,
Ne,
erfi,
exp,
Function,
I,
Integral,
LambertW,
log,
O,
pi,
Rational,
rootof,
S,
sin,
sqrt,
Subs,
Symbol,
tan,
asin,
sinh,
Piecewise,
symbols,
Poly,
sec,
Ei,
re,
im,
atan2,
collect,
hyper,
simplify,
)... | |
from enum import Enum, auto
from operator import attrgetter
import networkx as nx
import pendulum
import uuid
from django.apps import apps
from django.core.exceptions import FieldDoesNotExist
from django.db.models import DateTimeField
from share.exceptions import ShareException
from share.util import TopologicalSort... | |
order can be arbitrarily high, but some RBFs,
such as Wendland and Matern, become numerically unstable when
the derivative order exceeds 2.
'''
x = np.asarray(x, dtype=float)
assert_shape(x, (None, None), 'x')
c = np.asarray(c, dtype=float)
assert_shape(c, (None, x.shape[1]), 'c')
# makes `eps` an array of c... | |
<reponame>WONDER-project/GSAS-II-WONDER-OSX
# -*- coding: utf-8 -*-
#GSASII - phase data display routines
########### SVN repository information ###################
# $Date: 2019-08-07 11:35:30 -0500 (Wed, 07 Aug 2019) $
# $Author: vondreele $
# $Revision: 4080 $
# $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk... | |
Constraint(expr= - m.b405 + m.b406 - m.b886 <= 0)
m.c935 = Constraint(expr= - m.b406 + m.b407 - m.b887 <= 0)
m.c936 = Constraint(expr= - m.b407 + m.b408 - m.b888 <= 0)
m.c937 = Constraint(expr= - m.b408 + m.b409 - m.b889 <= 0)
m.c938 = Constraint(expr= m.b410 - m.b890 <= 0)
m.c939 = Constraint(expr= - m.b410 + m.b... | |
"690.7(A)(3)-P100 + {:1.1%} SF: {:.3f} V<br>".format(
voc_summary['safety_factor'][
'690.7(A)(3)-P100'],
max_module_voltage_with_safety_factor[
'690.7(A)(3)-P100']) + \
'Maximum String Length: {:.0f}<br>'.format(
voc_summary['string_length'][
'690.7(A)(3)-P100']) + \
'Conservative 690.7(A)(3) value for string l... | |
of chunk 1 without bias correction
:param match_count2: number of samples in new chunk 2
:param mean2: mean of chunk 2
:param biased_variance2: variance of chunk 2 without bias correction
:return: combined variance
:rtype: float
"""
if match_count1 < 1:
return biased_variance2
elif match_count2 < 1:
return bi... | |
from bw2data import methods, Method
from . import get_biosphere_database
from .config import Config
from copy import copy
from .categories.resources import FossilResourceScarcityEndpoint
from collections import defaultdict
NAME_MAPPING = {
("Acidification - Terrestrial ecosystems", "Egalitarian"): (
"Terrestrial ec... | |
<reponame>VinAIResearch/Point-Unet<filename>SaliencyAttention/custom_ops.py
# -*- coding: utf-8 -*-
# File: custom_ops.py
###
# Code are borrowed from tensorpack modified to support 5d input for batchnorm.
# https://github.com/tensorpack/tensorpack/blob/master/tensorpack/models/batch_norm.py
###
import tensorflow as t... | |
<reponame>vincentrobin/conda<filename>Cantera-data-examples/onedim.py<gh_stars>1-10
# This file is part of Cantera. See License.txt in the top-level directory or
# at http://www.cantera.org/license.txt for license and copyright information.
import numpy as np
from ._cantera import *
from .composite import Solution
imp... | |
isWeaponDrawn:
DistributedPlayerPirate.sendRequestRemoveEffects(self, self.stickyTargets)
self.setStickyTargets([])
taskMgr.remove(self.uniqueName('runAuraDetection'))
subtype = ItemGlobals.getSubtype(currentWeaponId)
if WeaponGlobals.getWeaponCategory(currentWeaponId) == WeaponGlobals.VOODOO and isWeaponDrawn =... | |
from random import *
import numpy as np
import time
import logging
import tkinter as tk
from PIL import Image, ImageTk
import pygame as pygame
#*************************************************************************
# Classe Paquet:
# Une carte est representé par sa valuer, sa figure et le fichier image
# le represa... | |
#
# The MIT License (MIT)
#
# This file is part of RLScore
#
# Copyright (c) 2008 - 2016 <NAME>, <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 witho... | |
= do p <= 5;
ASSERT(r, True, "High client proxy transaction errors", "OPERATIONS", WARNING,
"Listed namespace[s] show higher than normal proxy transaction errors (> 5% client proxy transactions). Please run 'show statistics namespace like client_proxy' to see values.",
"High proxy transaction error check");
war... | |
decreasing.
#: There is no specific data size ordering in the `GXVV <geosoft.gxapi.GXVV>`.
VV_ORDER_NONE = 0
#: Every value is greater than or equal to the previous value.
VV_ORDER_INCREASING = 1
#: Every value is less than or equal to the previous value.
VV_ORDER_DECREASING = 2
#
# VV_SORT constants
#
# Sort order
... | |
'\ue331', '&udotbl;': 'ụ', '&Udotbl;': 'Ụ',
'&ubrevinvbl;': '\ue727', '&udot;': '\ue715', '&Udot;': '\ue315',
'ü': 'ü', 'Ü': 'Ü', 'ú': 'ú', 'Ú': 'Ú',
'ű': 'ű', 'Ű': 'Ű', '&udotacute;': '\uebff',
'&Udotacute;': '\uebfe', 'ù': 'ù', 'Ù': 'Ù',
'&uvertline;': '\ue724'... | |
# This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.10
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2,6,0):
def swig_import_helper():
from os.path import dirname
... | |
CPUs')
argp.add_option('--no-chop-difference',
dest="chop_diff", action='store_false',
help='print full difference')
argp.add_option('--chop-difference',
dest="chop_diff", action='store_true', default=True,
help='print chopped difference')
argp.add_option('--ui-checksum-length',
default=None, type='int',
help=... | |
"i1xslq9jgp9b.ml",
"i1xslq9jgp9b.tk",
"i201zzf8x.com",
"i2pmail.org",
"i35t0a5.com",
"i3pv1hrpnytow.cf",
"i3pv1hrpnytow.ga",
"i3pv1hrpnytow.gq",
"i3pv1hrpnytow.ml",
"i3pv1hrpnytow.tk",
"i4j0j3iz0.com",
"i4racpzge8.cf",
"i4racpzge8.ga",
"i4racpzge8.gq",
"i4racpzge8.ml",
"i4racpzge8.tk",
"i537244.cf",
"i... | |
<reponame>MilesCranmer/pyjulia
"""
Bridge Python and Julia by initializing the Julia runtime inside Python.
"""
# ----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython and Julia Development Teams.
#
# Distributed under the terms of the BSD License. The full licen... | |
response
data. Default is True.
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
(connection, read) timeouts.
:return: V1ComponentHub
If the method is called asynchronously,
returns the request thread.
"""
kwa... | |
import pytest
try:
from linebot import LineBotApi, WebhookParser
from linebot.models import (
BeaconEvent, FollowEvent, JoinEvent, LeaveEvent, MessageEvent,
PostbackEvent, UnfollowEvent, MemberJoinedEvent, MemberLeftEvent,
AccountLinkEvent,
TextSendMessage, ImageSendMessage, AudioSendMessage,
VideoSendMessage, ... | |
import collections
import torch
from ctools.pysc2.lib import features
from ctools.pysc2.lib.static_data import NUM_ACTIONS, ACTIONS_REORDER, UPGRADES_REORDER_INV
import numpy as np
Avail_fn = collections.namedtuple(
'Avail_fn', ['func_id', 'func_name', 'units', 'upgrade', 'resource', 'mana', 'supply']
)
FUNCTION_LIS... | |
# -*- coding: ascii -*-
# $Id: CNCEditor.py,v 1.9 2014/10/15 15:04:38 bnv Exp $
#
# Author: <EMAIL>
# Date: 24-Aug-2014
from __future__ import print_function
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
try:
import cPickle as pickle
except ImportError:
import pickle
try:
from Tk... | |
isRank):
'''
Update the entire row of locations on the sheets, where:
ports_row: list of length 6 with strings denoting the value for each cell.
timestamp: string representing the time for in the time cell.
name: the name of the editor.
isRank: bollean value that denotes whether or not the editor is a rank.
'''
... | |
is not None:
foundCycle.insert(0, rel)
return foundCycle
path.discard(relTo)
return None
''' this may be unused now, if common stock class members are only taken from observed facts, not defined members, per Dean R
def getDimMembers(self, dim, default=None, rels=None, members=None, visited=None):
hasDefinedRel... | |
'''Check the data for prediction'''
import os
from basis.file import downloadMatchingRelationship
existing_datasets = os.path.exists("haikou-experiments/matching_relationship")
if existing_datasets == False:
print("Downloading datasets...")
print("If failed, you can download them from https://drive.google.com/file/d/... | |
contains new lines, just pass those through to print.
if message.find('\n') != -1:
sss = sss + prefix + message.replace('\n','\n'+' '*prelen)+'\n'
# Else if message is not empty, pass to wrapper.fill
elif message:
sss = sss + wrapper.fill(message) + '\n'
# Else just pass the empty message along with prefix
else:... | |
<reponame>bkille/bitarray
"""
Tests for bitarray.util module
"""
from __future__ import absolute_import
import os
import sys
import unittest
from string import hexdigits
from random import choice, randint, random
from collections import Counter
from bitarray import (bitarray, frozenbitarray, bits2bytes, decodetree,
... | |
in random.sample(bigElements, number)])
m4 = MassFunction(*[(x, 1.0/number) for x in random.sample(bigElements, number)])
m5 = MassFunction(*[(x, 1.0/number) for x in random.sample(bigElements, number)])
s = format_time("size 10000, focals " + str(number) + ", 2 bbas", time_function(nb_iterations, m1.combination_av... | |
for k in cData:
if 'Hailstone2' in k:
# Grab Data
data = cData[k]
flows = data['F']
ineq = data['IN']
fin = data['FIN']
eq = data['EQ']
irr = data['U']
equ = data['EQU']
fequ = data['FEQU']
spec = data['M']
print("H2", end=" , ")
print("{:.1f}".format(flows['mutantPercent']*100) , end=" , ")
print("{:.1f}... | |
<filename>src/conformal_methods/utils.py
import numpy as np
import pandas as pd
from src.config import SRC
from numba import jit
from scipy.stats import norm
from scipy.stats import skewnorm
from sklearn.preprocessing import StandardScaler
def init_scoring_object(method, quantile=0.9):
def scoring_object(estimato... | |
<gh_stars>10-100
import datetime as dt
from decimal import Decimal
from django.core.exceptions import ValidationError
from django.test import TestCase
from django.test.utils import override_settings
from django.utils.translation import deactivate_all
from workbench import factories
from workbench.invoices.models impo... | |
import numpy as np
import eccodes
import netCDF4 as nc
import Ngl
import Nio
import os
import datetime
from contextlib import ExitStack
import sys
current_path = sys.path[0]
ex_op_str = current_path[current_path.index('scripts')+8 : current_path.index('w2w_ensembleplots')-1]
sys.path.append('/lsdfos/kit/imk-tro/proje... | |
# -*- coding: utf-8 -*-
import os
import json
import tccli.options_define as OptionsDefine
import tccli.format_output as FormatOutput
from tccli import __version__
from tccli.utils import Utils
from tccli.exceptions import ConfigurationError
from tencentcloud.common import credential
from tencentcloud.common.profile.ht... | |
# .. coding: utf-8
# $Id: __init__.py 8854 2021-10-15 16:03:31Z milde $
# :Author: <NAME> <<EMAIL>>
# Based on the html4css1 writer by <NAME>.
# :Maintainer: <EMAIL>
# :Copyright: © 2005, 2009, 2015 <NAME>,
# portions from html4css1 © David Goodger.
# :License: Released under the terms of the `2-Clause BSD license`_, i... | |
ca_climate_zone_metadata,
):
_compute_containment(
isd_station_metadata, "usaf_id", iecc_climate_zone_metadata, "iecc_climate_zone"
)
_compute_containment(
isd_station_metadata,
"usaf_id",
iecc_moisture_regime_metadata,
"iecc_moisture_regime",
)
_compute_containment(
isd_station_metadata, "usaf_id", ba_cl... | |
change it now since some already trained models could not be loaded after
'Bernoulli': 'B',
'BernoulliPlusMinusOne': 'BPM1',
'OneHotCategorical': 'OHC',
# initializers
"glorot_normal_initializer": 'gn',
"glorot_uniform_initializer": 'gu',
"xavier_initializer": 'x',
"truncated_normal_initializer": 't',
"varian... | |
<filename>apps/apis/system_603/system_603.py
# @Copyright(C), OldFive, 2020.
# @Date : 2021/3/11 0011 10:48:20
# @Author : OldFive
# @Version : 0.1
# @Description :
# @History :
# @Other:
# ▒█████ ██▓ ▓█████▄ █████▒██▓ ██▒ █▓▓█████
# ▒██▒ ██▒▓██▒ ▒██▀ ██▌▓██ ▒▓██▒▓██░ █▒▓█ ▀
# ▒██░ ██▒▒██░ ░██ █▌▒████ ░▒██▒ ▓██ █▒░▒███... | |
<gh_stars>1-10
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload... | |
import asyncio
import logging
import re
import socket
import warnings
from asyncio import AbstractEventLoop
from ipaddress import ip_address, IPv4Network
from abc import ABCMeta
from abc import abstractmethod
from typing import Callable
from typing import List
from typing import Optional
from typing import Tuple
M... | |
else None
if not description:
raise errors.InvalidInput('Description is required when pending a listing for deletion')
listing = model_access.pending_delete_listing(user, listing, description)
return Response(data={"listing": {"id": listing.id}},
status=status.HTTP_201_CREATED)
except Exception as e:
logger.err... | |
vaex.dataset.DatasetArrays):
merged = vaex.dataset.DatasetArrays({**self.dataset._columns, item: value})
else:
left = self.dataset
if item in self.dataset:
left = left.dropped(item)
right = vaex.dataset.DatasetArrays({item: value})
merged = left.merged(right)
self.df._dataset = merged
self.df._length = len(va... | |
elif choice['which'] == 'os':
if choice['spool'] is not None:
self.gCommand.set_spool(choice['spool'])
useSudo = False
sudoUser = ""
if choice['SU'] is not None:
useSudo = True
sudoUser = choice['SU']
if choice['SH'] is None:
choice['SH'] = ""
if choice['repeat'] is None:
choice['repeat'] = [""]
if len(... | |
False, False, False, False],
[False, False, True, False, False, False, False],
[False, False, True, False, False, False, False],
[False, False, False, False, False, False, False],
],
)
self.assertEqual(table.del_span(zone), True)
res = []
for r in table.get_cells():
test_row = []
for cell in r:
test_row.appe... | |
"""
The module implements abstraction for arrays used by Zserio python extension.
"""
import typing
from zserio.bitposition import alignto
from zserio.bitsizeof import (bitsizeof_varuint16, bitsizeof_varuint32, bitsizeof_varuint64, bitsizeof_varuint,
bitsizeof_varint16, bitsizeof_varint32, bitsizeof_varint64, bitsiz... | |
import os
import os.path
import random
from operator import add
from datetime import datetime, date, timedelta
import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
import shutil
import ema_workbench
import time
## Step 2: Function for initiating the main dictionary of clim... | |
# -*- coding: utf-8 -*-
"""MixNet - S / M / L, MicroNet.
* Note: SHRINKING IS NOT SUPPORTED!
- Author: Curt-Park
- Email: <EMAIL>
- Paper: https://arxiv.org/abs/1907.09595
- Differences from the original model:
Every Mixblock has a skip connection
Swish function replaced with HSwish
Mixblock doesn't use group conv... | |
import argparse
import collections
import copy
import datetime
import enum
import json
import logging
import os.path
import re
import sys
import traceback
import typing
import uuid
import yaml
import dateparser
import git
import GPUtil
import d3m
from d3m import container, environment_variables, exceptions, utils, ty... | |
NO_ERROR = 0
MISTAKE = 1
FIXED_MISTAKE = 2
CHEAT = 3
ACROSS = 0
DOWN = 1
def make_hash(data):
try:
from hashlib import md5
m = md5()
except:
import md5
m = md5.new()
m.update(data)
return m.hexdigest()
class BinaryFile:
def __init__(self, filename=None):
if type(filename) == type(''): f = file(filename, 'r... | |
"""
Contains useful graphic generators. Currently, effect measure plots and functional form assessment plots
are implemented. Uses matplotlib to generate graphics. Future inclusions include forest plots
Contents:
Functional form assessment- func_form_plot()
Forest plot/ effect measure plot- EffectMeasurePlot()
... | |
headers=self.headers)
self.app.patch_json(
self.source_collection,
{"data": {"status": "to-rollback"}},
headers=self.headers,
)
resp = self.app.get(self.source_collection, headers=self.headers)
assert resp.json["data"]["status"] == "signed"
def test_rollbacks_if_review_already_requested(self):
self.app.patc... | |
import networkx as nx
import io, sys
from collections import defaultdict, Counter
import numpy as np
from Bio.Seq import translate, reverse_complement, Seq
from Bio import SeqIO
from panaroo.cdhit import align_dna_cdhit
from panaroo.isvalid import del_dups
from joblib import Parallel, delayed
import os
import gffutils ... | |
<reponame>annihilatorrrr/pytgbot
# -*- coding: utf-8 -*-
"""
A cli for bot api.
Supported commands are all `Bot.*` commands.
They need to be called with the parameter being json.
For the command
Custom commands to make stuff easier:
`msg <peer> <text>`
"""
from itertools import chain
import requests
from DictObject im... | |
== 0:
for widget in widgets:
widget.hide()
else:
combox_date_cols.set_active(0)
for widget in widgets:
widget.show()
self._refresh_view()
data_source.connect('rows-changed', self.on_data_source_rows_changed)
def add_options_filter(self, attr, options, add_empty_option=True):
"""Add optional options filter f... | |
1:
self.y_min = plotData.plotdict["y_lims"][0] - plotData.plotdict["y_lims"][1]
self.y_max = plotData.plotdict["y_lims"][0] + plotData.plotdict["y_lims"][1]
else:
tmp_y_min = self.y_min * ((plotData.plotdict["y_rel_lims"][0] if self.y_min > 0.0 else 2.0-plotData.plotdict["y_rel_lims"][0]) if self.max_dim... | |
# -*- Mode: Python; py-indent-offset: 4 -*-
# vim: tabstop=4 shiftwidth=4 expandtab
#
# Copyright (C) 2009 <NAME> <<EMAIL>>
# 2010 <NAME> <<EMAIL>>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software F... | |
<gh_stars>1-10
#
# Copyright (c) 2019 <NAME> <<EMAIL>>
#
# See the file LICENSE for your rights.
#
"""
Custom Keras and PyTorch classes.
"""
from keras import backend as K
from keras.callbacks import Callback, EarlyStopping
from keras.layers.convolutional import ZeroPadding2D, ZeroPadding3D
from keras.layers.local im... | |
n = X.shape
intercept = ones((m, 1), dtype=float64)
X = append(intercept, X, axis=1)
theta = ones((n + 1, 1), dtype=float64)
_lambda = 100
assert_allclose([[3.320665], [25.265821]],
reg_grad(X, y, theta, _lambda),
rtol=0, atol=0.001)
def test_reg_grad_data1_3(self, data1):
y = data1[:, -1:]
X = data1[:, :-1... | |
<filename>RPG.py
#This game is part of The Python-Game-Book
# TODO: equipped weapon for monster does not affect combat stat ?
# TODO: seperate IO from other code
# TODO: detect empty list_items for use, drop, equip etc
# TODO: give monster armor and weapons
# TODO: encumberance or cancel fight after 100 rounds
# TODO: ... | |
(bool) [create,query,edit]
When true, sets the Shaded Displayattribute of the fluid to AsRender: all fluid properties displayed as hardware
rendered. When false, displays only the currently selected paintable attribute of the fluid.
- displayVelocity : dv (bool) [create,query,edit]
Turns on/off velocity display, ... | |
"""
one_mode is an example file which seeks to verify the new Hamiltonian algorithm and update sequence
as derived by Dan and Stephen. It will ignore much of the class structure applied to OLIVE in an
attempt to provide a simple example of the algorithm. Once verified, it will be implemented within
OLIVE using the app... | |
<filename>toughradius/manage/models.py<gh_stars>1-10
#!/usr/bin/env python
#coding:utf-8
import sqlalchemy
import warnings
warnings.simplefilter('ignore', sqlalchemy.exc.SAWarning)
from sqlalchemy import *
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relation
from sqlalchemy.orm im... | |
data structure.
Args:
tree (Tree): tree data structure containing the model.
body (Body): body data structure instance.
joint_tag (ET.Element): joint XML tag.
parent_body (Body, None): the parent body instance.
Returns:
Joint: joint data structure instance.
"""
# create joint with the corresponding attribute... | |
<gh_stars>10-100
import torch
import torch.nn as nn
import numpy as np
import cell_level_search
from genotypes import PRIMITIVES
import torch.nn.functional as F
from operations import *
from decoding_formulas import Decoder
class AutoDeeplab (nn.Module) :
def __init__(self, num_classes, num_layers, criterion = None, ... | |
# Copyright 2020-present, the HuggingFace Inc. team.
#
# 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 ag... | |
+ range(0xD66, 0xD6F+1)
+ range(0xE50, 0xE59+1) + range(0xED0, 0xED9+1)
+ range(0xF20, 0xF29+1))
is_digit_char = _make_set_predicate(DIGIT_CHARS)
EXTENDING_CHARS = tuple(
[0xB7, 0x2D0, 0x2D1, 0x387, 0x640, 0xE46, 0xEC6, 0x3005]
+ range(0x3031, 0x3035+1) + range(0x309D, 0x309E+1)
+ range(0x30FC, 0x30FE+1))
is_e... | |
#!/usr/bin/env python
# coding: utf-8
# In[24]:
import json
import random
import numpy as np
from pathlib import Path
from typing import Tuple, List
import math
import matplotlib.pyplot as plt
#get_ipython().run_line_magic('matplotlib', 'inline')
from tensorflow.keras.layers import Input, Dense, Conv2D, MaxPooling2... | |
from collections import defaultdict
import random
from math import ceil
import json
import pickle
def general_results():
with open('data/dependencies.p', 'rb') as f:
trees = pickle.load(f)
with open('data/negation_concepts.json', 'r') as f:
annotated_concepts = json.load(f)
conjunct_concepts = NegationDetection.... | |
# 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 ... | |
# -*- coding: utf-8 -*-
"""
@author: github.com/byochim
"""
import sys
from classlist import investment_models
from classlist import lifetime_earnings_models
def main():
'''
Introductory message briefly explaining the program.
'''
print("Welcome to the Investment Calculator."
"\nThis calculator conta... | |
arguments against known Juju API types.
if error_ is not None and not isinstance(error_, (dict, Error)):
raise Exception("Expected error_ to be a Error, received: {}".format(type(error_)))
if info_ is not None and not isinstance(info_, (dict, ScaleApplicationInfo)):
raise Exception("Expected info_ to be a ScaleApp... | |
import h5py
import logging
import operator
import numpy as np
import westpa
from westpa.cli.core import w_init
from westpa.cli.core import w_run
from westpa.core.extloader import get_object
from westpa.core.segment import Segment
from westpa import analysis
import json
import os
import shutil
import pickle
import im... | |
(_configDef['zdesk_config']['zdesk_link']) + str(ticketid) + "\">" + str(ticketid) + "</a></td></tr><tr>" \
"<td style='width:4%;border:1px solid blue;border-bottom: double blue;text-align:center'>PRIORITY</td>" \
"<td style='border:1px solid black;text-align:center'>" + str(priority) + "</td></tr><tr>" \
"<td style... | |
# -*- coding:utf-8 -*-
"""
mincheng:<EMAIL>
"""
from __future__ import division
import sys
import printlog
import datetime
import os
import time
import sklearn
from sklearn.metrics import confusion_matrix
from baselines import sclearn
import evaluation
from collections import defaultdict
import tensorflow as tf
import ... | |
import datetime
from mimetypes import guess_type
from django import forms
from django.contrib import admin, messages
from django.contrib.admin.util import unquote
from django.contrib.admin.views.main import ChangeList
from django.contrib.auth.decorators import permission_required
from django.core.exceptions import Val... | |
to the size of each partition.
::
t = Tree("(f,((d, ((a,b),c)),e));")
print t
#
# /-f
# |
# | /-d
# ----| |
# | /---| /-a
# | | | /---|
# | | \---| \-b
# \---| |
# | \-c
# |
# \-e
t.ladderize()
print t
# /-f
# ----|
# | /-e
# \---|
# | /-d
# \---|
# | /-c
# \---|
# | /-a
# \---|
# \-b... | |
import logging
import signal
from base64 import b64encode
from concurrent import futures
from datetime import datetime
from time import perf_counter_ns
import grpc
import numpy as np
import pytz
from google.protobuf.timestamp_pb2 import Timestamp
from pfizer import compute_probs as compute_pfizer_probs
from proto imp... | |
creating fake
#data and replicating a fake POST request, we are able to simulate the expected functionality of each of the functions, and evaluate the
#expected output.
#This happy path test case demonstrates what an ideal test case and result would be, with the expected input and output that one would
#expect in a no... | |
#!/usr/bin/python2.7
# -*- coding: utf-8 -*-
"""ncurses Python application for "Getting Things Done".
[Methodology - Getting Things Done]
[Method - Todo.txt]
Todo.txt is a text data format designed to store personal task data. It follows
philosophies of simplicity, portability and functionality.
More details here... | |
+ (n - 1,)
key = key.transpose(qk_perm)
query = query.transpose(qk_perm)
# v -> (bs, <non-attention dims>, num_heads, channels, <attention dims>)
v_perm = batch_dims + (n - 1,) + axis
value = value.transpose(v_perm)
query = query / jnp.sqrt(depth).astype(dtype)
batch_dims_t = tuple(range(len(batch_dims)... | |
#!/usr/bin/env python
import os
import pwd
import sys
import grp
import time
import copy
import pysam
import bisect
import tarfile
import logging
import argparse
from io import StringIO, BytesIO
from tempfile import NamedTemporaryFile
from collections import Counter, defaultdict
from pbsuite.utils.setupLogging import s... | |
paneAssetTemplates.move(64, 34)
# Publish::Templates::AssetPane: Publish default button
def setAssetDefault():
txt_asset.setText(self.framework.prefs.get('flameMenuPublisher', {}).get('templates', {}).get('Asset', {}).get('flame_render').get('default', ''))
btn_assetDefault = QtWidgets.QPushButton('Default', paneA... | |
: np.ndarray, shape=(N, 12)
Bitmap of active notes, relative to the given root.
root : np.ndarray, shape=(N,)
Absolute pitch class number.
Returns
-------
bitmap : np.ndarray, shape=(N, 12)
Absolute bitmaps of active pitch classes.
"""
abs_bitmaps = []
for bitmap, chord_root in zip(bitmaps, roots):
abs_bit... | |
of shape (n + p,)
"""
# Compute population parameters and sensitivities dtheta/dvartheta
params, dvartheta = \
self._covariate_model.compute_population_sensitivities(
parameters)
# Compute log-likelihood and sensitivities dscore/deta, dscore/dtheta
score, sensitivities = self._population_model.compute_sensitivi... | |
<reponame>Scopetta197/chromium
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Virtual Me2Me implementation. This script runs and manages the processes
# required for a Virtual ... | |
# coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen
https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.14.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
# import models into model package
from... | |
<gh_stars>1-10
import os
import cv2
import torch
import numpy as np
from time import time
from collections import defaultdict
# Thirdparty ##################
import g2o
import lambdatwist
################################
from .utils import utils
from .labeling import kp_config
from .models.pkpnet import PkpNet
from ... | |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
vivopump -- module of helper functions for the pump
"""
import sys
import csv
import string
import random
import logging
__author__ = "<NAME>"
__copyright__ = "Copyright (c) 2016 <NAME>"
__license__ = "New BSD license"
__version__ = "0.8.7"
logger = lo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.