input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
for sum_ambiguous_key in sum_ambiguous_keys: # for different comparison types
sum_ambiguous = results[sum_ambiguous_key]
for sum_ambiguous_type, val in sum_ambiguous.items(): # for different features
logger_utils.log_metric("{}".format(sum_ambiguous_type), val)
# 3) summaries
# -----------------------------------... | |
"""
Tests for Image Management Service (IMS) CLI subcommand (`cray ims`)
and options.
MIT License
(C) Copyright [2020] Hewlett Packard Enterprise Development LP
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal i... | |
self.radio_mac,
addr2 = client.mac,
addr3 = str2mac(pkt[:6]),
#SC = self.dot11_seq << 4
)/
Dot11QoS()/
LLC(dsap = 170, ssap = 170, ctrl = 3)/
SNAP()[0])
AP._scapy_cache_static['wlan_wrapping_1'] = p1[:20]
AP._scapy_cache_static['wlan_wrapping_2'] = p1[38:-2]
AP._scapy_cache_static['wlan_wrapping'] = True
p ... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""jobmanager module
<NAME> 2014
This module provides an easy way to implement distributed computing
based on the python class SyncManager for remote communication
and the python module multiprocessing for local parallelism.
class SIG_handler_Loop
The class Loop provid... | |
= Constraint(expr= - 8*m.b263 + m.x1544 <= 0)
m.c4685 = Constraint(expr= - 8*m.b264 + m.x1545 <= 0)
m.c4686 = Constraint(expr= - 8*m.b265 + m.x1546 <= 0)
m.c4687 = Constraint(expr= - 8*m.b266 + m.x1547 <= 0)
m.c4688 = Constraint(expr= - 8*m.b267 + m.x1548 <= 0)
m.c4689 = Constraint(expr= - 8*m.b268 + m.x1549 <= 0)... | |
<filename>vimms/BOMAS.py
import time
from mass_spec_utils.data_import.mzmine import load_picked_boxes, map_boxes_to_scans
from mass_spec_utils.data_import.mzml import MZMLFile
from vimms.Agent import TopNDEWAgent
from vimms.Box import *
from vimms.Common import *
from vimms.Controller import TopN_SmartRoiController, ... | |
"""SmartTimer
Classes:
:class:`SmartTimer`
Note:
Internal operations may affect the time measurements by a factor of
milliseconds. In a future release, this noise will be corrected.
"""
__all__ = [
'TimerStat',
'SmartTimer'
]
import os
import re
import numpy
import cProfile
import time as std_time
from .tim... | |
of the words of the context/question and the
# number of words in the context/question, and call a Multi-Timescale LSTM
# further reference on Multi-Timescale LSTM can be found in Learned in Translation: Contextualized Word Vectors
# at https://arxiv.org/pdf/1708.00107.pdf
# We feed GloVe(cw_idxs) and GloVe(qw_idxs... | |
#region Imports
# HTTP requests and url parsing
import requests
import aiohttp
import webbrowser
import http.server
from urllib.parse import urlparse, parse_qs
# Data formats
import json
import yaml
from helpers.ArgHandler import Get_Args
# Logging
from logger.AppLogger import build_logger
# Build the logger object... | |
<reponame>JosieHong/VOS_with_Seg-Siam
'''
@Author: JosieHong
@Date: 2020-04-26 12:40:11
@LastEditAuthor: JosieHong
LastEditTime: 2021-01-12 22:52:02
'''
import os.path as osp
import warnings
import mmcv
import numpy as np
from imagecorruptions import corrupt
from mmcv.parallel import DataContainer as DC
import torch
... | |
import os
import pprint
import re
import click
import yaml
from flask.cli import FlaskGroup
from networkx import draw, has_path
from g2p import make_g2p
from g2p._version import VERSION
from g2p.api import update_docs
from g2p.app import APP, network_to_echart
from g2p.exceptions import MappingMissing
from g2p.log im... | |
import logging
import math
from django.core.exceptions import PermissionDenied
from django.db import IntegrityError, transaction
from django.test import Client
from django.utils import timezone
from django.conf import settings
from rest_framework.parsers import JSONParser
from io import BytesIO
import json
from amb... | |
<reponame>dpeters1/YakFrequency
# -*- coding: utf-8 -*-
"""Class for a user on Yik Yak"""
from yaklient import helper
from yaklient import settings
from yaklient.api import notifyapi, parseapi, yikyakapi
from yaklient.objects.comment import Comment
from yaklient.objects.location import Location
from yaklient.objects.... | |
the component
comment : str; default=''
a comment for the card
"""
aecomp = AECOMP(name, list_type, lists, comment=comment)
self._add_aecomp_object(aecomp)
return aecomp
def add_aecompl(self, name: str, labels: List[str], comment: str='') -> AECOMPL:
"""
Creates an AECOMPL card
Parameters
----------
name... | |
]
:param ssh_auth_map: SSH authentication information mapped to host names. Useful for complex SSH Proxy cases.
:type ssh_auth_map: typing.Optional[typing.Union[typing.Dict[str, ssh_auth.SSHAuth], ssh_auth.SSHAuthMapping]]
:param keepalive: keepalive period
:type keepalive: typing.Union[int, bool]
:return: new ssh... | |
lane.
return None
if len(lanes) > 1:
# Multiple root lanes for a patron indicates a
# configuration problem, but we shouldn't make the patron
# pay the price -- just pick the first one.
logging.error(
"Multiple root lanes found for patron type %s.",
self.external_type
)
return lanes[0]
def work_is_age_appro... | |
# uncompyle6 version 3.7.4
# Python bytecode 3.5 (3350)
# Decompiled from: Python 3.8.5 (default, Jan 27 2021, 15:41:15)
# [GCC 9.3.0]
# Embedded file name: /home/docker/CSN/bin/gpu_ccsn.py
# Compiled at: 2021-03-31 16:15:26
# Size of source mod 2**32: 19699 bytes
"""
python version of csn algorithm
https://github.com... | |
<gh_stars>0
# -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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 ... | |
import configparser
c = configparser.ConfigParser()
c.read("production.ini")
config = {}
config['host'] = c['dboption']['chost']
config['port'] = int(c['dboption']['cport'])
config['user'] = c['dboption']['cuser']
config['pw'] = c['dboption']['cpw']
config['db'] = c['dboption']['cdb']
config['homepath'] = c['option'][... | |
return True
else:
return False
def export(
self,
outfile,
level,
namespaceprefix_="",
namespacedef_="",
name_="CmDomainQType",
pretty_print=True,
):
imported_ns_def_ = GenerateDSNamespaceDefs_.get("CmDomainQType")
if imported_ns_def_ is not None:
namespacedef_ = imported_ns_def_
if pretty_print:
eol_ =... | |
import numpy as np
import pygame as pg
import gym
from gym import spaces
class Ris(gym.Env):
NOP, LEFT, RIGHT, ROT = range(4)
def __init__(self, scale, width=8, height=16, piece_set='lettris'):
self.action_space = spaces.Discrete(4)
board = np.zeros((height, width))
self.width = width
self.height = height
self... | |
'a2', mingot],
['lista', 'noun', 'a2', mingot],
['literario', 'adjective', 'a2', mingot],
['localidad', 'noun', 'a2', mingot],
['lote', 'noun', 'a2', mingot],
['llegada', 'noun', 'a2', mingot],
['llorar', 'verb', 'a2', mingot],
['lluvia', 'noun', 'a2', mingot],
['madrina', 'noun', 'a2', mingot],
['maravilloso', 'adject... | |
<filename>Protheus_WebApp/Modules/SIGAFIN/FINA080TESTCASE.py<gh_stars>10-100
import unittest
import time
from tir import Webapp
from datetime import datetime
DateSystem = datetime.today().strftime('%d/%m/%Y')
class FINA080(unittest.TestCase):
@classmethod
def setUpClass(inst):
inst.oHelper = Webapp()
inst.oHelp... | |
__all__ = ["SemiDataSetInterface", "MedicalDatasetSemiInterface"]
from abc import abstractmethod
from copy import deepcopy as dcp
from itertools import repeat
from typing import Tuple, Callable, List, Type, Dict, Union
import numpy as np
from PIL import Image
from deepclustering.augment import SequentialWrapper
from ... | |
row the first element is the image of the background, the second row is the platform areas that player can jump on, the third element
#is the name of the music for that background.
backlist=[(image.load("Ninja Academy.png"),[Rect(234, 527, 277, 14),Rect(270, 415, 203, 16),Rect(305, 307, 142, 14),Rect(740, 306, 143, 1... | |
<reponame>An-dz/tilecutter
# TileCutter Project Module (Old version)
import logging, os, sys
import wx
import config
from tc import Paths
from environment import getenvvar
config = config.Config()
paths = Paths()
# project[view][season][frame][image][xdim][ydim][zdim]
# view=NSEW, 0,1,2,3 - array - controlled by glo... | |
title, description, configuration, dry_run=True):
"""Creates a new Scan process with the given configuration and returns
the new Scan model. All changes to the database will occur in an atomic transaction.
:param name: The identifying name of this Scan process
:type name: string
:param title: The human-readable ... | |
import cv2
import os
import sys
import math
import json
import shutil
import random
import argparse
import matplotlib
from xml.dom import minidom
import numpy as np
from matplotlib.patches import Polygon
from shapely.geometry import Polygon as shape_poly
import matplotlib.pyplot as plt
from matplotlib.collections impo... | |
# !/usr/bin/env python
# -*- coding: utf-8 -*-
"""Core Classes and Functions.
This file stores the core classes and functions for the MRBLEs Analysis module.
"""
# [File header] | Copy and edit for each file in this project!
# title : core.py
# description : MRBLEs - Core Functions
# author : <NAME>
# credits : <NAM... | |
to tell the model.simulate() function that it should assume explicit time',
'dependence by calling it as',
'``model.simulate(...,rates_have_explicit_time_dependence=True)``',
]))
self.quadratic_event_updates = quadratic_event_updates
self.quadratic_rate_functions = quadratic_rate_functions
self.quadratic_events ... | |
"raiseInTry" :setvar(); raise MyErr1
setvar()
if myraise7 == "Unhandled" :setvar(); raise MyErr4
setvar()
except MyErr1:
setvar()
if myraise8 == "Unhandled": setvar(); raise MyErr4
setvar()
except :setvar() # should never be executed
else :
setvar()
if myraise8 == "Unhandled": setvar(); raise MyErr4
setvar(... | |
<filename>multiple-languages/python/ros-cdk-cxapi-1.0.6/src/ros_cdk_cxapi/__init__.py
'''
# `@alicloud/ros-cdk-cxapi`
> TODO: description
## Usage
```
const rosCxapi = require('@alicloud/ros-cdk-cxapi');
// TODO: DEMONSTRATE API
```
'''
import abc
import builtins
import datetime
import enum
import typing
import js... | |
= ANTLRv4Parser.SetElementRefContext(self, localctx)
self.enterOuterAlt(localctx, 1)
self.state = 559
localctx.value = self.match(ANTLRv4Parser.TOKEN_REF)
self.state = 561
self._errHandler.sync(self)
_la = self._input.LA(1)
if _la==ANTLRv4Parser.LT:
self.state = 560
self.elementOptions()
pass
elif la_ == ... | |
imp.cache_from_source to have
# their own cached file format, this block of code will most likely
# throw an exception.
data = bytearray(imp.get_magic())
data.extend(marshal._w_long(source_mtime))
data.extend(marshal.dumps(code_object))
try:
self.set_data(bytecode_path, data)
except NotImplementedError:
pass
... | |
{
0x01 : "Intruder", 0x02 : "Intruder", 0x03 : "Intruder", 0x04 : "Intruder", 0x05 : "Intruder", 0x06 : "Tamper",
0x07 : "Tamper", 0x08 : "Tamper", 0x09 : "Tamper", 0x0B : "Panic", 0x0C : "Panic", 0x20 : "Fire",
0x23 : "Emergency", 0x49 : "Gas", 0x4D : "Flood"
}
pmPanelTroubleType_t = {
0x0A : "Communication", 0x0... | |
<filename>exploretransform/_exploretransform.py
import numpy as np
import pandas as pd
from pandas.api.types import is_numeric_dtype
import plotnine as pn
from scipy.stats import skew
from pandas.api.types import CategoricalDtype
from sklearn.base import BaseEstimator, TransformerMixin
from minepy import MINE
from scip... | |
cv.CreateImage((w,h), cv.IPL_DEPTH_8U, 1)
data = cv.CreateImage((w,h), cv.IPL_DEPTH_64F, 1)
blank = cv.CreateImage((w,h), cv.IPL_DEPTH_64F, 1)
cv.Split(input[0],data,blank,None,None)
min, max, pt1, pt2 = cv.MinMaxLoc(data)
denom = max-min
if(denom == 0):
denom = 1
cv.Scale(data, data, 1.0/(denom), 1.0*(-min)/(d... | |
<gh_stars>1-10
import os
import datetime
import time
import matplotlib.pyplot as plt
import numpy as np
import logging
import collections
import tensorflow as tf
import pandas as pd
from keras.utils import to_categorical
from tensorflow import keras
from tensorflow.keras import layers
os.environ["CUDA_DEVICE_ORDER"] =... | |
lr})
optimizer = optim.SGD(param_list, lr=lr, momentum=momentum, weight_decay=w_decay)
return optimizer
def train(model, criterion, optimizer, pos_feats, neg_feats, maxiter, in_layer='fc4'):
np.random.seed(123)
torch.manual_seed(456)
torch.cuda.manual_seed(789)
model.train()
batch_pos = opts['batch_pos']
bat... | |
<reponame>erialcuw/stretchableCircuit<filename>stretchableCircuit.py
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 26 09:06:14 2021
@author: <NAME>
Perform calculations of the strain-dependent behavior of elastic transistors and simple circuits.
Classes:
transistor
inverter
"""
import numpy as np
import matplo... | |
<filename>kipoi/cli/main.py<gh_stars>0
"""Main CLI commands
"""
from __future__ import absolute_import
from __future__ import print_function
import argparse
import json
import sys
import os
from kipoi_utils import parse_json_file_str_or_arglist, cd, makedir_exist_ok, compare_numpy_dict
import kipoi # for .config modul... | |
<reponame>jbeilstenedmands/cctbx_project
from __future__ import division
from xfel.ui.db import db_proxy
known_job_statuses = ["DONE", "ERR", "PEND", "RUN", "SUSP", "PSUSP", "SSUSP", "UNKWN", "EXIT", "DONE", "ZOMBI", "DELETED", "SUBMIT_FAIL", "SUBMITTED"]
finished_job_statuses = ["DONE", "EXIT", "DELETED", "UNKWN", "E... | |
<reponame>cutz-j/Python_photoshop<gh_stars>0
from tkinter import *
import os
import os.path
import math
from tkinter.filedialog import *
from tkinter.simpledialog import *
import operator
import numpy as np
import struct
import threading
from wand.image import *
from wand.color import Color
from wand.drawing import Dra... | |
import contextlib
import itertools
import matplotlib.pyplot as plt
import numpy as np
import os.path
import pandas as pd
import seaborn as sb
import sys
from . import classifiers
from . import piquant_options as po
from . import resource_usage as ru
from . import statistics
from . import tpms as t
RESOURCE_USAGE_DIR ... | |
<reponame>davidalvarezdlt/master_thesis
import math
import random
import cv2
import numpy as np
import skimage.metrics
import skimage.transform
import torch
import torch.nn.functional as F
class FlowsUtils:
"""Utilities class containing flow-related methods."""
@staticmethod
def flow_abs_to_relative(flow):
"""G... | |
<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from dices import *
#-------------------------------------------------------------------------
# Отряды
metadict_squads = {}
#----
# Тестовые
metadict_squads['характеристики правителей'] = {
# Влом делать отдельно, так рольнём:
# 1 герой 5+ lvl на 16 г... | |
typing.Union[base.InputFile, base.String],
disable_notification: typing.Union[base.Boolean, None] = None,
reply_to_message_id: typing.Union[base.Integer, None] = None,
reply_markup: typing.Union[types.InlineKeyboardMarkup,
types.ReplyKeyboardMarkup,
types.ReplyKeyboardRemove,
types.ForceReply, None] = None) -> ty... | |
Culture-Glendale Heights","Tricoci University of Beauty Culture-Glendale Heights"),
("Tricoci University of Beauty Culture-Highland","Tricoci University of Beauty Culture-Highland"),
("Tricoci University of Beauty Culture-Indianapolis","Tricoci University of Beauty Culture-Indianapolis"),
("Tricoci University of Bea... | |
# AUTOGENERATED! DO NOT EDIT! File to edit: nbs/11_dcmm.ipynb (unless otherwise specified).
__all__ = ['dcmm']
# Internal Cell
#exporti
import numpy as np
from .latent_factor_fxns import forecast_marginal_lf_dcmm, forecast_path_lf_dcmm
from .dglm import bern_dglm, pois_dglm
from .update import update_F
from scipy.spe... | |
#!/usr/bin/python3 -u
import logging
import os
import sys
import time
import struct
from typing import Tuple, Any
from configparser import ConfigParser
from argparse import ArgumentParser, Namespace
from collections.abc import Mapping
from pathlib import Path
from attiny_i2c import ATTiny
#from attiny_i2c_new import A... | |
<gh_stars>0
# Copyright 2017-2020 TensorHub, Inc.
#
# 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 agree... | |
# generate the test file
test_file = determine_tsv_file(
filename="raganato_ALL",
data_folder=data_folder,
cut_multisense=cut_multisense,
)
corpus = ColumnCorpus(
data_folder=data_folder,
column_format=columns,
test_file=test_file, # corpus only has test data
in_memory=in_memory,
tag_to_bioes=tag_to_bioes,
... | |
<gh_stars>0
"""
Functions for use with general model notebooks
"""
import gdal
import ogr
def process_raster_data(src, method, NCOL, NROW, gt, shapeproj, hnoflo, conversion=1.0):
'''
Takes a raster data source (ESRI grid, GeoTiff, .IMG and many other formats)
and returns a numpy array. Arrangment of pixels is given... | |
- carry on
continue
# Yes, we got a note.
# Well, maybe the child fooled us and is just playing dead?
if os.WIFSTOPPED (wstat) or \
os.WIFCONTINUED (wstat) :
# we don't care if someone stopped/resumed the child -- that
# is up to higher powers. For our purposes, the child is
# alive. Ha!
continue
# not st... | |
TS>1e4 or is extended
renamed = np.array([s.distance<close_tol for name,s in df[~df.fl8y].iterrows()],bool)
topsr=[s.distance<0.001 and s.otherid.startswith('PSR') for name,s in df.iterrows()]
print ('Sources failing criteria :\n\tRenamed : {} ({} were PSRs)'.format(sum(renamed), sum(topsr)))
too_close = np.array(... | |
<reponame>pandegroup/vs-utils<gh_stars>10-100
"""
Helper Classes and Functions for docking fingerprint computation.
The code below contains heavily modified parts of Jacob Durrant's
NNScore 2.0.1. The following notice is copied from the original NNScore
file:
# NNScore 2.01 is released under the GNU General Public Lic... | |
:param Height: 高。0-3000。
数值必须是2的倍数,0是原始宽度
:type Height: int
:param Fps: 帧率,默认0。
范围0-60
:type Fps: int
:param Gop: 关键帧间隔,单位:秒。
范围2-6
:type Gop: int
:param Rotate: 旋转角度,默认0。
可取值:0,90,180,270
:type Rotate: int
:param Profile: 编码质量:
baseline/main/high。
:type Profile: str
:param BitrateToOrig: 当设置的码率>原始码率时,是否以原始码率... | |
<reponame>elecbrick/a2fomu<gh_stars>1-10
#!/usr/bin/env python3
#
# a2fomu_build.py - Part of a2fomu - Copyright (c) 2020-2021 <NAME>
#
# This file contains a significant contribution from foboot-bitstream.py
# which wass made available under the Apache License, Version 2.0:
# http://www.apache.org/licenses/LICENSE-2.0... | |
POLY_FT4 *PrintOBJ_TORCHL__FP12ObjectStructiiP7TextDati(struct ObjectStruct *OStr, int ScrX, int ScrY, struct TextDat *ObjDat, int OtPos)")
del_items(0x80076570)
SetType(0x80076570, "struct POLY_FT4 *PrintOBJ_TORCHR__FP12ObjectStructiiP7TextDati(struct ObjectStruct *OStr, int ScrX, int ScrY, struct TextDat *ObjDat, int... | |
from collections import defaultdict
from itertools import chain
from functools import reduce
import operator
import copy
from core.timeline import Timer, Event, Listener, now
from core.log import log
from core.ctx import Static
from core.acl import allow_acl
class ModifierDict(defaultdict):
BUFF_CAPS_FOR_TYPE = {"m... | |
#!/usr/bin/env python
# encoding: utf-8
import pytest
import time
import re
import os
import tarfile
import requests
import tarfile
import docker
import json
import urllib
import yaml
import subprocess
from shutil import copy, copytree, rmtree
from executor import Executor
from docker.types import Mount
# Code to supp... | |
if len(rest) >= 32:
try:
my_uuid = uuid.UUID(rest[:32])
rest = rest[32:]
except ValueError:
pass
if not rest:
kwargs = dict()
elif rest[0] == '?':
kwargs = BaseLocator.parse_args(rest[1:])
else:
raise ValueError
return UntitledLocator(my_uuid, **kwargs)
def to_url(self):
args_str = BaseLocator.generate_a... | |
<reponame>javiergayala/jenkins-job-wrecker<filename>jenkins_job_wrecker/modules/scm.py
# encoding=utf8
import jenkins_job_wrecker.modules.base
class Scm(jenkins_job_wrecker.modules.base.Base):
component = 'scm'
def gen_yml(self, yml_parent, data):
scm = []
scm_class = None
if 'class' in data.attrib:
if data.at... | |
1.1, 1, 1.2, 1.6, 1.5, 1.6, 1.5, 1.3, 1.3, 1.3, 1.2, 1.4, 1.2, 1, 1.3, 1.2, 1.3, 1.3, 1.1, 1.3],
# "marker": {
# "color": "rgb(255, 127, 14)",
# "line": {
# "color": "rgb(255, 255, 255)",
# "width": 0.5
# },
# "opacity": 0.74,
# "size": 8
# },
# "mode": "markers",
# "name": "versicolor",
# "type": "scatter"... | |
from time import time
import autograd.numpy as np
import autograd.numpy.random as npr
import scipy
import ssm
def test_sample(T=10, K=4, D=3, M=2):
"""
Test that we can construct and sample an HMM
with or withou, prefixes, noise, and noise.
"""
transition_names = [
"standard",
"sticky",
"constrained",
"inp... | |
#!/usr/bin/env python
from math import copysign
import rospy, cv2, cv_bridge, numpy
from tf.transformations import decompose_matrix, euler_from_quaternion
from sensor_msgs.msg import Image
from geometry_msgs.msg import Twist
from nav_msgs.msg import Odometry
from ros_numpy import numpify
import numpy as np
from kobuk... | |
<filename>mypy/semanal.py
"""The semantic analyzer.
Bind names to definitions and do various other simple consistency
checks. For example, consider this program:
x = 1
y = x
Here semantic analysis would detect that the assignment 'x = 1'
defines a new variable, the type of which is to be inferred (in a
later pass;... | |
union of all dat2 keys,
## and want max of dat2[x][0] for each experiment x.
##
return (expts, dat2, nytot, netot, tsl )
def setTierMax( self, tierMax ):
"""Set the maxium tier and recompute request sizes"""
if tierMax != self.tierMax:
self.tierMax = tierMax
self.requestItemExpAll( )
def summaryByMip( self, p... | |
"""This module handles the creation of `cross_experiment_key` s and `hyperparameter_key` s for
:class:`hyperparameter_hunter.environment.Environment`, and
:class:`hyperparameter_hunter.experiments.BaseExperiment`, respectively. It also handles the
treatment of complex-typed inputs and their storage in the 'KeyAttribute... | |
= R[smax>=a]
Clmin = Cmin[smax>=a]
b1l = np.zeros(al.shape)
b1l[smin/al < 1.0] = np.arcsin(smin/al[smin/al < 1.0])
b2l = np.pi*np.ones(al.shape)
b2l[smin/al < 1.0] = np.pi-np.arcsin(smin/al[smin/al < 1.0])
C1l = np.ones(al.shape)
C1l[smin/al < 1.0] = p*(Rl[smin/al < 1.0]/al[smin/al < 1.0])**2*np.cos(b1l[smin... | |
# Copyright (c) 2021, NVIDIA CORPORATION. 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 applicable... | |
<gh_stars>0
"""Low-level operations on Gaussian output (log) files.
Provides low-level interfaces to manipulate/extract data in Gaussian
output files.
Methods
-------
get_data
Gets data from a GLog file for each quantity label.
Classes
-------
GLogIO
Main class to handle Gaussian output file operations.
"""
impo... | |
# ====================================================
# This module is run on the experimenter's computer.
# It controls almost all aspects of the experiment,
# including the highest level of the code.
#
# Upon startup, the module connects to two remote
# instances of SNAP running the LSE_GameClient module.
# ========... | |
import pyredner
import torch
import math
import redner
from typing import Optional
def compute_vertex_normal(vertices: torch.Tensor,
indices: torch.Tensor,
weighting_scheme: str = 'max'):
"""
Compute vertex normal by weighted average of nearby face normals.
Args
====
vertices: torch.Tensor
3D position of verti... | |
from collections import defaultdict
from fnmatch import filter
import warnings
import numpy as np
import openmdao.api as om
from openmdao.utils.general_utils import simple_warning
from .pseudospectral_base import PseudospectralBase
from ..common import RadauPSContinuityComp
from ...utils.misc import get_rate_units, g... | |
<filename>GNN/composite_graph_class.py
# coding=utf-8
import sys
import numpy as np
import tensorflow as tf
from scipy.sparse import coo_matrix
from GNN.graph_class import GraphObject, GraphTensor
#######################################################################################################################... | |
'google.cm',
'google.co.bw',
'google.co.cr',
'google.co.ke',
'google.co.ls',
'google.co.mz',
'google.co.tz',
'google.co.ug',
'google.co.uz',
'google.co.zm',
'google.co.zw',
'google.cv',
'google.dj',
'google.dm',
'google.ee',
'google.ga',
'google.ge',
'google.gg',
'google.gl',
'google.gm',
'google.gp... | |
target update period.
"""
# Run a train op at the rate of self.update_period if enough training steps
# have been run. This matches the Nature DQN behaviour.
if self._replay.memory.add_count > self.min_replay_history:
if self.training_steps % self.update_period == 0:
if 'iqn' in self._runtype:
self._sess.... | |
# Author: <NAME>, <EMAIL>
import numpy as np
import pandas as pd
import random
import math
import matplotlib.pyplot as plt
dataset = pd.read_csv('housing3.csv')
Y, X = dataset.Class, dataset.iloc[:, 0:13]
col_names = list(dataset.columns)
unique_class = list(Y.unique())
data_values, class_values = X.values, Y.values
... | |
<gh_stars>1-10
#%%
import os
import sys
os.chdir(os.path.dirname(os.getcwd())) # make directory one step up the current directory
from pymaid_creds import url, name, password, token
import pymaid
rm = pymaid.CatmaidInstance(url, token, name, password)
import numpy as np
import pandas as pd
import seaborn as sns
impor... | |
<reponame>kevinykuo/CTGAN
import numpy as np
import pandas as pd
import torch
import torch.optim as optim
import torch.utils.data
from sklearn.mixture import BayesianGaussianMixture
from torch.nn import (
BatchNorm1d, Dropout, LeakyReLU, Linear, Module, ReLU, Sequential)
from torch.nn import functional as F
CONTINUO... | |
<filename>scripts/automation/trex_control_plane/interactive/trex/common/services/trex_service_ap.py
from trex.stl.api import *
from trex.utils.text_opts import *
from trex.utils.common import natural_sorted_key
from .trex_service import Service, ServiceFilter
from .trex_service_int import ServiceCtx, simpy, TXBuffer
im... | |
labels = list()
preds_model = list()
preds_enr = list()
for batch_idx, (input_rss, slf_enr, target_slf) in enumerate(test_loader):
input_rss = input_rss.to(self.device)
slf_enr = slf_enr.to(self.device)
target_slf = target_slf.to(self.device)
slf_recon = model(input_rss)
# test SLF image RMSE
slf_rmse... | |
<reponame>TuxML/tuxml<gh_stars>1-10
#!/usr/bin/python3
import argparse
import os
import shutil
import subprocess
import bz2
import json
from compilation.apiManager import APIManager
from compilation.environment import get_environment_details, print_environment_details
from compilation.configuration import create_conf... | |
The value for which to search.
- *(string) --*
- **Type** *(string) --*
The type of comparison that should be performed for the value: Equal, NotEqual, BeginWith, LessThan, or GreaterThan.
:type NextToken: string
:param NextToken:
A token to start the list. Use this token to get the next set of results.
:type Ma... | |
# coding=utf-8
# Copyright 2019 team Purifier
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License")
from __future__ import absolute_import, division, print_func... | |
you are missing the `MANAGE_WEBHOOKS` permission.
hikari.errors.UnauthorizedError
If you are unauthorized to make the request (invalid/missing token).
hikari.errors.NotFoundError
If the channel is not found.
hikari.errors.RateLimitTooLongError
Raised in the event that a rate limit occurs that is
longer than `max... | |
<filename>CV_adv/distillation_training.py
import os
import os.path as osp
import sys
import time
import argparse
from pdb import set_trace as st
import json
import random
from functools import partial
import torch
import numpy as np
import torchvision
import torch.nn as nn
import torch.nn.functional as F
import torch.... | |
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
HDMI = _hilens_internal.Display_HDMI
RTMP = _hilens_internal.Display_RTMP
H264_FILE = _hilens_internal.Display_H264_FILE
if _newclass:
Create = staticmethod(_hilens_internal.Display_Creat... | |
from flask import render_template, flash, redirect, url_for, request
from app import app, db, scheduler
from app.forms import LoginForm, RegistrationForm, ResetPasswordRequestForm, ResetPasswordForm
from flask_login import current_user, login_user, logout_user, login_required
from app.models import User
from werkzeug.u... | |
<reponame>ckulal/cephci<filename>tests/rados/stretch_cluster.py
import datetime
import json
import logging
import re
import time
from ceph.ceph_admin import CephAdmin
from ceph.parallel import parallel
from tests.rados.mute_alerts import get_alerts
from tests.rados.rados_prep import create_pool
from tests.rados.test_9... | |
1. From a histogram (i.e. counts on a grid)::
h,edges = numpy.histogramdd(...)
D = Density(h, edges, parameters={'isDensity': False}, units={'length': 'A'})
D.make_density()
2. From a saved density file (e.g. in OpenDX format), where the lengths are
in Angstrom and the density in 1/A**3::
D = Density("density.... | |
<filename>dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/transforms.py
"""
Implement transformation on Numba IR
"""
from __future__ import absolute_import, print_function
from collections import namedtuple, defaultdict
import logging
from numba.analysis import compute_cfg_from_blocks, find_top_level_loops
f... | |
from struct import pack, Struct
from collections import defaultdict
from typing import List, Dict, Tuple, Union, Any
from pyNastran.bdf.cards.collpase_card import collapse_thru_packs
from pyNastran.op2.errors import SixtyFourBitError
from .geom1_writer import write_geom_header, close_geom_table
def write_geom4(op2_fi... | |
<reponame>quanpands/wflow
"""
wf_DynamicFramework
-------------------
This is a replacement for the standard pcraster/python DynamicFramwork class.\
It provides extra functionality to simplify linking the models build in the framework
with other models. The provided functionality allows external programs to control
an... | |
<reponame>Open-EO/openeo-geopyspark-driver
import collections
import json
import logging
import math
import pathlib
import subprocess
import tempfile
from datetime import datetime, date
from functools import partial
from typing import Dict, List, Union, Tuple, Iterable, Callable
import geopyspark as gps
import numpy a... | |
<filename>sysinv/sysinv/sysinv/sysinv/conductor/manager.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# coding=utf-8
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# Copyright 2013 International Business Machines Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "Li... | |
<gh_stars>100-1000
"""The GraphTensor composite tensor and its pieces."""
import abc
from typing import Any, Callable, cast, Dict, Mapping, Optional, Sequence, Union
import tensorflow as tf
from tensorflow_gnn.graph import graph_constants as const
from tensorflow_gnn.graph import graph_piece as gp
from tensorflow_gnn... | |
<filename>zepster/genschema.py
'''
Copyright 2020 Cisco Systems, Inc. and its affiliates.
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 requ... | |
+ toGuess[2:]
if word[2] == "U" or word[2] == "u" :
toGuess = toGuess[:2] + "u" + toGuess[3:]
if word[3] == "U" or word[3] == "u" :
toGuess = toGuess[:3] + "u" + toGuess[4:]
if word[4] == "U" or word[4] == "u" :
toGuess = toGuess[:4] + "u" + toGuess[5:]
if word[1] != "U" and word[1] != "u" and w... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.