input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<filename>src/framework/hls_tools.py
# ////////////////////////////////////////////////////////////////////////////////////////
# Copyright (c) by
# Company: IDEA LAB, The University of Texas at Dallas
# Author : <NAME>
#
# Originally Create Date: Mar-5, 2020
# Project Name : DNN_Framework
# Tool Versions : Python +3
#... | |
# Copyright 2019 UCLA Networked & Embedded Systems Laboratory (Author: <NAME>)
# 2020 Sogang University Auditory Intelligence Laboratory (Author: <NAME>)
#
# MIT License
import os
import sys
import argparse
import librosa
import data_utils
import numpy as np
import torch
import torch.nn.functional as F
from torch.ut... | |
<filename>line/f_CallService.py
#
# Autogenerated by Frugal Compiler (3.4.3)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from threading import Lock
from frugal.middleware import Method
from frugal.exceptions import TApplicationExceptionType
from frugal.exceptions import TTransportExceptio... | |
DataBreakpointInfoResponse:
dataId: Optional[str]
"""An identifier for the data on which a data breakpoint can be registered with the setDataBreakpoints request or null if no data breakpoint is available."""
description: str
"""UI string that describes on what data the breakpoint is set on or why a data breakpoint ... | |
the enabled status"""
enabled = {}
targets = {}
for target, filepath in self.each_target_file():
logg.info("target %s", filepath)
targets[target] = filepath
enabled[target] = "static"
for unit in _all_common_targets:
targets[unit] = None
enabled[unit] = "static"
if unit in _all_common_enabled:
enabled[unit] ... | |
<filename>tethysapp/app_store/original_code.py<gh_stars>1-10
import shutil
import yaml
import os
import git
from subprocess import (call, Popen, PIPE, STDOUT)
from argparse import Namespace
from conda.cli.python_api import run_command as conda_run, Commands
from django.core.exceptions import ObjectDoesNotExist
from te... | |
regression.
Quantile regression allows to estimate the percentiles
of the conditional distribution of the target.
"""
def __init__(self, n_classes, alpha=0.9):
super(QuantileLossFunction, self).__init__(n_classes)
self.alpha = alpha
self.percentile = alpha * 100.0
def init_estimator(self):
return QuantileEs... | |
networks.
Outputs:
-True if the network is loaded, false otherwise.
"""
return (username in self.networks) and (network_ID in self.networks[username])
def add_user_tab(self, username):
"""Add a new user entry inside of networks if not already in
Inputs:
-user : A string containing the name of the owner of t... | |
<filename>ndcube/tests/test_sequence_plotting.py
# -*- coding: utf-8 -*-
import pytest
import datetime
import numpy as np
import astropy.units as u
import matplotlib
from ndcube import NDCube, NDCubeSequence
from ndcube.utils.wcs import WCS
import ndcube.mixins.sequence_plotting
# Set matplotlib display for testing
... | |
import mmd_scripting.core.nuthouse01_core as core
import mmd_scripting.core.nuthouse01_pmx_parser as pmxlib
import mmd_scripting.core.nuthouse01_pmx_struct as pmxstruct
_SCRIPT_VERSION = "Script version: Nuthouse01 - v0.6.01 - 7/12/2021"
# This code is free to use and re-distribute, but I cannot be held responsible fo... | |
automatically converts integer inputs to float, while TensorFlow's
# reduce_mean does not. For integer inputs, we emulate TensorFlow's behavior
# using np.sum and truncating division.
np_sum = np.sum(x, axis=reduction_axes, keepdims=keepdims)
if np.issubdtype(x.dtype, np.integer):
return np_sum // count
return np... | |
from __future__ import division
import torch
import torch.nn.functional as F
import numpy as np
def xywh2xyxy(x):
# Convert bounding box format from [x, y, w, h] to [x1, y1, x2, y2]
y = torch.zeros_like(x) if isinstance(x, torch.Tensor) else np.zeros_like(x)
y[:, 0] = x[:, 0] - x[:, 2] / 2
y[:, 1] = x[:, 1] - x[... | |
import tkinter as tk #possibly nessesary unsure
import cv2
import numpy as np
import matplotlib.pyplot as plt
import time
import sys
import os
import re
SCALEDOWNFACTOR = 0.2 #This is a magic number but what can ya do. I dont have a good way of getting image resolution.
SCALEUPFACTOR = 2.0
GAIN = 13.2
DIST... | |
<reponame>ddr95070/RMIsaac
'''
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
NVIDIA CORPORATION and its licensors retain all intellectual property
and proprietary rights in and to this software, related documentation
and any modifications thereto. Any use, reproduction, disclosure or
distribution of thi... | |
def removeExtraMsg(self):
self.ui.statusbar.removeWidget(self.extraMsgWidget)
self.extraMsgWidget=None
def setMainPageIndex(self,i):
"""open previous page if i == None"""
i = self.prevMainPageindex if i is None else i
self.prevMainPageindex = self.ui.mainPage.currentIndex()
if i == 0:
self.ui.startPageBtn.setC... | |
#!/usr/bin/env python
# This script is deprecated, please use ./xconfig_to_configs.py
# tdnn or RNN with 'jesus layer'
# inputs to jesus layer:
# - for each spliced version of the previous layer the output (of dim --jesus-forward-output-dim)
# outputs of jesus layer:
# for all layers:
# --jesus-forward-output-dim
... | |
<gh_stars>0
import os
from montepython.likelihood_class import Likelihood
import math as m
import statistics as s
from scipy import stats
import scipy.linalg as la
import numpy as np
from scipy.integrate import quad
import time
def lin_reg(x,y):
#length of data set
n = len(x)
#summing independent variable
x_sum... | |
<gh_stars>0
import copy
import os
import sys
import warnings
from time import gmtime, strftime
import numpy as np
import pandas as pd
pd.options.mode.chained_assignment = None
from pandas.api.types import (
is_bool_dtype,
is_categorical_dtype,
is_datetime64_any_dtype,
is_numeric_dtype,
is_object_dtype,
is_strin... | |
{'k1': 'Libya', 'k2': '?', 'k3': '?', 'k4': '?', 'k5': '?', 'k6': 'No'},
{'k1': 'Madagascar', 'k2': '?', 'k3': '?', 'k4': '?', 'k5': '?', 'k6': 'No'},
{'k1': 'Malawi', 'k2': '?', 'k3': '?', 'k4': 'No', 'k5': 'Yes', 'k6': 'No'},
{'k1': 'Mali', 'k2': '?', 'k3': '?', 'k4': '?', 'k5': '?', 'k6': 'No'},
{'k1': 'Morocco'... | |
= Var(within=Reals,bounds=(-1,1),initialize=0.001)
m.x1237 = Var(within=Reals,bounds=(-1,1),initialize=0.001)
m.x1238 = Var(within=Reals,bounds=(-1,1),initialize=0.001)
m.x1239 = Var(within=Reals,bounds=(-1,1),initialize=0.001)
m.x1240 = Var(within=Reals,bounds=(-1,1),initialize=0.001)
m.x1241 = Var(within=Reals,bounds... | |
= 'in-use'
db.volume_create(self.context, self.volume_attrs)
# start test
self.assertRaises(exception.ImageNotFound,
self.volume.copy_volume_to_image,
self.context,
self.volume_id,
self.image_meta)
volume = db.volume_get(self.context, self.volume_id)
self.assertEqual('available', volume['status'])
def test... | |
import json
import time
import requests
import re
from flask import Flask, render_template, jsonify
from pyecharts.charts import Map, Timeline,Kline,Line,Bar,WordCloud
from pyecharts import options as opts
from pyecharts.globals import SymbolType
app = Flask(__name__)
#字典,受限于谷歌调用限制
cn_to_en = {'安哥拉': 'Angola', '阿富汗':... | |
<filename>swagger_client/api/corporation_api.py
# coding: utf-8
"""
EVE Swagger Interface
An OpenAPI for EVE Online # noqa: E501
OpenAPI spec version: 0.8.0
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and pyth... | |
# Copyright 2015 The Tornado 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 law or agreed to in writi... | |
"""Assortment of handy functions."""
import inspect
import numpy as np
from six.moves import map, range, zip
from functools import partial
from itertools import tee
from inspect import isgenerator
class Bunch(dict):
"""
Container object for datasets.
Dictionary-like object that exposes its keys as attributes.
... | |
= name
self._home = home
self._owned = owned
self._transaction = home._transaction
self._newObjectResources = {}
self._cachedObjectResources = {}
self._removedObjectResources = set()
self._index = None # Derived classes need to set this
self._invites = None # Derived classes need to set this
self._renamedName ... | |
'''
Helper functions to read through raw data for each corpus.
Each is a generator that yields a single dataset and metadata in the form:
{
'df'
'locator',
'dataset_id'
}
'''
import os
from os import listdir
from os.path import join
from collections import OrderedDict
import argparse
import gzip
import json
import... | |
__author__ = "<NAME>"
__email__ = "<EMAIL>"
import pymel.core as pm
import mgear.rigbits.sdk_io as sdk_io
import mgear.core.pickWalk as pickWalk
SDK_ANIMCURVES_TYPE = ("animCurveUA", "animCurveUL", "animCurveUU")
# reload(sdk_io)
# ================================================= #
# MATH
# =======================... | |
# -*- coding: utf-8 -*-
"""
checkout
~~~~~~~~~~~~
Python wrapper for the Checkout Finland API.
Copyright (c) 2014 by <NAME>.
Copyright (c) 2013 by <NAME>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following condition... | |
# This file is part of parallel-ssh.
# Copyright (C) 2014-2018 <NAME> and contributors.
# 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 Foundation, version 2.1.
# This library is distributed in th... | |
are loaded into the last page of this cache
# area.
class overlay_data:
_instance = None
# Holds information about all the groups and multi-groups.
class _overlay_group_data:
def __init__ (self, groups, multi_groups, multi_group_table):
self._groups = groups
self._multi_groups = multi_groups
self._multi_group_t... | |
: {0}_ .'.format(self.codex.de_codex))
# paginae.extend(self.imprimere_in_datapackage())
# return self.imprimere_in_datapackage()
return paginae
def imprimere_res_methodi_ex_dictionariorum_corde(self, item):
if item and 'meta' in item and \
'methodi_ex_dictionariorum_corde' in item['meta'] and \
'mul-Zyyy' in... | |
if nodes[j]["n1"] >= p1.numnodes: # ring node
w = nodes[j]["n1"] - p1.numnodes
s = nodes[j]["n2"] - p2.numnodes
idxj1 = members1[w]
idxj2 = members2[s]
else:
w = nodes[j]["n1"]
s = nodes[j]["n2"]
idxj1 = [w]
idxj2 = [s]
if len(set(idxi1) & set(idxj1)) > 0 or \
len(set(idxi2) & set(idxj2)) > 0:
# do not co... | |
#standard
import argparse
import datetime
import os
os.environ['TMPDIR'] = '/var/tmp'
from operator import itemgetter, attrgetter
activate_this = '/gluster/gluster1/bsm_data_emulator/bsmde_python/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))
import pandas as pd
#local
from GTFileRead... | |
in my coordinate system
return pfnnPosInModelSpace
################################################################### Main starts here!!!!!
P = np.array([[0, -1, 0], [0, 0, -1], [1, 0, 0]])
init_names= {-1: "training", 0: "training", 1: "On pedestrian", 3: "On pavement", 2: "By car", 4: "Random",5: "car_env", 6: "... | |
continue
if role == rs[0]:
if count == 1:
vb = "is"
else:
vb = "are"
if count != 1:
if count == 0 and len(var.ORIGINAL_ROLES[role]) == 0:
continue
message.append("\u0002{0}\u0002 {1}".format(count if count else "\u0002no\u0002", plural(role)))
else:
message.append("\u0002{0}\u0002 {1}".format(count, role))... | |
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from .adc import _adc
from .dac import _quantize_dac
from .w2g import w2g
from .crossbarlayer import CrossbarLayer
quantize_input = _quantize_dac.apply
# quantize_weight = _quantize_dac.apply
adc = _adc.apply
class crxb_Conv2d(nn.Conv2d... | |
circuits, targets)
def test_sdg_gate_nondeterministic_waltz_basis_gates(self):
"""Test sdg-gate gate circuits compiling to u1,u2,u3,cx"""
circuits = ref_1q_clifford.sdg_gate_circuits_nondeterministic(
final_measure=False)
targets = ref_1q_clifford.sdg_gate_statevector_nondeterministic()
job = execute(circuits,
... | |
# Licensed under an MIT open source license - see LICENSE
from __future__ import print_function, absolute_import, division
import numpy as np
from astropy.io import fits
from astropy.convolution import convolve
import astropy.units as u
from scipy import ndimage as nd
import itertools as it
import operator as op
impor... | |
valDef, setter=True)
# Attribute 'MinVoltageWarning' GUID 10049 Data type TYPE_UNSIGNED_NUMBER
# Minimum voltage warning level
def getMinVoltageWarning(self, moduleID):
guid = 10049
portnumber = 0
length = 1
valDef = self._guidTable[guid]
data = self._parent.client.getAttribute(
moduleID, guid, portnumber, le... | |
"Playback speed\n",
"\n",
"Unmute\n",
"\n",
"Turn fullscreen on\n",
"likeloveinsightful\n",
"9,044\n",
"<NAME> and 9,043 others\n",
"257 comments\n",
"\n",
"Like\n",
"\n",
"Comment\n",
"\n",
"Share\n",
"\n",
"Send\n",
"Feed post number 1\n",
"Larange’s profile photo\n",
"<NAME> likes this\n",
"\n",
... | |
import discord
from discord.ext import commands
from discord.ext.commands.cooldowns import BucketType
from discord.ext.commands import bot, has_permissions, CheckFailure
from discord import Spotify
import asyncio
import colorsys
import random
import platform
from discord import Game, Embed, Color, Status, Chan... | |
= cap.read()
padding_size = 0
resized_width = 1360
video_size = (resized_width, int(img_bgr.shape[0] * resized_width // img_bgr.shape[1]))
output_size = (resized_width, int(img_bgr.shape[0] * resized_width // img_bgr.shape[1] + padding_size * 2))
fourcc = cv2.VideoWriter_fourcc('m', 'p', '4', 'v')
writer = cv2.V... | |
exp)
rng = date_range('1/1/1990', periods=5)
iseries = Series(np.arange(5), rng) + 1
iseries.ix[4] = np.nan
exp = iseries / 4.0
iranks = iseries.rank(pct=True)
assert_series_equal(iranks, exp)
iseries = Series([1e-50, 1e-100, 1e-20, 1e-2, 1e-20 + 1e-30, 1e-1])
exp = Series([2, 1, 3, 5, 4, 6.0])
iranks = iser... | |
<reponame>sherry0429/dash<filename>tests/integration/devtools/test_callback_validation.py
import flask
import pytest
import dash_core_components as dcc
import dash_html_components as html
from dash import Dash
from dash.dependencies import Input, Output, State, MATCH, ALL, ALLSMALLER
debugging = dict(
debug=True, us... | |
passive (priority 0) replica set
members known to this connection. This does not include
hidden or slaveDelay members, or arbiters.
"""
return self.__hosts
@property
def primary(self):
"""The current primary of the replica set.
Returns None if there is no primary.
"""
return self.__writer
@property
def s... | |
<reponame>useEvil/husky-hustle-2013
import os
import csv
import pytz
import math
import base64
import urllib
import re as regexp
import datetime as date
import husky.bitly as bitly
import gdata.media as media
import gdata.photos.service as gdata
import gdata.calendar.client as cdata
from django.db import models
from d... | |
min(self.min_dn_open_price,x.openPrice)
total_price += x.openPrice*x.volume
total_volume += x.volume
if total_volume > 0:
self.avg_dn_open_price = total_price/total_volume
def count_avg_open_price(self, grid_list):
"""计算平均开仓价"""
total_price = EMPTY_FLOAT
total_volume = EMPTY_INT
avg_price = EMPTY_FLOAT
for... | |
median filtere
path_to_filter : full path to the boxcar filter binary file, including
the file name.
Returns
-------
str
full path of the contatenated filename.
"""
# construct stime and etime for one-day worthy of data
stime = ctr_date
etime = ctr_date + dt.timedelta(days=1)
# Cteate a tmpdir folder... | |
<gh_stars>0
# -*- coding: utf-8 -*-
"""
datetime enumerations module.
"""
from pyrin.core.enumerations import CoreEnum
class TimezoneEnum(CoreEnum):
"""
timezone enum.
"""
AFRICA_ABIDJAN = 'Africa/Abidjan'
AFRICA_ACCRA = 'Africa/Accra'
AFRICA_ADDIS_ABABA = 'Africa/Addis_Ababa'
AFRICA_ALGIERS = 'Africa/Algier... | |
<gh_stars>10-100
#!/usr/bin/env python
#
# $Id: kfssetup.py 36 2007-11-12 02:43:36Z sriramsrao $
#
# Copyright 2007 Kosmix Corp.
#
# This file is part of Kosmos File System (KFS).
#
# Licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You... | |
to a string:
setattr(f, x.name, str(arg[x.name]))
elif isinstance(x.type(), ZwiBase):
# we expect that f.<value> here is a suitable dict
f0 = getattr(f, x.name)
if f0 is not None and x.name in arg:
debug(2, f'dict: {f0=} {arg[x.name]=}')
f0.traverse(ZwiBase.from_dict, arg[x.name])
else:
raise SystemExit('oops'... | |
= variant_ids[mask]
tss_distance = tss_distance[mask]
if interaction_df is not None:
genotypes_t, mask_t = filter_maf_interaction(genotypes_t, interaction_mask_t=interaction_mask_t,
maf_threshold_interaction=maf_threshold_interaction)
mask = mask_t.cpu().numpy()
variant_ids = variant_ids[mask]
tss_distance = ts... | |
and obj.has_multi_state_intersection(
self.multi_state_available
):
multi_state_allowed = True
return state_allowed and multi_state_allowed
class SubAction(ADCMModel):
action = models.ForeignKey(Action, on_delete=models.CASCADE)
name = models.CharField(max_length=160)
display_name = models.CharField(max_lengt... | |
import matplotlib as mpl
from matplotlib import cm, colors
import matplotlib.pyplot as plt
from mpl_toolkits.axes_grid1 import make_axes_locatable
import numpy as np
import argparse
import csv
import sys
from scipy.sparse import csc_matrix, dia_matrix, linalg as sla
from scipy.stats import norm
from smoothfdr.smoothed_... | |
= ''
acc_txt = '{:.2f}%'.format(float(acc))
score_txt = '{:,}'.format(int(plays[i]['score']))
if var_attr == 'max_combo':
var_txt = max_combo_txt
elif var_attr == 'score':
var_txt = score_txt
else:
var_txt = acc_txt
# other components
rank_txt = '{}'.format(self.RANK_EMOTES[plays[i]['rank']])
misses_txt = ... | |
#!/usr/bin/python
# ========================================================
# Python script for PiBot-A: maze solver
# Version 1.0 - by <NAME> - www.retas.de
# ========================================================
# ----------------- TERMINOLOGY OF NODES -----------------
#
# --|-- crossing, +
#
# --| T-junction, ... | |
import os
import shutil
import random
import math
import time
import argparse
import yaml
from collections import OrderedDict
import sys
# for import parent utils
sys.path.append('../')
import utils
import modules
import datasets
import models
import numpy as np
import torch
import torch.nn as nn
import torch.optim... | |
regex = r'^[A-Za-z0-9 !$&\'*\-,.?^_`{}~#+%]*$'
return len(name) <= 64 and re.match(regex, name)
def get_uwhr_person(self, eid, source='uwhr'):
"""
Returns an irws.UWhrPerson object for the given eid.
If the person is not an employee, returns None.
If the netid isn't found, throws IRWSNotFound.
If there is an er... | |
then INFO
>>> with logInfo() :
>>> ...do something...
"""
return logLevel ( logging.INFO - 1 )
# =============================================================================
# Temporarily enable/disable all loggers with level less then WARNING
# @code
# with logInfo() :
# ...do something...
# @endcode
def logWa... | |
int(x) * int(y), p)
cnt += remain // int_p
else:
break
print('[72]: ', cnt)
return
'''
Problem 73
Consider the fraction, n/d, where n and d are positive integers. If n<d and HCF(n,d)=1, it is called a reduced proper fraction.
If we list the set of reduced proper fractions for d ≤ 8 in ascending order of size, we... | |
if new_image in all_images:
return create_new_image()
else:
image_count = len(all_images)
genesis_count = len(genesis_arr)
if image_count < TOTAL_IMAGES / 10 and image_count % 7 == 0 and genesis_count < 90:
new_image['War_paint'] = create_genesis(image_count)
if TOTAL_IMAGES / 10 <= image_count and image_count ... | |
# encoding: utf-8
"""
protocol.py
Created by <NAME> on 2009-08-25.
Copyright (c) 2009-2012 Exa Networks. All rights reserved.
Modified by Orange - 2014
"""
#import os
#import copy
import time
import socket
from struct import unpack
from bagpipe.exabgp.rib.table import Table
from bagpipe.exabgp.rib.delta import Delta... | |
= re_.compile(r'({.*})?(.*)')
String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')
#
# Support/utility functions.
#
def showIndent(outfile, level, pretty_print=True):
if pretty_print:
for idx in range(level):
outfile.write(' ')
def quote_xml(inStr):
if not inStr:
... | |
# Copyright 2012-2016 The Meson development 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 agreed to... | |
"""
Copyright (c) 2020, 2021 Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
import unittest
import os
import shutil
import tempfile
from java.util.logging import Level
from oracle.weblogic.deploy.compare import CompareException
f... | |
<reponame>gmargaryan/hardy<filename>scripts/Cisco_IOS_15_Benchmark_scripts.py<gh_stars>0
import re
import yaml
from netmiko import Netmiko
### Debug output ###
def debug_output(command, pattern, output):
print ("\ncommand:\n" + command)
print ("\npattern:\n" + pattern)
print ("\noutput:\n" + output + "\n")
### M... | |
"""Quantum mechanical angular momemtum."""
from sympy import (
Add, binomial, cos, diff, exp, Expr, factorial, I, Integer, Matrix, Mul, N, pi,
Rational, S, sin, simplify, sqrt, Sum, Symbol, symbols, sympify
)
from sympy.matrices.matrices import zeros
from sympy.printing.pretty.stringpict import prettyForm, stringPic... | |
# Copyright (c) 2009-2012 <NAME>. See LICENSE for details.
import sys
from gevent.hub import greenlet, getcurrent, get_hub, GreenletExit, Waiter, PY3, iwait, wait
from gevent.timeout import Timeout
from collections import deque
__all__ = ['Greenlet',
'joinall',
'killall']
class SpawnedLink(object):
"""A wrapper... | |
# coding: utf-8
import plfit
import os
from pylab import *
if not os.path.isdir('figures'):
os.mkdir('figures')
blackouts = np.loadtxt('blackouts.txt', dtype='int')
cities = np.loadtxt('cities.txt', dtype='int')
earthquakes = np.loadtxt('earthquakes.txt')
melville = np.loadtxt('melville.txt')
solarflares = np.loadtxt... | |
"""Tokenization utilties for exrepssions."""
import re
from typing import Dict, List, Tuple
import torch
from selfies import decoder, split_selfies
from transformers import BertTokenizer, XLNetTokenizer
SMILES_TOKENIZER_PATTERN = r"(\%\([0-9]{3}\)|\[[^\]]+]|Br?|Cl?|N|O|S|P|F|I|b|c|n|o|s|p|\||\(|\)|\.|=|#|-|\+|\\|\/|:... | |
import torch
import torch.nn as nn
import torch.nn.functional as F
from dataset.config import widerface_640 as cfg
# from layers.DCNv2 import DCN
RELU_FIRST = True
OPS = {
"none": lambda C, stride, affine: Zero(stride),
"avg_pool_3x3": lambda C, stride, affine: nn.AvgPool2d(3, stride=stride, padding=1, count_inclu... | |
<reponame>Deltares/geolib<gh_stars>1-10
import os
import pathlib
import shutil
from pathlib import Path
import pytest
from teamcity import is_running_under_teamcity
from geolib.geometry.one import Point
from geolib.models import BaseModel, BaseModelStructure
from geolib.models.dstability import DStabilityModel
from g... | |
ranks of each process.")
group.add('--world_size', '-world_size', default=1, type=int,
help="total number of distributed processes.")
group.add('--gpu_backend', '-gpu_backend',
default="nccl", type=str,
help="Type of torch distributed backend")
group.add('--gpu_verbose_level', '-gpu_verbose_level', default=0, typ... | |
<filename>exopy_qcircuits/instruments/drivers/ZI/UHFLI.py
# -*- coding: utf-8 -*-
"""This module defines drivers for UHFLI using Zhinst Library.
:Contains:
UHFLI
Python package zhinst from Zurick Instruments need to be install
"""
from __future__ import (division, unicode_literals, print_function,
absolute_impor... | |
" to method portals_id_image_folders_rel_fk_delete" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'id' is set
if ('id' not in params) or (params['id'] is None):
raise ValueError("Missing the required parameter `id` when calling `portals_id_image_folders_rel_fk_delete`")
# verify ... | |
import code # For development: code.interact(local = dict(globals(), **locals()))
import numpy as np
import xml.etree.ElementTree as et
from scipy.io import netcdf
import matplotlib.dates as mdates
from datetime import datetime, timedelta
import matplotlib.pyplot as plt
import math
# =================================... | |
x2, y1: y2] = 255
return
'''
# for the full equation - m and the whole thing
# USED in "get rect side scales"
def math_m(alpha,beta):
m = np.tan(0.5*(alpha-beta)) / np.tan(0.5*(alpha+beta))
return m
def math_scale_a(d,m):
a = d*((1+m) / (1-m))
#keep in mind this is HALF a scale. This is also for V... | |
Prop._class_property_relation:
storids = [ancestor.storid for ancestor in entity.ancestors()]
prop_storids = []
values = set()
for P in Props:
if issubclass_python(P, TransitiveProperty):
if P._inverse_storid: prop_storids.append((P.storid, P._inverse_storid))
else: prop_storids.append((P.storid, None))
else:... | |
def get_remote_client(self, server_or_ip, username=None, private_key=None):
if isinstance(server_or_ip, six.string_types):
ip = server_or_ip
else:
network_name_for_ssh = CONF.compute.network_for_ssh
ip = server_or_ip.networks[network_name_for_ssh][0]
if username is None:
username = CONF.scenario.ssh_user
if pri... | |
= ir*sigmax
this_sigmay = ir*sigmay
# print iz, ir, a, b
tmpG = (1/(2.*this_sigmax*this_sigmay))*np.exp(-0.5*(((x-x0)**2)/this_sigmax**2+((y-y0)**2)/this_sigmay**2))
tmpdens[:,:,ii] = tmpG*scale_factor/tmpG.max()
# print tmpG.shape, tmpG.max()
# exit()
ii=ii+1
iz=iz+1
if verbose==True:
print x
print x.shape, ... | |
<filename>src/bot.py
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.messages.flat.QuickChatSelection import QuickChatSelection
from rlbot.utils.structures.game_data_struct import GameTickPacket
from util.ball_prediction_analysis import find_slice_at_time, find_matching_slice
from util.... | |
self.vz = vz
self.xacc = xacc
self.yacc = yacc
self.zacc = zacc
def pack(self, mav):
return MAVLink_message.pack(self, mav, 183, struct.pack('<Qffffffiiihhhhhh', self.time_usec, self.roll, self.pitch, self.yaw, self.rollspeed, self.pitchspeed, self.yawspeed, self.lat, self.lon, self.alt, self.vx, self.vy, self.vz... | |
<filename>generated_python_code/ball_collector/ballcollector/scripts/subsystem_cs.py
#!/usr/bin/env python
'''
Copyright (c) 2019, Robot Control and Pattern Recognition Group, Warsaw University of Technology
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are pe... | |
None: # 窓面積が空欄であれば、窓寸法から面積を計算。
inputdata["WindowConfigure"][window_id]["windowArea"] = \
inputdata["WindowConfigure"][window_id]["windowWidth"] * inputdata["WindowConfigure"][window_id]["windowHeight"]
# 外壁面積の算出
for room_zone_name in inputdata["EnvelopeSet"]:
for (wall_id, wall_configure) in enumerate( inputdat... | |
counts: dict - lookup table for SVDM
min_max: pd:DataFrame - contains min/max values per numeric feature
classes: list of str - class labels in the dataset.
examples_covered_by_rule: dict - which rule covers which examples, i.e. {rule ri: set(example ei, example ej)}
label_type: str - consider only examples of the ... | |
,
u'㓲' : [u'p'] ,
u'䩹' : [u'e'] ,
u'腿' : [u't'] ,
u'邋' : [u'l'] ,
u'漊' : [u'l'] ,
u'厍' : [u's'] ,
u'抗' : [u'k'] ,
u'萘' : [u'n'] ,
u'䜚' : [u't'] ,
u'鰨' : [u't', u'd'] ,
u'弪' : [u'j'] ,
u'辵' : [u'c'] ,
u'渴' : [u'h', u'k', u'j'] ,
u'劷' : [u'y'] ,
u'㴾' : [u'b'] ,
u'懁' : [u'h', u'x'] ,
u'荂' : [u'k'] ,
u'䙄' : [u'q', u'z'] ,
... | |
Mikrotik product; for future use)
elif "tbps" in rate_string:
# Yes
# Then speed is saved in mpbs
speed = int(
float(rate_string.split("tbps")[0]) * 1000000
)
# Display info message
log.info(
f"get_interfaces: get_speed: rate found: {rate_string}, rate: {speed} mbps"
)
# " full-duplex: yes" field found in... | |
#!/usr/bin/python
import os, sys
import json
import numpy as np
import re
import copy
"""
Name: <NAME>
ID: 16342613
Github:
I have included manual implementations of 5 different problems. The copy library was used to create a deep copy of the
input grid.
"""
### YOUR CODE HERE: write at least three functions which... | |
function at a given address with a given type.
:param int addr: Address to get tags at
:param TagType tag_type: TagType object to match in searching
:param Architecture arch: Architecture for the block in which the Tags are located (optional)
:return: A list of data Tags
:rtype: list(Tag)
"""
if arch is ... | |
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
#
# Copyright 2022 The NiPreps Developers <<EMAIL>>
#
# 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 ... | |
#TODO: Consider adding more checks whether entities exist.
class Geometry:
'''
Instances of GeoData can hold geometric data and be passed to
GmshMesher in pycalfem_Mesh to mesh the geometry.
'''
def __init__(self):
self.points = {} #dict of [[x, y, z], elSize, marker]
self.curves = {} #dict of [curvTypestring... | |
a string value for input uint64_t
sh_funcs.append("string string_convert_helper(const uint64_t toString, const string prefix)\n{")
sh_funcs.append(" using namespace StreamControl;")
sh_funcs.append(" stringstream ss;")
sh_funcs.append(' ss << toString;')
sh_funcs.append(' string final_str = prefix + ss.str();')
s... | |
# -*- coding: utf-8 -*-
"""
irradiance.py from pvlib
========================
Stripped down, vendorized version from:
https://github.com/pvlib/pvlib-python/
Calculate the solar position using the NREL SPA algorithm either using
numpy arrays or compiling the code to machine language with numba.
The rational for not in... | |
"""
Get arguments corresponding to parser.
"""
return parser.parse_args()
def getSourceListArgs(parser, wildcards = True):
"""
Create a list of tuples that contain source ROOT file names
and lists of path in these files as well as the original arguments
"""
args = getArgs(parser)
inputFiles = []
try:
inputF... | |
<filename>Sprint Week/Main.py
# Filename Main.py
# The Sprint Project Company Main Menu
# Authors:<NAME>, <NAME>, <NAME>.
# Date November 17, 2021
# Imports
import time
import datetime
# Functions
def As_Dollars_Pad(Number):
"""Format Dollars amounts to strings & Pad Right 10 Spaces"""
Number_Display = f"${Number:,... | |
# Copyright 2015 Cloudbase Solutions Srl
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | |
<filename>examples/run_experiments.py
import argparse
import collections
import itertools
import glob
import json
import logging
import os
import shlex
import subprocess
import natsort
import numpy as np
import yaml
logger = logging.getLogger(__name__)
TrainedModel = collections.namedtuple('TrainedModel', [
'base_... | |
SimTK::Array_< int >::size_type n, int const & fillValue)
Parameters
----------
n: SimTK::Array_< int >::size_type
fillValue: int const &
"""
return _simbody.SimTKArrayInt_assign(self, n, fillValue)
def fill(self, fillValue):
"""
fill(SimTKArrayInt self, int const & fillValue)
Parameters
----------
fil... | |
increase lineN when the last line doesn't end with '\n'
if lineN < len(lines)-1 or line[-1] == '\n' :
lineN += 1
else:
raise ValueError("Unknown lineBreaking option ({}) is"
"specified.".format(lineBreaking))
# convert the vertices to stimulus units
self._rawVerts = vertices / self._pixelScaling
# thisW = cur... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.