input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
things need to be taken into
account in the following priority:
1. If `noBivariates` is `True`, then `y` must be equal to `0`.
2. If `self.useMean` is `True`, then `y` is equal to the mean of the
full length of the secondary channel.
3. If `y` is provided, then use the provided value.
4. If `timestamp` is provide... | |
import sys
import ctypes as ct
import os.path
import config.config as c
import NuToPos as ntp
import rdbparse as rp
import playDarts as pd
import GetNRCDailyInfo as nrc
import distance as sd
import dailyparse as dp
import numpy as np
import ArgParser as p
import PhysicsConstants as pc
basepath = os.path.dirname(__fi... | |
#from grounding import Grounder
import grounding
from pddl.parser import Parser
from task import Operator
from pddl.pddl import Type, Predicate, Effect, Action, Domain, Problem
def assert_equal(result, expected):
assert result == expected
def get_action(name, signature, precondition, addlist, dellist):
effect = E... | |
if( pkey_i != pkey_j):
nblist_i.cnt += 1
nblist_i.list.append(pkey_j)
#
# Add extra index positions for key+1 call made by final key
#
nblist_i.index.append(nblist_i.cnt + 1)
# Clear 2D list from memory
del nd2D
#
return nblist_i
def guess_nblist(self,radius_type,radii_buffer=1.25):
"""
Create neighbo... | |
: sparse matrix, dia
Inverse mass matrix, D^{-1}
lhsfac : cholesky Factor object
Factorized left side, solves biharmonic problem
notboundary : ndarray, int
Indices of non-boundary vertices
"""
try:
from scikits.sparse.cholmod import cholesky
factorize = lambda x: cholesky(x).solve_A
except ImportError:
facto... | |
"""
@author: eagle705
https://github.com/eagle705/pytorch-bert-crf-ner/
"""
from __future__ import absolute_import, division, print_function, unicode_literals
import json
import torch
from pathlib import Path
from tensorflow import keras
import numpy as np
from konlpy.tag import Twitter
from collections import Counter... | |
<reponame>cosanlab/facesync<gh_stars>1-10
from __future__ import division
'''
FaceSync Utils Class
==========================================
VideoViewer: Watch video and plot data simultaneously.
AudioAligner: Align two audios manually
neutralface: points that show a face
ChangeAU: change AUs and return new fac... | |
), # 15 Status Update Length was 15 but panel seems to send different lengths
0xA6 : PanelCallBack( 15, True, False ), # 15 Zone Types I think!!!!
0xA7 : PanelCallBack( 15, True, False ), # 15 Panel Status Change
0xAB : PanelCallBack( 15, False, False ), # 15 Enroll Request 0x0A OR Ping 0x03 Length was 15 but panel ... | |
<reponame>joakimzhang/python-electron
#!/usr/bin/env python
'''
display a image in a subprocess
<NAME>
June 2012
'''
import time
from wx_loader import wx
try:
import cv2.cv as cv
except ImportError:
import cv
from MAVProxy.modules.lib import mp_util
from MAVProxy.modules.lib import mp_widgets
from MAVProxy.modules... | |
"""
:mod:`test_frbr_rda_expression` Tests FRBR RDA Expression and supporting
properties from RDF documents
"""
__author__ = '<NAME>'
import logging
import unittest,redis,config
import lib.common as common
import lib.frbr_rda as frbr_rda
import lib.namespaces as ns
redis_server = redis.StrictRedis(host=config.REDIS_... | |
False )
if 67 - 67: o0oOOo0O0Ooo . I1Ii111 % iIii1I11I1II1 / I1Ii111
IIiIiII = ( prefix . addr_length ( ) * 8 ) - iIi1iii1
oOoo00oOoO0o = ( 2 ** iIi1iii1 - 1 ) << IIiIiII
return ( ( self . address & oOoo00oOoO0o ) == prefix . address )
if 18 - 18: I11i * ooOoO0o
if 46 - 46: IiII
def mask_address ( self , mask_le... | |
np.array([[0.0025, 0.01, 0.0025], [0.01, 0.95, 0.01], [0.0025, 0.01, 0.0025]])
Pois = ndimage.convolve(Pois.copy(), kernel)
#Pois = ndimage.filters.gaussian_filter(Pois.copy(), sigma=0.4)
fourierSp = np.log10(np.abs(fftpack.fft2(Pois)))
print 'Poisson 2d Smoothed:', np.var(Pois)
print np.mean(fourierSp), np.median... | |
freeze_weights(model.module.ext_embeddings)
if args.config_ext_emb_method == 'concat':
freeze_weights(model.module.roberta_classifier.roberta.encoder.layer[args.ext_emb_concat_layer].attention.self, ['query_t', 'key_t', 'value_t'])
if args.config_ext_emb_method.lower() == 'kar':
freeze_weights(model.module.roberta_... | |
# Match a path to a course.
# TODO(psimakov): linear search is unacceptable
for course in courses:
if path == course.get_slug() or path.startswith(
'%s/' % course.get_slug()) or course.get_slug() == '/':
return course
debug('No mapping for: %s' % path)
return None
def path_join(base, path):
"""Joins 'base' a... | |
from __future__ import unicode_literals
import re
from django import forms
from django.contrib.auth.models import User
from django.contrib.postgres.forms.array import SimpleArrayField
from django.db.models import Count, Q
from mptt.forms import TreeNodeChoiceField
from taggit.forms import TagField
from timezone_field... | |
<reponame>bovlb/the-blue-alliance
import copy
import math
from collections import defaultdict
from typing import (
cast,
Dict,
List,
Literal,
Mapping,
MutableMapping,
Optional,
Tuple,
TypedDict,
)
import numpy as np
from pyre_extensions.refinement import none_throws, safe_cast
from backend.common.consts.alli... | |
<gh_stars>1-10
#
# Copyright (c) 2021 Airbyte, Inc., all rights reserved.
#
import abc
import os
import time
from pathlib import Path
from typing import Any, Callable, Optional, Union
import airbyte_api_client
import yaml
from airbyte_api_client.api import connection_api, destination_api, source_api
from airbyte_api_... | |
self.bag_type()
pass
elif token in [PigParser.MAP]:
self.enterOuterAlt(localctx, 4)
self.state = 196
self.map_type()
pass
else:
raise NoViableAltException(self)
except RecognitionException as re:
localctx.exception = re
self._errHandler.reportError(self, re)
self._errHandler.recover(self, re)
finally:
se... | |
arg1.
3. The combined string is then filtered using filter1.
- The following characters must be escaped by preceeding them with a single \:
- ()|
"""
tokens = [
# When in literal mode, only allow to escape }
lexer.Token("Literal", r"\\[^{}]", "AppendArg", None),
# Allow escaping of special characters
lexer.... | |
<filename>ExecTrial.py<gh_stars>0
#--------------------------------Imports---------------------------------------#
import pygame, sys
from pygame.locals import *
import random
#--------------------------------Imports---------------------------------------#
#----------------------------------Solve Methods---------------... | |
in range(3)]
for run in range(N_runs):
TV_loss_total += loss[run]['TV']
CostTrain_loss_total += loss[run][('%s' %cost_func[run], 'Train')]
CostTest_loss_total += loss[run][('%s' %cost_func[run], 'Test')]
N_epochs = N_epochs[0]
average_loss['TV'] = TV_loss_total/N_runs
average_loss[('%s' %cost_func[run], 'Tra... | |
<reponame>paudetseis/SplitPy<gh_stars>10-100
# Copyright 2019 <NAME> & <NAME>
#
# This file is part of SplitPy.
#
# 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, includin... | |
'view']
_all_searchable_fields = ['comment', 'ipv4addr', 'name', 'view', 'zone']
_return_fields = ['extattrs', 'ipv4addr', 'name', 'view']
_remap = {}
_shadow_fields = ['_ref']
class RpzAaaaRecord(InfobloxObject):
""" RpzAaaaRecord: Response Policy Zone Substitute AAAA Record Rule
object.
Corresponds to WAPI o... | |
from time import sleep
from datetime import datetime
from influxdb import InfluxDBClient
from influxdb.exceptions import InfluxDBClientError
import logging
import logging.config
import os.path
import pynvml as N
import psutil
import subprocess
import socket
import sys
import yaml
# Global LOGGER var
LOGGER = logging.... | |
<filename>src/tankoh2/control_cl.py
"""control a tank optimization"""
import sys
import statistics
from tankoh2.existingdesigns import kautextDesign, NGTBITDesign
#from builtins import True, False
#from builtins import
sys.path.append('C:/MikroWind/MyCrOChain_Version_0_95_4_x64/MyCrOChain_Version_0_95_4_x64/abaqus_in... | |
#!/usr/bin/env python
""" Python script example
Usage:
test_maxram.py [--target=<ram_target>][--count=<word_count>]
Options:
--help Shows this help message.
"""
from __future__ import print_function
from __future__ import absolute_import
from __future__ import unicode_literals
from docopt import docopt
import sy... | |
from flask import Flask, jsonify
app = Flask(__name__)
# Get information about electricity generation without license in Europe
# k1 = country
# k2 = Amount of the fine for electricity generation without license and not connected to the national grid for
# internal needs ?
# k3 = Number of years of imprisonment for ... | |
status_change_index == 16:
self.b_arrive_point = 0
self.server_data_obj.mqtt_send_get_obj.b_draw = 1
# 断网返航到返航到家
elif status_change_index == 17:
pass
# 低电量返航到返航到家
elif status_change_index == 18:
pass
# 断网返航到电脑手动
elif status_change_index == 19:
pass
# 低电量返航到电脑手动
elif status_change_index == 20:
pass
# 断网返航... | |
# Tile the flat_values for the uniform dimensions (i.e., for `axis=0` plus
# `axis=range(ragged_rank, rank)`).
inner_repeats = array_ops.concat([multiples[:1], multiples[ragged_rank + 1:]],
axis=0)
return array_ops.tile(ragged_tiled_values, inner_repeats)
def _tile_ragged_splits(rt_input, multiples, const_multipl... | |
<gh_stars>1-10
from typing import Any, Sequence
from datetime import datetime
from threading import Thread
from vnpy.api.xtp.vnxtp import (
XTP,
set_async_callback_exception_handler,
AsyncDispatchException,
OrderBookStruct,
XTPMarketDataStruct,
XTPQuoteStaticInfo,
XTPRspInfoStruct,
XTPSpecificTickerStruct,
XT... | |
only printed in label.
All other remaining parameters can be used to further customize the Map
configuration.
When producing the map, only one of 'centermap_geo' or 'centermap_delta'
options can be used at a time.
"""
import matplotlib.pyplot as plt
import cartopy.crs as ccrs
import cartopy.feature as cfeature... | |
<reponame>rgraebert/skia
#!/usr/bin/python
"""
Copyright 2013 Google Inc.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
Calulate differences between image pairs, and store them in a database.
"""
import contextlib
import csv
import logging
import os
import re
impo... | |
keys
irobs = sum([v.values() for v in matching_irobs.values()], [])
# list of lists of IROBs
irobs = sum(irobs, [])
# list of IROBs
dropped_irobs = filter(lambda x: x.wasDropped(), irobs)
fail = (len(dropped_irobs) > 0)
if fail:
dprint("Session: %s" % session)
dprint(" IROBs: " % irobs)
return fail
failov... | |
# coding=utf-8
# Copyright 2021 The Google Research 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 obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | |
channels 音频数/声道数
self.channels = channels # type: int
# code_name 音频编码模式
self.code_name = code_name # type: str
# duration 单位 秒
self.duration = duration # type: str
# sample_rate 音频采样率
self.sample_rate = sample_rate # type: str
def validate(self):
pass
def to_map(self):
result = {}
if self.bit_rate is not... | |
""" resolves an entity synchronously
Args:
input_umf_: G2 style JSON
"""
if type(input_umf_) == str:
input_umf_string = input_umf_.encode('utf-8')
elif type(input_umf_) == bytearray:
input_umf_string = str(input_umf_)
else:
input_umf_string = input_umf_
responseBuf = c_char_p(addressof(tls_var.buf))
response... | |
self._entity_data.get('DefaultAnim')
return ""
class info_npc_spawn_destination(Targetname, Parentname):
pass
icon_sprite = "editor/info_target.vmat"
@property
def ReuseDelay(self):
if "ReuseDelay" in self._entity_data:
return float(self._entity_data.get('ReuseDelay'))
return float(1)
@property
def Renam... | |
oprot.writeListBegin(TType.I32, len(self.success))
for iter366 in self.success:
oprot.writeI32(iter366)
oprot.writeListEnd()
oprot.writeFieldEnd()
if self.svEx is not None:
oprot.writeFieldBegin('svEx', TType.STRUCT, 1)
self.svEx.write(oprot)
oprot.writeFieldEnd()
oprot.writeFieldStop()
oprot.writeStructEnd()... | |
test_no_copy(self):
assert copy(HYPOT) is HYPOT
assert deepcopy(HYPOT) is HYPOT
def test_call(self):
assert_token(HYPOT, [1, 1], [math.sqrt(2)], approx=True)
assert_token(HYPOT, [math.sqrt(3), 1], [2], approx=True)
assert_token(
HYPOT,
[1, np.array([np.sqrt(3), 1])],
[np.array([2, np.sqrt(2)])],
approx=True,... | |
from __future__ import annotations
import asyncio
import datetime
import typing
from . import base, fields
from .chat_invite_link import ChatInviteLink
from .chat_location import ChatLocation
from .chat_member import ChatMember
from .chat_permissions import ChatPermissions
from .chat_photo import ChatPhoto
from .inpu... | |
import os
from datetime import datetime
import numpy as np
from msl.io import JSONWriter, read
from .. import __version__
from ..log import log
from ..constants import REL_UNC, DELTA_STR, SUFFIX, MU_STR
def num_to_eng_format(num):
for key, val in SUFFIX.items():
renum = num/val
if abs(renum) < 1000:
eng_num = "... | |
import os
import socket
import sys
import tempfile
from collections import OrderedDict
from typing import List, Tuple
import click
import click_spinner
from src import settings
from src.cli import console
from src.graphql import GraphQL
from src.local.providers.helper import get_cluster_or_exit
from src.local.system ... | |
"""
nucs = set()
for child in self.getChildren():
nucs.update(child.getNuclides())
return nucs
def getFissileMass(self):
"""Returns fissile mass in grams."""
return self.getMass(nuclideBases.NuclideBase.fissile)
def getHMMass(self):
"""Returns heavy metal mass in grams"""
nucs = []
for nucName in self.getN... | |
# -*- coding=utf-8 -*- #
# @author;zhangyihao
# @date: 2021-01
'''爬取指定网站的讲座信息并保存至本地
功能介绍
1. Selenium框架
2. 全部/指定网站爬取
3. 接口支持后期拓展
Typical usage example:
sp=SpiderMan()
sp.scrapy()
'''
from selenium import webdriver
import requests
import pandas as pd
import time
import os
from bs4 import BeautifulSoup
import warnin... | |
<reponame>TwinklePie/evennia-nvn
"""
Contains everything involved in editplayer/editchar
"""
from ev import syscmdkeys
from ev import Command
from contrib.menusystem import MenuNode, MenuTree
from ev import utils
CMD_NOMATCH = syscmdkeys.CMD_NOMATCH
CMD_NOINPUT = syscmdkeys.CMD_NOINPUT
def printchar(caller):
"""
... | |
scheme',
min_entries=1)
identifiers = FieldList(
FormField(IdentifierForm), 'Identifiers for this scheme',
min_entries=1)
versions = FieldList(
FormField(VersionForm), 'Version history', min_entries=1)
# Editing organizations
# ---------------------
class OrganizationForm(FlaskForm):
name = StringField('Name o... | |
#!/usr/bin/env python
import signal
import rospy
import smach
import smach_ros
import math
from geometry_msgs.msg import Twist
import numpy as np
from sensor_msgs.msg import LaserScan
from sensor_msgs.msg import Joy
from geometry_msgs.msg import PoseWithCovarianceStamped
from tf.transformations import euler_from_quate... | |
############################################
# Copyright (c) 2012 Microsoft Corporation
#
# Z3 Python interface
#
# Author: <NAME> (leonardo)
############################################
"""Z3 is a high performance theorem prover developed at Microsoft Research. Z3 is used in many applications such as: software/hardwa... | |
<filename>SatQuMA_1.1.py
# -*- coding: utf-8 -*-
"""
This script calculates the secure key length for an aysmmetric BB84 security
protocol with weak coherent pulses and three signal states (or 2 'decoy'
states).
The 5 main protocol parameters can be either optimised or specified:
Px = X basis polarisation bias (Alice... | |
<gh_stars>10-100
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import numpy as np
import scipy.io as sio
import gym
import time
import random
import datetime
import os
import imageio
import glob
import tqdm
import json
# tf.random.set_seed(11)
# tf.keras.backend.set_floatx('... | |
<reponame>cpausmit/Tapas
# ==================================================================================================
#
# >> create table Courses (Number char(10), Name char(80), Version int);
#
# >> create table Teachers (FirstName char(20), LastName char(20),
# Email char(40), Position char(20), Status char(2... | |
# -*- coding: utf-8 -*-
'''
Created on Fri Jan 18 10:59:43 2019
@author:
<NAME>
Turku University Hospital
January 2019
@description:
This code is used for feature selection for different classification models
'''
#%% clear variables
%reset -f
%clear
#%% import necessary libraries
import os
import time
... | |
shuffle=data_type != 'test',
to_fit=data_type != 'test'), _data_samples['crossing']) # set y to None
_data_opt_flow = (DataGenerator(data=[_data_samples['optical_flow']],
labels=_data_samples['crossing'],
data_sizes=[data_type_sizes_dict['optical_flow']],
process=process,
global_pooling=self._global_pooling,
inp... | |
<filename>green/midhaul_heuristic.py
"""Midhaul Heuristic Module.
Heuristics for Journal 3.
"""
from datetime import datetime
from hcran_generic import HcranGeneric
from hcran_monitor import *
from midhaul import Midhaul
MAGIC_NUMBER = -999987.53463
class MidhaulHeuristic(HcranGeneric):
def __init__(self, city_n... | |
scrolling of your selected Effect.
"""
# Text attributes for use when printing to the Screen.
A_BOLD = constants.A_BOLD
A_NORMAL = constants.A_NORMAL
A_REVERSE = constants.A_REVERSE
A_UNDERLINE = constants.A_UNDERLINE
# Text colours for use when printing to the Screen.
COLOUR_BLACK = constants.COLOUR_BLACK
C... | |
# -*- coding: utf-8 -*-
"""
@author: <NAME>
"""
import numpy as np
from numbers import Number
from geotext import GeoText
import random
from functools import reduce
from nltk import pos_tag
from nltk.tokenize import word_tokenize
from nltk.stem import PorterStemmer
from scipy.sparse import lil_matrix
#%%Read the ent... | |
'Hyrule Castle Exit (South)', player)
connect_exit(world, 'Hyrule Castle Exit (South)', 'Hyrule Castle Entrance (South)', player)
caves.append(('Hyrule Castle Exit (West)', 'Hyrule Castle Exit (East)'))
else:
doors.append('Hyrule Castle Entrance (South)')
entrances.append('Hyrule Castle Entrance (South)')
caves.a... | |
"""
Freqtrade is the main module of this bot. It contains the class Freqtrade()
"""
import copy
import logging
import traceback
import os
from datetime import datetime, timezone
from math import isclose
from os import getpid
from typing import Any, Dict, List, Optional, Tuple
import arrow
from requests.exceptions impo... | |
# -*- coding: utf-8 -*-
import numpy as np
import cv2
from pathlib import Path
from moviepy.editor import VideoFileClip
from IPython.display import HTML
def calibrateCamera(nx,ny,imgPath):
objPts = [] #3D points in object plane
imgPts = [] #2D points in image plane
objP = np.zeros((6*9,3),np.float3... | |
from abc import ABC, abstractmethod
import scipy
import numpy as np
class Server(ABC):
def __init__(self, server_model, merged_update):
self.model = server_model
self.merged_update = merged_update
self.total_weight = 0
@abstractmethod
def train_model(self, my_round, num_syncs, clients_per_group,
sampler, batc... | |
charge=0)
ATP_HYDR_EEO = Metabolite('ATP_HYDR_EEO', formula='', name='', compartment='EEOe', charge=0)
ATP_TRANS_EEO = Metabolite('ATP_TRANS_EEO', formula='', name='', compartment='EEOe', charge=0)
lac__D_EEOc = Metabolite('lac__D_EEOc', formula='C3H5O3', name='D-Lactate', compartment='EEOc', charge=-1)
nad_EEOc =... | |
from sunpy.net import vso, Fido
from numpy import unique
import glob
from sunpy.sun import carrington_rotation_number
import astropy.units as u
from astropy.io import fits
from datetime import datetime,timedelta
import ftplib
import sys,os
import gzip
import shutil
class download_cms_files:
# inital information abou... | |
#!/usr/bin/env python3
import statistics
import os
import glob
from tkinter import filedialog
from tkinter import * # noqa
import pandas as pd
from eventcodes import eventcodes_dictionary
from natsort import natsorted, ns
import matplotlib.pyplot as plt
import numpy as np
import datetime
__all__ = ["loop_over_days", ... | |
Phi_n=0 since h=b here)
rhs[:,-1] = 0 # but we again set it explicitly to be absolutely clear
# For the xi=1 boundary condition we implicitly make the 2nd derivative zero
A_p0_m1 = np.zeros(Phi_n_old.shape)
A_p0_m2 = np.zeros(Phi_n_old.shape)
A_p0_m3 = np.zeros(Phi_n_old.shape) # required for higher order stencil
... | |
<filename>code_mod1.py
# Model I
# Version 23th July 2015
# The python code solves Model I for the optimization of a transit line
# and for the strategic assessment of mode choice, see:
# <NAME>, and <NAME>, 'Improved models for technology choice in a transit corridor with fixed demand', 2015
# For comments, please w... | |
# -*- coding: utf-8 -*-
# Copyright 2016 Novo Nordisk Foundation Center for Biosustainability,
# Technical University of Denmark.
#
# 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://w... | |
# -*- coding: utf-8 -*-
"""Siamese Network for performing training of a Deep Convolutional
Network for Face Verification on the Olivetti and LFW Faces datasets.
Dependencies:
python 3.4+, numpy>=1.10.4, sklearn>=0.17, scipy>=0.17.0, theano>=0.7.0, lasagne>=0.1, cv2, dlib>=18.18 (only required if using the 'trees' cro... | |
be changed in the future, and at
# the IR level it makes sense to include the dependency
if annotation.namespace.name != self.namespace.name:
self.namespace.add_imported_namespace(
annotation.namespace,
imported_annotation=True)
# Indicate that the attributes of the type have been populated.
self._is_forward_re... | |
Constraint(expr= m.x420 == 0)
m.c124 = Constraint(expr= m.x421 == 0)
m.c125 = Constraint(expr= m.x443 == 0)
m.c126 = Constraint(expr= m.x444 == 0)
m.c127 = Constraint(expr= m.x445 == 0)
m.c128 = Constraint(expr= m.x146 - m.x416 - m.x419 == 0)
m.c129 = Constraint(expr= m.x147 - m.x417 - m.x420 == 0)
m.c130 = Cons... | |
'latconst(c)'\n")
fout.write("set zlabel 'Energy'\n")
fout.write("splot 'energy-latconst.data'\n")
fout.write("EOF\n")
else:
fout.write(" energy=`cat ../relax-${a}/optimization.out | grep 'Total =' | tail -n -1 | cut -d \"=\" -f 2`\n")
fout.write(" cat >> energy-latconst.data <<EOF\n")
fout.write("${a} ${... | |
connection type.')
# Activation function
self._input_activation_fn = None
if activation_fn_in_separable_conv:
activation_fn = (torch.nn.ReLU6(inplace=False) if
use_bounded_activation else
torch.nn.ReLU(inplace=False))
else:
if use_bounded_activation:
# When use_bounded_activation is True, we clip... | |
#----------------------------------------------------------------------------
# Name: wx.lib.intctrl.py
# Author: <NAME>
# Created: 01/16/2003
# Copyright: (c) 2003 by <NAME>
# License: wxWindows license
# Tags: phoenix-port, py3-port, unittest, documented
#--------------------------------------------------------------... | |
-5): (-1, 1),
(2, 32, -1, -4): (1, 1),
(2, 32, -1, -3): (-1, 1),
(2, 32, -1, -2): (0, 1),
(2, 32, -1, -1): (0, 1),
(2, 32, -1, 0): (0, 1),
(2, 32, -1, 1): (0, 1),
(2, 32, -1, 2): (0, 1),
(2, 32, -1, 3): (0, 0),
(2, 32, -1, 4): (-1, -1),
(2, 32, -1, 5): (0, 1),
(2, 32, 0, -5): (-1, 1),
(2, 32, 0, -4): (0, 1)... | |
<reponame>piyush1301/plotly.py
import _plotly_utils.basevalidators
class YsrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name='ysrc', parent_name='waterfall', **kwargs):
super(YsrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
edit_type=kwargs.... | |
<filename>core/snapshot.py
import abc
import numpy as np
from namelist import load_nml, NML
from seren3 import config
class Snapshot(object):
"""
Base class for loading RAMSES snapshots
"""
__metaclass__ = abc.ABCMeta
def __init__(self, path, ioutput, **kwargs):
import os
from snapshot_quantities import Quanti... | |
#!/usr/bin/env python
# Import Modules
#-------------------------------------------------------
# Scipy and Numpy
from scipy import *
import scipy.special as special
# Mesh generator
import mesh as tri
# Non-symmetric Gaussian Solver
import nsymgauss as NSG
# Quadrature data
import quad as GQD
# Shape function mo... | |
is a naming change of variable. X in fit()
is changed to Y here, and design in fit() is changed to X here.
This is because we follow the tradition that X expresses the
variable defined (controlled) by the experimenter, i.e., the
time course of experimental conditions convolved by an HRF,
and Y expresses data.
How... | |
from nutils import mesh, function, solver, util, export, cli, testing
import numpy as np, treelog
from CoolProp.CoolProp import PropsSI
import scipy.special as sc
from matplotlib import pyplot as plt
from scipy.stats import norm
from matplotlib import collections, colors
import pandas as pd
# import seaborn as sns
impo... | |
<filename>spikeinterface/comparison/paircomparisons.py
import numpy as np
import pandas as pd
from ..toolkit.postprocessing import compute_template_similarity
from .basecomparison import BasePairComparison, MixinSpikeTrainComparison, MixinTemplateComparison
from .comparisontools import (do_count_event, make_match_cou... | |
color='red', linewidth=5)
Ax.plot((30*dz[l],30*dz[l]), (98*dr[l],103*dr[l]), '-', color='red', linewidth=5)
Ax.plot((32*dz[l],32*dz[l]), (98*dr[l],103*dr[l]), '-', color='red', linewidth=5)
Ax.plot((30*dz[l],32*dz[l]), (98*dr[l],98*dr[l]), '-', color='red', linewidth=5)
Ax.plot((30*dz[l],32*dz[l]), (103*dr[l],... | |
AccountUnits = sentinel):
Model.__init__(**locals())
class ArrayCalculatedTradeState(Array, contains=CalculatedTradeState):
pass
class MarketOrderDelayedTradeClose(Model):
"""Details for the Market Order extensions specific to a Market Order placed
with the intent of fully closing a specific open trade that sho... | |
amplification'
print 'Multipliers for %s:' % method_name
for idx in top_concept_multiplier_indices:
concept = concepts[idx]
nonzero_indices = term_concept_index.getcol(idx).nonzero()[0]
print '%s (%f): ' % (concept, concept_multiplier_lil[0, idx]),
for word_idx in nonzero_indices:
print '(%s, %f)' % (mapping[wor... | |
<filename>photobuchauswahltool/__main__.py<gh_stars>0
"""
Graphisches Programm zum sortieren von Bildern in verschiedene Ordner.
"""
from typing import List, Dict, Callable, Tuple, Optional
import imghdr
import tkinter as tk
from tkinter import ttk, N, E, S, W
import tkinter.filedialog as tkfd
import tkinter.messag... | |
###############################################################################################################################
# This script implements a simplification of the evolutionary process proposed by Real et al.: https://arxiv.org/abs/1802.01548v7#
#############################################################... | |
#!/usr/bin/env python
#
# clean.sgd: cleaning operations for SGD GFF data
# Copyright (C) University of Manchester 2020 <NAME>
#
import logging
from ..GFFFile import GFFID
from ..GFFFile import OrderedDictionary
#######################################################################
# Functions
######################... | |
<filename>skbio/diversity/beta/tests/test_unifrac.py<gh_stars>100-1000
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distrib... | |
<filename>src/graph_transpiler/webdnn/frontend/tensorflow/ops/gen_array_ops.py
from typing import List
import numpy as np
import tensorflow as tf
from webdnn import ConstantVariable
from webdnn.frontend.constraints import AxisVar, unify_order
from webdnn.graph.operators.reshape import Reshape
from webdnn.graph.operat... | |
<reponame>alex123012/biotite
# This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__ = "biotite.structure.io.pdb"
__author__ = "<NAME>, <NAME>"
__all__ = ["PDBFile"]
import warnings
import numpy as np
from ...a... | |
from django.shortcuts import render, redirect, get_object_or_404
from django.core.urlresolvers import reverse
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponseRedirect, HttpResponse, Http404
from django.contrib.auth.models import User
from django.contrib.auth import login as aut... | |
armor', variants=[
Variant('festive_2_heavy.jpg', 'heavy armor'),
]),
Shot("Flames", 'flames_1_regular.jpg', 'light armor', variants=[
Variant('flames_2_heavy.jpg', 'heavy armor'),
]),
Shot("Forest", 'forest_1_regular.jpg', 'light armor', variants=[
Variant('forest_2_heavy.jpg', 'heavy armor'),
]),
Shot("Gearb... | |
:math:`[h^{-1}\mathrm{Mpc}]`
"""
logdens = np.log10(self.mass_to_dens(Mthre, redshift))
return self.get_wauto_cut(R2d, logdens, logdens, redshift, pimax, integration)
def get_wauto_mass(self, R2d, M1, M2, redshift):
"""get_wauto_mass
Compute the projected halo-halo correlation function :math:`w_{hh}(R;M_1,M_2)... | |
#
import numpy as np
import torch
from torch.utils.data import DataLoader
import sklearn.model_selection as skm
from apps.drl.chpA01.e01.chp_a01_e01_ds import ChpA01E01Ds
from apps.drl.chpA01.e01.chp_a01_e01_model import ChpA01E01Model
class ChpA01E01(object):
def __init__(self):
self.name = ''
self.model_file = '.... | |
c_v_combined_propagated,
fill_value="extrapolate"
)(_np.concatenate((v_load, v_wash), axis=0))
c_combined_propagated[c_combined_propagated < 0] = 0
c_unbound_propagated = c_combined_propagated[:, :v_load.size]
c_wash_desorbed_propagated = c_combined_propagated[:, v_load.size:]
return c_unbound_propagated, c_wash_... | |
['client+industry', 'client+business'],
'client_interview': ['client+interview'],
'client_meeting': ['client+meeting'],
'client_mission': ['client+mission', 'client_business+mission'],
'client_relationship': ['client+relationship'],
'client_request': ['client+request'],
'client_requirement': ['client+requirement'... | |
= m.group(1)
val = m.group(2)
val = val.rstrip()
# shlex isn't up to the task of parsing shell. Whatever,
# we can only parse shell to a certain degree and this is
# good enough for now.
try:
c = list(cls._shlex.split(val, comments=True, posix=True))
except:
return None
if len(c) != 1:
return None
return (... | |
result.returncode != 0:
print( "[ERROR]: unable to export a dts" )
print( "\n%s" % textwrap.indent(result.stderr.decode(), ' ') )
return result
@staticmethod
def dt_to_fdt( dtb, rmode='rb' ):
"""takes a dtb and returns a flattened device tree object
Args:
dtb: a compiled device tree
rmode (string,optional):... | |
from __future__ import print_function
import argparse
import datetime
import dateutil.parser
import decimal
import facepy
import json
import logging
import numpy
import pandas
import pickle
import pdb
import pprint
import sys
import time
import traceback
import weakref
import matplotlib.pyplot as plt
logging.basicC... | |
<reponame>captain-c00keys/pyramid-stocks
import os
import unittest
from pyramid import testing
from pyramid.tests.test_config import IDummy
from pyramid.tests.test_config import dummy_view
from pyramid.compat import (
im_func,
text_,
)
from pyramid.exceptions import ConfigurationError
from pyramid.exceptions impo... | |
# See LICENSE.incore for details
import ruamel
from ruamel.yaml import YAML
import riscv_isac.parsers as helpers
import riscv_isac.utils as utils
from riscv_isac.constants import *
from riscv_isac.log import logger
from collections import Counter
import sys
from riscv_isac.utils import yaml
from riscv_isac.cgf_normali... | |
True
return False
@staticmethod
def _meta_info():
from ydk.models.cisco_ios_xr._meta import _Cisco_IOS_XR_l2vpn_cfg as meta
return meta._meta_table['L2Vpn.Database.FlexibleXconnectServiceTable.VlanUnawareFlexibleXconnectServices.VlanUnawareFlexibleXconnectService.VlanUnawareFxcAttachmentCircuits']['meta_info']
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.