input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
= self.api_client.call_api(resource_path, method,
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=files,
response_type='str',
auth_settings=auth_settings,
callback=params.get('callback'))
return response
def connect_head_namespaced_pod_proxy_2(self, namespace, name... | |
# IMPORT CYTHON VERSION
from EC_GAME import momentum_angle_free, momentum_trigonometry
# IMPORT C VERSION
from ECC import momentum_angle_free_c, momentum_trigonometry_c
import pygame
from pygame.math import Vector2
if __name__ == '__main__':
import timeit
v1 = Vector2(0.707, 0.707)
x1 = Vector2(0.0,... | |
"""Eco Heat Recovery Ventilation Fan Control (e.g. Blauberg VENTO Expert A50-1 W)"""
from __future__ import annotations
import asyncio
from email.policy import default
import logging
import ipaddress
import time
from datetime import timedelta
import voluptuous as vol
from homeassistant.components.fan import (
ATTR_P... | |
fmt % (n, self.Atoms.type[n], self.Atoms.label[n],
self.Atoms.u[n], self.Atoms.v[n], self.Atoms.w[n],
self.Atoms.occupancy[n], self.Atoms.uiso[n])
# Insert string in text box
self.text.insert(tk.END, str)
def fun_magnets(self):
""""ReOpen window with magnetic moments"""
# Close window
self.root.destroy()
A... | |
#!/usr/bin/env python
# coding=utf-8
from distutils.spawn import find_executable
from kvirt.config import Kconfig
from kvirt.baseconfig import Kbaseconfig
from kvirt.containerconfig import Kcontainerconfig
from kvirt.config import __version__
from kvirt.defaults import TEMPLATES
from prettytable import PrettyTable
imp... | |
# -*- coding: utf-8 -*-
"""
This tutorial will introduce the basic concepts and workflow of mpcpy.
By the end, we will train a simple model based on emulated data, and use
the model to optimize the control signal of the system. All required data
files for this tutorial are located in doc/userGuide/tutorial.
The mode... | |
<filename>bayes_opt/sequentialBO/bayesian_optimization.py
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 29 11:49:58 2016
"""
import numpy as np
#from sklearn.gaussian_process import GaussianProcess
from bayes_opt.sequentialBO.bayesian_optimization_base import BO_Sequential_Base
from scipy.optimize impor... | |
import re
import sqlite3
import time
#########################################################################
# Base class for generating a catebot response. This is intended to be a parent to classes that
# implement each type of response with overrides specific to them. The classes that are expected to be
# overrid... | |
n_ * WC("b", S(1))) ** p_
* (c_ + x_ ** n_ * WC("d", S(1))) ** WC("q", S(1))
* (e_ + x_ ** n_ * WC("f", S(1))),
x_,
),
cons2,
cons3,
cons8,
cons29,
cons50,
cons127,
cons4,
cons52,
cons13,
cons139,
)
rule999 = ReplacementRule(pattern999, replacement999)
pattern1000 = Pattern(
Integral(
(a_ + x_ ** n_... | |
#
# This file is part of the GROMACS molecular simulation package.
#
# Copyright (c) 2019, by the GROMACS development team, led by
# <NAME>, <NAME>, <NAME>, and <NAME>,
# and including many others, as listed in the AUTHORS file in the
# top-level source directory and at http://www.gromacs.org.
#
# GROMACS is free softw... | |
<reponame>bmgee/votedperceptron
# Copyright 2015 <NAME>. 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 require... | |
== 205 and satelliteSeries == 331:
return 'Synth. Sat. brightness temperature cloudy'
if discipline == 3 and parameterCategory == 1 and parameterNumber == 17 and instrumentType == 205 and satelliteSeries == 331 and satelliteNumber == 52:
return 'Synth. Sat. radiance cloudy'
if discipline == 3 and parameterCategor... | |
node_identifier,
stdout,
stderr,
exit_status))
def assign_node_roles(self):
logger.debug("Assigning roles to nodes")
common_path = os.path.join(os.path.expanduser(
self.settings.cloud_repo_dir + '/src'), 'common')
sys.path.append(common_path)
from thread_helper import ThreadWithExHandling # noqa
roles_to_n... | |
1),
(7, 15, 1, 2): (-1, 1),
(7, 15, 1, 3): (-1, 1),
(7, 15, 1, 4): (-1, 0),
(7, 15, 1, 5): (-1, -1),
(7, 15, 2, -5): (1, 1),
(7, 15, 2, -4): (1, 1),
(7, 15, 2, -3): (1, 1),
(7, 15, 2, -2): (1, 1),
(7, 15, 2, -1): (1, 1),
(7, 15, 2, 0): (-1, 1),
(7, 15, 2, 1): (-1, 1),
(7, 15, 2, 2): (-1, 1),
(7, 15, 2, 3):... | |
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | |
# -*- coding: utf-8 -*-
from __future__ import division
import numpy as np
from .constants import SSO
from .conversions import t_from_CT, CT_from_t
from ..utilities import match_args_return
__all__ = ['brineSA_CT',
'brineSA_t',
'CT_freezing',
't_freezing']
# Constants:
c = (0.017947064327968736, -6.076099099929... | |
# Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | |
# coding=utf-8
from __future__ import unicode_literals
from .. import Provider as AddressProvider
class Provider(AddressProvider):
street_prefixes = ('Av', 'Avenida', 'R.', 'Rua', 'Travessa', 'Largo')
city_formats = ('{{city_name}}',)
street_name_formats = (
'{{street_prefix}} {{last_name}}',
'{{street_prefix}}... | |
import sys
import unittest
import importlib
import asn1tools
sys.path.append('tests/files')
sys.path.append('tests/files/3gpp')
sys.path.append('tests/files/cen')
sys.path.append('tests/files/etsi')
sys.path.append('tests/files/ieee')
sys.path.append('tests/files/ietf')
sys.path.append('tests/files/oma')
class Asn1... | |
import math
import os
import sys
import numpy as np
import torch
import torch.nn.functional as F
from scipy.sparse import csr_matrix, diags, identity
from scipy.sparse import hstack as sparse_hstack
from scipy import interpolate
from torch import nn
from torch.nn.modules.loss import _WeightedLoss
from torch.utils.data... | |
<reponame>cydenix/OpenGLCffi<gh_stars>0
DEF = '''
typedef int32_t khronos_int32_t;
typedef uint32_t khronos_uint32_t;
typedef int64_t khronos_int64_t;
typedef uint64_t khronos_uint64_t;
typedef signed char khronos_int8_t;
typedef unsigned char khronos_uint8_t;
typedef signed short int khronos_int16_t;
typedef unsigned... | |
the inner product between two vectors with the (False, 'maintain') normalization."""
expected_result = self.uniform_matrix.inner_product(self.vec1, self.vec2)
expected_result /= math.sqrt(self.uniform_matrix.inner_product(self.vec2, self.vec2))
expected_result *= math.sqrt(self.identity_matrix.inner_product(self.ve... | |
import sys, os
import params
#This sets the path in our computer to where the eyetracker stuff is located
#sys.path.append('/Users/Preetpal/desktop/ubc_4/experimenter_platform/modules')
#sys.path.append('E\\Users\\admin\\Desktop\\experimenter_platform\\modules')
sys.path.append(os.path.join(sys.path[0],'Modules'))
sys... | |
header, footer
def generate_struct_union_definition(self, entry, code):
code.mark_pos(entry.pos)
type = entry.type
scope = type.scope
if scope:
kind = type.kind
packed = type.is_struct and type.packed
if packed:
kind = "%s %s" % (type.kind, "__Pyx_PACKED")
code.globalstate.use_utility_code(packed_struct_util... | |
<reponame>cholve/stratum<filename>stratum/portage/build_defs.bzl
# Copyright 2018 Google LLC
# Copyright 2018-present Open Networking Foundation
# SPDX-License-Identifier: Apache-2.0
"""A portable build system for Stratum P4 switch stack.
To use this, load() this file in a BUILD file, specifying the symbols needed.
... | |
<filename>bazel/go/dependencies.bzl
load("@bazel_gazelle//:deps.bzl", "go_repository", "git_repository")
GO_DEPENDENCIES = {
"overlaps": {
# github.com/stretchr/testify:v1.2.2 -> v1.1.0
# k8s.io:v1.10.8 -> <PASSWORD> (>v1.0.0, <v1.1.0)
"github.com/davecgh/go-spew": {
"name": "com_github_davecgh_go_spew",
"commit... | |
[0.1, -1]] * 16
self.turn_right_incoming = False
# self.middle = False
return self.buffer.pop()
# if self.turning_right:
# if yellow_b_r < 0.01 and ((pos_slope_avg is not None and pos_slope_avg >= 0.65) \
# or neg_slope_avg is not None):
# # If we turn right, eventually the bot will find a high enuf slope on t... | |
= Var(within=Reals,bounds=(0,950),initialize=0)
m.x597 = Var(within=Reals,bounds=(0,950),initialize=0)
m.x598 = Var(within=Reals,bounds=(0,950),initialize=0)
m.x599 = Var(within=Reals,bounds=(0,1400),initialize=0)
m.x600 = Var(within=Reals,bounds=(0,1400),initialize=0)
m.x601 = Var(within=Reals,bounds=(0,1400),initiali... | |
old file in " + path_to_default_files + "."))
else:
print("No changes to " + latlongs_file + ".")
# Given either the new lat_longs file (if new coordinates were added in this iteration of the script) or the old file,
# Construct the color_ordering.tsv file based on the data dictionary. Only places with existing coor... | |
#!/usr/bin/python3
# Author: GMFTBY
# Time: 2019.9.16
'''
Translate the test dataset with the best trained model
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
import argparse
from tqdm import tqdm
import random
import ipdb
import math
from utils import *
from data_loader i... | |
<filename>color_dict.py
color_dict = [{
0: (0, 0, 0, 0),
1: (255, 255, 255, 255),
2: (204, 204, 204, 255),
3: (160, 160, 160, 255),
4: (128, 128, 128, 255),
5: (100, 100, 100, 255),
6: (51, 51, 51, 255),
7: (0, 0, 0, 255),
8: (238, 225, 197, 255),
9: (193, 123, 183, 255),
10: (255, 212, 216, 255),
11: (150,... | |
the `member` dictionary.
:type key: str
:return: Returns the value of the member.
:rtype: Anything
"""
return self.members[key]
class DeconvolutionExperiment:
"""A deconvolution experiment class used to keep track of everything that is required to do a full AntiSplodge experiment.
:param SC: A single-cell data... | |
# Copyright (c) 2013 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality o... | |
import json
from flameboi.common.flameboi import Flameboi
# from slack_blockkit.block_element import ButtonElement
from slack_blockkit.composition_object import TextObject
from slack_blockkit.layout_block import DividerBlock, SectionBlock, ActionsBlock
from slack_blockkit.utils import get_blocks, get_text_block_with_i... | |
frag. This is due to isomeric substitution e.g.: two
# different Me groups off a core. These are still valid matches but could be removed
# by ensuring that the original smiles is also different
# finally get the attachment point info back from the numeric id's
fattach_str_R = self.refattach_dict[
self.double_pai... | |
of segment fit
IS2_atl03_fit[gtx]['land_ice_segments']['ground_track']['x_atc'] = Segment_X_atc[gtx]
IS2_atl03_fill[gtx]['land_ice_segments']['ground_track']['x_atc'] = Segment_X_atc[gtx].fill_value
IS2_atl03_attrs[gtx]['land_ice_segments']['ground_track']['x_atc'] = {}
IS2_atl03_attrs[gtx]['land_ice_segments']['gr... | |
self.taiko_standard_recent(ctx, playerName)
return
player = self.settings.getUserStat(ctx.message.author, ctx.message.guild, "OsuPlayer")
if player == None:
return await self.player_not_found(ctx)
await self.taiko_standard_recent(ctx, player)
return
@commands.command(aliases = ["rctb"])
async... | |
#/usr/bin/python
from __future__ import print_function
import argparse
import torch
import pickle
import numpy as np
import os
import math
import random
import sys
import matplotlib.pyplot as plt
import seaborn as sns
import scipy.io
import data
from sklearn.decomposition import PCA
from torch import nn, opt... | |
#!/usr/bin/env python
import os, sys
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)),
'agilent-n6700b-power-system'))
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)),
't2k-temperature-sensor'))
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)),... | |
<gh_stars>0
from configuration import PATH
from Instance import Instance
import utils
import inspect
import logging
from itertools import combinations
from random import sample, shuffle, random
from bisect import bisect
from collections import defaultdict
import concurrent.futures
import networkx as nx
import numpy as ... | |
<reponame>vclabskku/nlos<gh_stars>0
"""BSD 2-Clause License
Copyright (c) 2019, Allied Vision Technologies GmbH
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must re... | |
16463,
16465,
16466,
16467,
16468,
16471,
16472,
16473,
16474,
16475,
16476,
16477,
16478,
16479,
16480,
16483,
16484,
16485,
16486,
16487,
16489,
16490,
16491,
16492,
16494,
16496,
16497,
16498,
16499,
16501,
16502,
16503,
16504,
16505,
16506,
16507,
16508,
16509,
16510,
16513,
... | |
StoredFieldFacet(FacetType):
"""Lets you sort/group using the value in an unindexed, stored field (e.g.
:class:`whoosh.fields.STORED`). This is usually slower than using an indexed
field.
For fields where the stored value is a space-separated list of keywords,
(e.g. ``"tag1 tag2 tag3"``), you can use the ``... | |
for key, val in six.iteritems(params['kwargs']):
if key not in all_params:
raise TypeError(
"Got an unexpected keyword argument '%s'"
" to method get_device_group_datasource_list" % key
)
params[key] = val
del params['kwargs']
# verify the required parameter 'device_group_id' is set
if ('device_group_id' not i... | |
save_dir=save_dir, initial_state_path=initial_state_path)
self.observation_space = self.idsgame_config.game_config.get_attacker_observation_space()
def get_attacker_action(self, action) -> Union[int, Union[int, int], int]:
import gym_idsgame.envs.util.idsgame_util as util
attacker_action, _ = action
return util.i... | |
y, w, h)
def create_radio_group(self):
return _gui.GuiMenu_create_radio_group(self)
def add_item(self, *args):
return _gui.GuiMenu_add_item(self, *args)
def add_separator(self, *args):
return _gui.GuiMenu_add_separator(self, *args)
def add_sub_menu(self, *args):
return _gui.GuiMenu_add_sub_menu(self, *args)... | |
bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
def __ne__(self, other: 'DocumentList') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == othe... | |
import json
import random
import warnings
from typing import Any, Callable, Dict, List, Union, Type, Optional, NoReturn
from pydantic import PrivateAttr
from vkwave.bots import BotEvent, BotType, EventTypeFilter, UserEvent
from vkwave.bots.core import BaseFilter
from vkwave.bots.core.dispatching.filters.builtin impor... | |
<filename>numba/core/dataflow.py<gh_stars>0
import collections
from pprint import pprint
import sys
import warnings
from numba.core.errors import UnsupportedError
from numba.core.ir import Loc
class DataFlowAnalysis(object):
"""
Perform stack2reg
This is necessary to resolve blocks that propagates stack value.
... | |
set this if you have two datasets of the same type that
are used for different purposes. Such as having a second level1 dataset
that was used for QA (but is not this same scene).
:param inherit_geometry: Instead of re-calculating the valid bounds geometry based on the
data, which can be very computationally expens... | |
import struct
import logging
import io
import time
try:
import queue
except ImportError:
import Queue as queue
from ..network import CanError
from .. import objectdictionary
from .base import SdoBase
from .constants import *
from .exceptions import *
logger = logging.getLogger(__name__)
class SdoClient(SdoBase):... | |
_jump_box_host_fd.write(_jump_box_host_contents)
_jump_box_host_fd.close()
cld_attr_lst["vm_defaults"]["ssh_config_file"] = _jump_box_host_fn
print "done\n"
else :
_msg = "The attribute \"CREATE_JUMPHOST\" in Global Object "
_msg += " VM_DEFAULTS is set to \"True\", but the actual "
_msg += " IP address of the... | |
3*SIZE/8, SIZE/2, SIZE/4),
"RIGHT":(OFFSET+SIZE*j + SIZE, OFFSET + SIZE*i + 3*SIZE/8, SIZE/2, SIZE/4),
"UP":(OFFSET+SIZE*j + 3*SIZE/8, OFFSET + SIZE*i - SIZE/2, SIZE/4, SIZE/2),
"DOWN":(OFFSET+SIZE*j + 3*SIZE/8, OFFSET + SIZE*i + SIZE, SIZE/4, SIZE/2),
"START":(OFFSET+SIZE*j + 3*SIZE/8, OFFSET ... | |
# -*- coding: utf-8 -*-
import os
import random
import string
import sphinx
from sphinx.errors import SphinxError
from docutils import nodes
from docutils.parsers.rst import directives
from pkg_resources import parse_version
from sphinx.roles import XRefRole
from sphinxcontrib.needs.directives.need import Need, NeedD... | |
<th>%s</th>'\
% ('protein', 'dataset', 'res type', 'resnum', 'atom', '&Delta&delta', '&Delta&delta err', 'pKa', 'pKa err', 'model')
print '<tr>'
for name in kys:
for d in pkainfo[name]:
PI = pkainfo[name][d]
resnum = PI['resnum']
res = PI['res']
atom = PI['atom']
model = PI['model']
for p in PI:
if not 'pK'... | |
import numpy as np
import math
import os
from scipy.sparse import csr_matrix,csc_matrix
from scipy.sparse.linalg import lsqr
def read_ply_point_normal(shape_name):
file = open(shape_name,'r')
lines = file.readlines()
start = 0
while True:
line = lines[start].strip()
if line == "end_header":
start += 1
brea... | |
(see\n'
' section Calls) can be applied:\n'
'\n'
' User-defined functions\n'
' A user-defined function object is created by a function\n'
' definition (see section Function definitions). It should be\n'
' called with an argument list containing the same number of '
'items\n'
" as the function's formal p... | |
<gh_stars>0
# Copyright (C) GRyCAP - I3M - UPV
#
# 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 t... | |
<reponame>WeisiX/ITAS3D
### Copyright (C) 2017 NVIDIA Corporation. All rights reserved.
### Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
import time
import os
import numpy as np
import torch
from torch.autograd import Variable
from collections import Ordered... | |
= self.layer_dict['fcc_{}'.format(i)].forward(out)
if self.use_bn:
self.layer_dict['fcc_bn_{}'.format(i)] = MetaBatchNormLayer(num_features=out.shape[1], args=self.args,
use_per_step_bn_statistics=True)
out = self.layer_dict['fcc_bn_{}'.format(i)].forward(out, num_step=0)
out = F.leaky_relu(out)
out = out.view(o... | |
<filename>emmet-builders/emmet/builders/molecules/atomic.py<gh_stars>0
from datetime import datetime
from itertools import chain
from math import ceil
from typing import Optional, Iterable, Iterator, List, Dict
from maggma.builders import Builder
from maggma.core import Store
from maggma.utils import grouper
from emm... | |
<reponame>pbs/its
import itertools
import os
import tempfile
import unittest
from io import BytesIO
from pathlib import Path
from unittest import TestCase
from unittest.mock import patch
from PIL import Image
import its.errors
from its.application import APP
from its.optimize import has_transparent_background, optimi... | |
<reponame>liquidinstruments/pymoku
import math
import logging
import warnings
from pymoku._instrument import to_reg_unsigned
from pymoku._instrument import from_reg_unsigned
from pymoku._instrument import to_reg_signed
from pymoku._instrument import from_reg_signed
from pymoku._instrument import deprecated
from pymok... | |
<reponame>AlexanderGolys/Drawing_cellar<gh_stars>0
import turtle as tt
import random
from abc import ABC, abstractmethod
from enum import Enum, auto
import math
class Color:
"""
Class containing constant colors or random generators for colors used in program.
"""
cellar_background_color = (0xD3, 0xD3, 0xD3)
whit... | |
member value of dist
# and a member value of id. Choose the one that has the smallest dist
# If there is a close alternative, also within max_dist but with residue
# number much closer to all the others in a group, take that one instead
# This is to try and go along a chain and not jump unless necessary.
# ca_di... | |
Integer, float, Float)):
return False
q = Rt(-a * c, S(2))
if NonzeroQ(c * f + g * q):
return True
return False
def replacement1297(a, c, d, e, f, g, x):
q = Rt(-a * c, S(2))
return Dist(
(c * f + g * q) / (c * d + e * q), Int(S(1) / sqrt(a + c * x ** S(4)), x), x
) + Dist(
(-d * g + e * f) / (c * d + e * ... | |
import numpy as np
from mikecore.DfsFile import DfsProjection, DfsTemporalAxis
from mikecore.MeshFile import MeshFile
from mikecore.DfsFactory import DfsFactory
from mikecore.DfsBuilder import DfsBuilder
from mikecore.DfsuFile import DfsuFile, DfsuFileType, DfsSimpleType, DataValueType, DfsuUtil
from mikecore.eum impor... | |
<gh_stars>1-10
#!/usr/bin/env python
# Copyright 2021 Citrix Systems, Inc. All rights reserved.
# Use of this software is governed by the license terms, if any,
# which accompany or are included with this software.
import re
import logging
from collections import OrderedDict
import nspepi_common as common
"""
Pars... | |
'''
本模块储存着常用算符和积分方法
调用模块中的算符时应注意:
1、算符作用的多元函数的自变量需为列表(list、tuple、ndarray均可,下同)
2、算符作用的标量函数的输出值需为单个值
3、算符作用的矢量函数的输出值需为列表
This module stores the common operators and integration method
When calling operators in the module, pay attention to:
1. The argument of the multivariate function acted by the operators should be li... | |
True, seed: int = None) -> None:
"""
g = activation function
z = w.T @ a_previous + b
a = g(z)
"""
if seed:
np.random.seed(seed)
self.units = units
# logger.info(f"Units per Layer: {self.units}")
self.n_layers = len(self.units)
activations = ['linear' if activation_str is None else activation_str
for activa... | |
self.trans[char] = u"ping"
for char in u"坡泼颇婆破魄迫粕剖":
self.trans[char] = u"po"
for char in u"扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑濮":
self.trans[char] = u"pu"
for char in u"期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫":
self.trans[char] = u"qi"
for char in u"掐恰洽":
self.trans[char] = u"qia"
for char in u"牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉":
self.trans[... | |
<reponame>ajouellette/critical-shells
import os
import sys
import numpy as np
from mpi4py import MPI
from astropy.cosmology import FlatLambdaCDM
import astropy.units as u
import h5py
from gadgetutils.snapshot import ParticleData
from gadgetutils.utils import sphere_volume, mean_pos_pbc
import time
profile = False
de... | |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# 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... | |
from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import types_axi_slave_readwrite_lite_simultaneous
expected_verilog = """
module test;
reg CLK;
reg RST;
wire [32-1:0] sum;
reg [32-1:0] myaxi_awaddr;
reg [4-1:0] myaxi_awcache;
reg [3-1:0] myaxi_awprot;
reg myaxi_aw... | |
<gh_stars>0
#!/usr/bin/python
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | |
<gh_stars>1-10
import torch
from torch import nn as nn
from torch.nn import functional as F
from torch.autograd import Variable, Function
import numpy as np
"""
3D Squeeze and Excitation Modules
*****************************
3D Extensions of the following 2D squeeze and excitation blocks:
1. `Channel Squeeze and Exci... | |
- starttime))))
def export_pings_to_file(self, output_directory: str = None, file_format: str = 'csv', csv_delimiter=' ',
filter_by_detection: bool = True, z_pos_down: bool = True, export_by_identifiers: bool = True):
"""
Run the export module to export point cloud relevant data to file, see export.export_pings_to... | |
"""Utilities for with-statement contexts. See PEP 343.
Original source code: https://hg.python.org/cpython/file/3.4/Lib/contextlib.py
Not implemented:
- redirect_stdout;
"""
import sys
from collections import deque
from ucontextlib import *
class AbstractAsyncContextManager(object):
"compabilibty"
pass
class... | |
1),
(7, 31, 0, -3): (1, 1),
(7, 31, 0, -2): (0, 1),
(7, 31, 0, -1): (-1, 1),
(7, 31, 0, 0): (-1, 1),
(7, 31, 0, 1): (-1, 0),
(7, 31, 0, 2): (-1, -1),
(7, 31, 0, 3): (-1, -1),
(7, 31, 0, 4): (-1, 1),
(7, 31, 0, 5): (-1, 1),
(7, 31, 1, -5): (1, 1),
(7, 31, 1, -4): (1, 1),
(7, 31, 1, -3): (1, 1),
(7, 31, 1, -... | |
<reponame>universvm/sequence-recovery-benchmark<filename>benchmark/visualization.py
"""Functions for visualizing metrics and comparing different models"""
import pandas as pd
from benchmark import config
import ampal
from benchmark import get_cath
import gzip
from pathlib import Path
import numpy as np
import... | |
utils.load_bert_weight_from_ckpt(
bert_model=bert_encoder,
bert_ckpt_dir=bert_ckpt_dir,
repl_patterns=ub.models.bert_sngp.CHECKPOINT_REPL_PATTERNS)
logging.info('Loaded BERT checkpoint %s', bert_ckpt_dir)
metrics.update({
'test/negative_log_likelihood':
tf.keras.metrics.Mean(),
'test/auroc':
tf.keras.metrics.... | |
########
# Copyright (c) 2014 GigaSpaces Technologies Ltd. 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 requir... | |
assert lst_0_v_0["VersionId"] == vid_s
assert lst_0_v_0["VersionStages"] == ["AWSCURRENT"]
#
lst_0_v_1 = lst_0["Versions"][1]
assert lst_0_v_1["VersionId"] == vid_0
assert lst_0_v_1["VersionStages"] == ["one", "two", "three"]
put_1 = sm_client.put_secret_value(
SecretId=secret_name, SecretString="S2", VersionSt... | |
# -*- coding: utf-8 -*-
'''
raeting module provides constants and values for the RAET protocol
Packet Data Format.
The data used to initialize a packet is an ordered dict with several fields
most of the fields are shared with the header data format below so only the
unique fields are shown here.
Unique Packet data f... | |
1, x]
or mask_2d[y - 1, x]
or mask_2d[y, x + 1]
or mask_2d[y, x - 1]
or mask_2d[y + 1, x + 1]
or mask_2d[y + 1, x - 1]
or mask_2d[y - 1, x + 1]
or mask_2d[y - 1, x - 1]
):
return True
else:
return False
@decorator_util.jit()
def total_edge_pixels_from(mask_2d: np.ndarray) -> int:
"""
Ret... | |
dict
dictionary containing the output
ind_rad : int
radar index
"""
if procstatus == 0:
return None, None
keep_points = dscfg.get('keep_points', False)
if procstatus == 2:
if not keep_points or dscfg['initialized'] == 0:
return None, None
return (
{'selfconsistency_points':
dscfg['global_data']['selfcon... | |
<reponame>KrzysztofKoch1/edk2<gh_stars>10-100
## @file
# This file is for installed package information database operations
#
# Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials are licensed and made available
# under the terms and conditions of... | |
<filename>ec2_gui.pyw
import sys
try:
import wx
except ImportError:
print 'Looks like you do not have wx installed.'
print 'You can install it here (you want the unicode version):'
print 'http://www.wxpython.org/download.php'
print 'Your python version: ' + str(sys.version_info[0:2])
sys.exit(1)
import w... | |
read_only: ReadOnly here will force the ReadOnly setting in VolumeMounts. Defaults to false. More info: https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
"""
pulumi.set(__self__, "pd_name", pd_name)
if fs_type is not None:
pulumi.set(__self__, "fs_type", fs_type)
if partition is not None:
pulu... | |
import tensorflow as tf
import tensorflow_probability as tfp
# from tensorflow_probability import edward2 as ed2
tfd = tfp.distributions
tfb = tfp.bijectors
tfp_kernels = tfp.positive_semidefinite_kernels
import sys
sys.path.insert(0, './self_py_fun')
from self_py_fun.PreFun import *
# import scipy as sp
import seaborn... | |
<gh_stars>1-10
# File Name:api.py
#
# This file is for connection to zenpy module.
#
# Copyright: 2016@nephoscale
#
# Start date: July 14th, 2016
#
# Dependancies:
# zenpy:
# Github: https://github.com/facetoe/zenpy
# Python: pip install zenpy
# ndg-httpsclient:
# pip install ndg-httpsclient
from keystoneauth1 import ... | |
if last_stat_time:
expires_in = last_stat_time + self.__stat_ttl - now
if expires_in > 0:
return None
else:
del self.__notfound[name]
# Is there an up-to-date compiled version on disk?
if self._compiled_is_current(name):
compiled_template = self._load_compiled(self._compiled_filename(name))
if compiled_templa... | |
# Copyright (c) 2020-2021, <NAME>
# License: MIT License
from typing import (
TYPE_CHECKING,
List,
Iterable,
Tuple,
Optional,
Dict,
Sequence,
)
import math
import itertools
from ezdxf.math import (
Vec3,
Z_AXIS,
OCS,
Matrix44,
BoundingBox,
ConstructionEllipse,
cubic_bezier_from_ellipse,
Bezier4P,
Bezie... | |
<filename>paycheck/cross_validate.py
import glob
import csv
from collections import defaultdict, Counter
from itertools import cycle
import tempfile
import os
from os.path import join
import logging
from traceback import format_exc
import sys
import json
import click
import numpy.random
import numpy
import biom
from b... | |
arg16, arg17, arg18, arg19, arg20, arg21, arg22, arg23, arg24, arg25, arg26)
MPDSGeosClassicSimSimulation = _geosclassic.MPDSGeosClassicSimSimulation
class mpds_grid(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, mpds_grid, name, value)
__swig_getmethods__ = {}
__geta... | |
outputmode(mode=None):
raise NotImplementedError
def colormode(mode=None, range=1.0):
raise NotImplementedError
#--- COLOR SPACE -------------------------------------------------------------------------------------
# Transformations between RGB, HSB, CIE XYZ and CIE LAB color spaces.
# http://www.easyrgb.com/math.p... | |
import unittest
import numpy as np
import os
import shutil
import json
from pathlib import Path
from unittest.mock import patch, MagicMock
from appdirs import user_cache_dir
import geopandas as gpd
import warnings
import shutil
from ausdex.seifa_vic.data_wrangling import preprocess_victorian_datasets
from ausdex.seifa_... | |
in range(len(MTs_sample[:,0])):
# Get theta and phi rotations, assuming that have been random orientation from Lune space varied diagonallised MT:
# (Note: based on rotation of theta and phi about y and z axes after diagonal MT from Lune params created)
MT_curr = MTs_sample[ii,:]
MTp_curr = MTp_sample[ii]
full_MT_... | |
if retall:
ret.profile_map = profile
ret.extractionApertures = extractionApertures
ret.background_map = background
ret.variance_map = variance0
ret.goodpixelmask = goodpixelmask
ret.function_args = args
ret.function_kw = kw
return ret
def spextractor(frame, gain, readnoise, framevar=None, badpixelmask=No... | |
import cv2
import numpy as np
from lanms import merge_quadrangle_n9 as la_nms
from mmdet.core import BitmapMasks
from mmdet.datasets.builder import PIPELINES
from numpy.linalg import norm
import mmocr.utils.check_argument as check_argument
from .textsnake_targets import TextSnakeTargets
@PIPELINES.register_module()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.