input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
0)
m.e3273 = Constraint(expr= m.x2013 + 3.5 * m.b2353 <= 3.5)
m.e3274 = Constraint(expr= m.x2014 + 3.5 * m.b2354 <= 3.5)
m.e3275 = Constraint(expr= m.x2015 + 3.5 * m.b2355 <= 3.5)
m.e3276 = Constraint(expr= m.x2016 + 3.5 * m.b2356 <= 3.5)
m.e3277 = Constraint(expr= m.x2073 - 3.15 * m.b2353 <= 0)
m.e3278 = Constraint(ex... | |
res_knn_brute]
barras = ('Auto','Ball Tree','Kd tree','Brute')
y_pos = np.arange(len(barras))
plt.bar(y_pos, alto, color=['pink', 'yellow', 'purple', 'cyan'])
plt.xticks(y_pos, barras)
plt.show()
# #### Analisis
#
# * No se puede determinar cual algoritmo es mejor, porque cuando se utilizan estos algortimos y se ha ... | |
# 2013.04.26
# S.Rodney
# checking if the simulated SN distributions are in line with the observed
# mags and colors for 0.5 < z < 1.0
# TODO: handle upper limits
# TODO : handle missing nicknames
# TODO : adjust default x scaling
import os
import sys
import stardust
import numpy as np
from matplotlib import pyplo... | |
Path(target0)
if my_file.is_file():
with open(target0, "r") as d:
if file_is_empty(target0)== True:
html = html.replace("{{KL}}","No Keystrokes Stored.")
else:
switch = False
for line in d:
CURRENT_WINDOW = ''
TIME_WINDOW = ''
STROKES = ''
tabletorpl = ... | |
<reponame>DalavanCloud/muninn
#
# Copyright (C) 2014-2019 S[&]T, The Netherlands.
#
from __future__ import absolute_import, division, print_function
from muninn._compat import string_types as basestring
import copy
import datetime
import re
import uuid
import muninn.geometry as geometry
from muninn.enum import Enu... | |
"""
Copyright (c) Facebook, Inc. and its affiliates.
"""
import numpy as np
from collections import Counter
from build_utils import blocks_list_to_npy # , npy_to_blocks_list
##############################################
# WARNING: all npy arrays in this file are xyz
# not yzx
def maybe_convert_to_npy(blocks):
"""C... | |
| (bw << 6)
#print(value)
self.write_reg(self.REG_CTRL_REG6,value)
'''
@brief Set power mode
@param mode 16 power modes to choose from
HIGH_PERFORMANCE_14BIT #High-Performance Mode
CONT_LOWPWR4_14BIT #Continuous measurement,Low-Power Mode 4(14-bit resolution)
CONT_LOWPWR3_14BIT #Continuous measurement,Low-Pow... | |
desde
# una perspectiva de planta. Además se pasa el área que tiene el contorno que
# lo rodea
def detectar_examen(imagen):
#imagen -- foto tomada al examen leída con imread-opencv
#Funciones obtenidas del repositorio de openCV para detectar cuadros en
# la imagen
def angle_cos(p0, p1, p2):
d1, d2 = (p0-p1).as... | |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | |
<filename>deepsvg/svglib/svg_path.py
from __future__ import annotations
from .geom import *
import deepsvg.svglib.geom as geom
import re
import torch
from typing import List, Union
from xml.dom import minidom
import math
import shapely.geometry
import numpy as np
from .geom import union_bbox
from .svg_command import S... | |
<filename>wikifile/smw.py
'''
Created on 2021-03-07
@author: wf
'''
from __future__ import annotations
from typing import TYPE_CHECKING
from tabulate import tabulate
from wikifile.utils import Widget, Itemize, PageLink, WikiSon, SubObject, TemplateParam, SetProperties, SwitchFunction, \
MagicWord
if TYPE_CHECKING:... | |
r"""
Computation of the Frobenius polynomial using Newton's identities
"""
# *****************************************************************************
# Copyright (C) 2018 <NAME> <<EMAIL>>
# Distributed under the terms of the GNU General Public License (GPL)
# https://www.gnu.org/licenses/
# *******************... | |
{2} is consuming highest "
"({3}%) memory.".format(sid, server_name, user_name, mem_usage),
location_id)
self._monitor.get_os_operator().shutdown_hana(ssh, os)
Mu.log_info(self.__logger,
"HANA:{0} on {1} shutdown is processed.".format(sid, server_name),
location_id)
if email is not None and len(email) > 0:
# s... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import... | |
import json
import os
import yaml
from .constant import Constant
from .exceptions import \
SettingNotKnown, \
SettingTypeError
from .log import Log
SETTINGS = {
# RESERVED KEY, DO NOT USE: 'strict'
'apparmor': {
'type': bool,
'help': 'Enable/disable AppArmor',
'default': True,
},
'caasp_deploy_ses': {
'type... | |
consisting of two elements. The first
element is the minimum wavelength and the second element is the maximum wavelength. Wavelengths are
specified in micrometers (μm). The order of the specified array defines the order of the bands in the
data cube. If multiple bands match the wavelengths, all matched bands are inc... | |
ros_msg.topics:
pb_msg.topics.append(ros_msg_)
yield pb_msg
rospy.sleep(0.01)
class usb_cam_camera_infoServicer(ros_grpc.usb_cam_camera_infoServicer):
def __init__(self):
self.pub = None
self.Msg = roslib.message.get_message_class('sensor_msgs/CameraInfo')
def Publish(self, pb_msg, context):
if self.pub == ... | |
elevation file
Raises:
| No exception is raised.
"""
#obtain odd number of samples around equator 2*pi
if numSamplesAz % 2 == 0:
numSamplesAz += 1
azimuth = np.linspace(0,2 * np.pi, numSamplesAz)
#create twice to many elevation samples, then take every second
elevation2 = np.linspace(np.pi/2., -np.pi/2., num... | |
from pandac.PandaModules import *
from direct.showbase.PythonUtil import weightedChoice, randFloat, lerp
from direct.showbase.PythonUtil import contains, list2dict, clampScalar
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedSmoothNodeAI
from direct.distributed import Distri... | |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import logging
import os
from random import sample
import sys
from typing import Any, List, Optional, Union
impo... | |
"fr_FR": "Amsterdam",
"it_IT": "Amsterdam",
"ja_JP": "アムステルダム",
"ko_KR": "암스테르담",
"pl_PL": "Amsterdam",
"pt_BR": "Amsterdã",
"ru_RU": "Амстердам"
},
"AMSTERDAM_1": {
"de_DE": "Amsterdam",
"es_ES": "Ámsterdam",
"fr_FR": "Amsterdam",
"it_IT": "Amsterdam",
"ja_JP": "アムステルダム",
"ko_KR": "암스테르담",
"pl_PL": "Ams... | |
and phrases that are related to the provided
word lists will receive high scores while text that is unrelated will score lower.
The NLP scores report the percentage of words in a document that match
a list of words, which is called lexicon.
The matching is undertaken after stemming of the document and the lexicon.... | |
from typing import overload
from UdonPie import System
from UdonPie import UnityEngine
from UdonPie.Undefined import *
class Material:
def __new__(cls, arg1=None):
'''
:returns: Material
:rtype: UnityEngine.Material
'''
pass
@staticmethod
def op_Implicit(arg1):
'''
:param arg1: Object
:type arg1: UnityEn... | |
self.p_hmap,
self.p_oxcluster,
self.p_gumbel,
self.p_votes,
row([Div(text='<div class="horizontalgap" style="width:200px"><h2>Statistics</h2></div>'),
self.p_histogram_wave,self.p_histogram_calm,self.p_duration_heatmap]),
]),
column([self.user_id,
self.voting_table,
self.gumbel_choices,
self.help_text]),
]))... | |
<reponame>c-jo/pyinstaller<gh_stars>10-100
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2020, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# ... | |
= -1
else:
temp = GetUpstartEnabled(sc)
if temp is False:
Enabled = False
else:
# When GetUpstartEnabled returns "Complex", we assume that it
# is enabled (and we won't modify it).
Enabled = True
State = GetUpstartState(sc)
Path = "/etc/init/" + sc.Name + ".conf"
elif sc.Controller == "init":
if not Servic... | |
<gh_stars>0
import tensorflow as tf
from modeler.tfmodel import TFModel
class InceptionNetModel(TFModel):
def __init__(self):
self.slim = tf.contrib.slim
self.trunc_normal = lambda stddev: tf.truncated_normal_initializer(0.0, stddev)
pass
def add_placeholder(self):
batch_size = 32
height, width = 299, 299
... | |
},
"operation":"CREATE"
}
json_rule_all_traffic = {
"name":"All Traffic",
"action":"allow",
"mode":"edit",
"actionOptions":{
"ssl":"",
"serviceChain":""
},
"isDefault":True
}
json_rule_category_lookup_all = {
"type":"Category Lookup",
"options":{
"category":[],
"url":[]
}
}
json_rule_category_lookup_co... | |
import sys, os, warnings, email
from types import ClassType, ListType
from distutils import command, filelist, version
from distutils.cmd import Command
from distutils.core import Distribution, gen_usage, DEBUG
from distutils.errors import *
from distutils.fancy_getopt import FancyGetopt, wrap_text
try:
from distutils... | |
<reponame>michalogit/V-pipe<filename>workflow/scripts/testBench.py
#!/usr/bin/env python3
import os
import argparse
from alignmentIntervals import read_fasta
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
import sh
import numpy as np
import pandas as pd
__author__ = "<NAME>"
__lic... | |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
\descr: List of the clustering algorithms to be executed by the benchmark and accessory routines.
Execution function for each algorithm must be named "exec<Algname>" and have the following signature:
def execAlgorithm(execpool, netfile, asym, timeout, pathid='', se... | |
self.error = error
self.start_time = start_time
self.end_time = end_time
self.user = user
VapiStruct.__init__(self)
SubTaskInfo._set_binding_type(type.StructType(
'com.vmware.vcenter.lcm.sub_task_info', {
'progress': type.ReferenceType('com.vmware.cis.task_client', 'Progress'),
'last_updated_time': type.DateTi... | |
<reponame>scottwedge/openstack-cinder
# Copyright (c) 2014-2019 LINBIT HA Solutions GmbH
# 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/licen... | |
Element",
addresses=[0x02665CE2],
number_of_bytes=1,
min_value=Get_Element_Type(0, 0, 30),
max_value=Get_Element_Type(0, 0, 30),
is_little_endian=True, ),
Attribute(
name="Muchomon +DP",
addresses=[0x02665CE4],
number_of_bytes=2,
possible_values=Twenty_DP_Change,
is_little_endian=True,),
Attribute... | |
<reponame>amal029/eha<gh_stars>1-10
import sympy as S
import mpmath as poly
import numpy as N
class NoRealRoots(Exception):
pass
class ODE:
"""This class represents the ODEs and associated computation of time.
"""
MAX_QUANTA = 10**-3
NUM_TERMS = 5 # This should be adjustable
TRIG_FUNCS = [S.sin, S.cos, S.t... | |
# -*- coding: utf-8 -*-
"""
pysoundio.py
Play and Record Sound in Python using libsoundio
libsoundio is a C library for cross-platform audio input and output.
It is suitable for real-time and consumer software.
"""
import logging
import threading
import time
from pysoundio._soundio import ffi as _ffi
from pysoundio... | |
<reponame>MistSC/kaldi-pdnn-nctu-mllab<filename>run_timit/svae/VFAE.py<gh_stars>1-10
from __future__ import print_function
from collections import OrderedDict
import os
import sys
import timeit
import scipy.io as sio
import numpy as np
import theano
import theano.tensor as T
import nnet as nn
import criteria as er
i... | |
24
self.bg_qcolor = qcolor
a, b, _bg, cmap = self.lut
if qcolor is None:
self.lut = (a, b, None, cmap)
else:
self.lut = (a, b, np.uint32(QColor(qcolor).rgb() & 0xFFFFFF), cmap)
def set_color_map(self, name_or_table):
if name_or_table is self.cmap_table:
# This avoids rebuilding the LUT all the time
return
i... | |
+ 'stem']) + r')' + boundary, None, text)
if stem_matches:
if len(matches) <= len(stem_matches):
return (False, 0)
return (True, (len(matches) - len(stem_matches)) * item[select + 'score'])
return (True, len(matches) * item[select + 'score'])
if delete:
return text
return (False,... | |
<reponame>GreenStorm-Code/cloud-forensics-utils<filename>libcloudforensics/providers/azure/internal/account.py
# -*- coding: utf-8 -*-
# Copyright 2020 Google 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 co... | |
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | |
"""Interface to Sage accounting ODBC
This provides an interface to extract data from the accounting system.
It works by extracting the data into a Pandas dataframe and then doing queries from that.
"""
import json
import numpy as np
import pandas as pd
import pyodbc
import os
from dotenv import load_dotenv, find_do... | |
list(nn._feature_names)))
return unsafe
def calculate_thresh1(x, feature, target, debug=False):
try:
idx = target.index[target == 0][-1] #index of last zero
slope, intercept, r_value, p_value, std_err = stats.linregress(feature[(target.index > idx) & ~target.isnull()], target[(target.index > idx) & ~target.isnull... | |
= Constraint(expr=-m.x2502*m.x1016 + m.x1767 == 0)
m.c1901 = Constraint(expr=-m.x2502*m.x1021 + m.x1772 == 0)
m.c1902 = Constraint(expr=-m.x2502*m.x1026 + m.x1777 == 0)
m.c1903 = Constraint(expr=-m.x2502*m.x1031 + m.x1782 == 0)
m.c1904 = Constraint(expr=-m.x2502*m.x1036 + m.x1787 == 0)
m.c1905 = Constraint(expr=-m... | |
"""
# Data Structures and Algorithms - Part B
# Created by <NAME> (16021424)
"""
from tennis import Match
from tennis.Menu import Menu
from tennis.Menu import Builder
from tennis.Colours import Colours
from tools.QuickSort import quick_sort_score as QuickSort
from functools import partial
class MatchGender():
# Var... | |
= Var(within=Reals,bounds=(0,None),initialize=0.00111111111111111)
m.x3157 = Var(within=Reals,bounds=(0,None),initialize=0.00111111111111111)
m.x3158 = Var(within=Reals,bounds=(0,None),initialize=0.00111111111111111)
m.x3159 = Var(within=Reals,bounds=(0,None),initialize=0.00111111111111111)
m.x3160 = Var(within=Reals,b... | |
import esprit
from esprit import mappings
from octopus.core import app
import json as jsonlib
from datetime import datetime
import dateutil.relativedelta as relativedelta
import os, threading
from octopus.lib import plugin
from octopus.modules.es.initialise import put_mappings, put_example
class ESInstanceDAO(esprit.d... | |
<reponame>AXErunners/electrum-axe
#!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 <NAME>
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restric... | |
# Copyright 2018-2019 CNRS-UM LIRMM
#
# \author <NAME>
#
#
#
# pyQpController 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, either version 3 of the License,
# or (at your option) any later version.
... | |
<gh_stars>1-10
#!/usr/bin/env python
# coding: utf-8
# ## Consensus Signatures
#
# A consensus signature can be defined as a perturbation-specific summary profile acquired by aggregating replicate level information.
#
# ### - Consensus Datasets
#
# 1. Median Aggregation
# - consensus_median (whole plate normalizati... | |
url=url,
headers=headers)
response = self.send(request)
return response
#########################
# Download examples
#########################
def get_postman(self,
auth_type: str,
*,
token: str = None,
api_key: str = None,
username: str = None,
password: str = None,
**kwargs
) -> DetailedResponse:
... | |
+ torch.sqrt(-2 * tt * torch.log(2 * torch.sqrt(2 * torch.tensor(np.pi) * tt) * err)) # bound
# ks = torch.max(ks, torch.square(tt) + 1) # ensure bouhndary conditions are met
# kk = torch.arange(-4, 6) # we set K to be 10
# try:
# k = torch.tile(kk, (t.shape[0], 1)).cuda()
# except IndexError:
# k = kk.cuda()
# tt_vec ... | |
import sys
from pyHGT.data import *
from pyHGT.model import *
from warnings import filterwarnings
filterwarnings("ignore")
import argparse
parser = argparse.ArgumentParser(description='Training GNN on Author Disambiguation task')
'''
Dataset arguments
'''
parser.add_argument('--data_dir', type=str, default='./datas... | |
# coding: utf-8
"""
Memsource REST API
Welcome to Memsource's API documentation. To view our legacy APIs please [visit our documentation](https://wiki.memsource.com/wiki/Memsource_API) and for more information about our new APIs, [visit our blog](https://www.memsource.com/blog/2017/10/24/introducing-rest-apis-qa-wi... | |
</b> ' + str(X.shape[0]) + '</div>'
header += '<div> <b> Model: </b>' + fit_string + '</div>'
header += '<div> <b> Group: </b> CohortType '
htmls = header + ret.tables[0].to_html() + ret.tables[1].to_html()
return htmls
def crude_binomial_mixedML(df_merged, x_feature, y_feature,covars):
df_merged = df_merged.... | |
from matplotlib import colors
import numpy as np
import matplotlib.pyplot as plt
from pskf.tools.run import pythonmodule as pm
from pskf.tools.plot import plotarrays as pa
from pskf.scripts.errorplot import arrays as ea
###############################################################################
# Errorplot RMSE... | |
905299, 905329, 905339, 905347, 905381,
905413, 905449, 905453, 905461, 905477, 905491, 905497, 905507,
905551, 905581, 905587, 905599, 905617, 905621, 905629, 905647,
905651, 905659, 905677, 905683, 905687, 905693, 905701, 905713,
905719, 905759, 905761, 905767, 905783, 905803, 905819, 905833,
905843, 905897, 905... | |
<reponame>willingc/binderhub
"""
The binderhub application
"""
import asyncio
from concurrent.futures import ThreadPoolExecutor
import json
import logging
import os
import re
import json
from glob import glob
from urllib.parse import urlparse
import kubernetes.client
import kubernetes.config
from jinja2 import Environ... | |
<filename>rest_api/tests/unit/test_state_requests.py
# Copyright 2017 Intel Corporation
#
# 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
#
# Unle... | |
<reponame>HolmesNL/lir
import collections
import warnings
import numpy as np
from .calibration import IsotonicCalibrator
from .util import Xn_to_Xy, Xy_to_Xn, to_probability, LR
LrStats = collections.namedtuple('LrStats',
['avg_log2lr', 'avg_log2lr_class0', 'avg_log2lr_class1', 'avg_p0_class0', 'avg_p1_class0',
'a... | |
# -*- coding: utf-8 -*-
"""Master training script"""
__author__ = "<NAME>"
__copyright__ = "MIT"
import datetime
import os
import sys
import random
import json
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from torch.optim import SGD, Adam
from torch.utils.data import DataLoader
from torc... | |
= MiniSim.make_array()
assert self.set_uint8_a == init1[TEST_ARRAY_LEN - 1]
assert self.get_uint8_a == TEST_VALUE * 2
class get_set_array_element_int16(pyflamegpu.HostFunctionCallback):
def __init__(self):
super().__init__()
def run(self, FLAMEGPU):
init1 = MiniSim.make_array()
self.set_int16_a = FLAMEGPU.env... | |
test_broadcast_ipv4(self):
'''Send UDP Echo requests to IPv4 broadcast address (255.255.255.255).'''
# Start listening servers on nodes 2 and 4.
self.startWeavePing('node2', '--node-id 2 --fabric-id 1 --subnet 1 --listen')
self.startWeavePing('node4', '--node-id 4 --fabric-id 1 --subnet 1 --listen')
time.sleep(0.... | |
<reponame>mouton5000/DiscreteEventApplicationEditor
import lrparsing
from lrparsing import Keyword, List, Prio, Ref, Token, Opt
from arithmeticExpressions import ALitteral, Addition, Subtraction, Product, Division, EuclideanDivision, Modulo, \
Power, Func, UndefinedLitteral, Min, Max, globalsHeightExpression, globalsW... | |
<reponame>fridolinsiegmund/P4STA<filename>stamper_targets/netronome/netronome.py
# Copyright 2020-present <NAME>, <NAME>
#
# 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.... | |
{'date': 'dayd9', 'status': 'warning'},
{'date': 'dayd0', 'status': 'ok'},
{'date': 'dayd11', 'status': 'ok'},
{'date': 'dayd12', 'status': 'noexec'}
]},
{'name': 'name-a4', 'data': [
{'date': 'day1', 'status': 'warning'},
{'date': 'day2', 'status': 'ok'},
{'date': 'day3', 'status': 'ok'},
{'date': 'day4', 'st... | |
# Copyright 2016 Google 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 agreed to in writing, soft... | |
<filename>src/mframework/_mframework.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# ----------------------------------------------------------------------
# Copyright 2019-2020 Airinnova AB and the Model-Framework authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this f... | |
[]
for s, p, o in self.inferredFacts.triples((None, RDF.type, None)):
if s in unionClosureG.predicates() or\
s in [_s for _s, _p, _o in
unionClosureG.triples_choices(
(None,
RDF.type,
[OWL_NS.Class,
OWL_NS.Restriction]))]:
self.inferredFacts.remove((s, p, o))
return noNegFacts
def setupDescriptionLogicProgr... | |
<filename>kornia/augmentation/random_generator/random_generator.py
from typing import cast, Dict, Optional, Tuple, Union
import torch
from torch.distributions import Bernoulli
from kornia.geometry import bbox_generator
from kornia.utils import _extract_device_dtype
from ..utils import _adapted_beta, _adapted_samplin... | |
[flip_ax]
if self._Nv==6:
negate_comps = [5-ax,3+(4-ax)%3]
else:
raise Exception("Could not parse axis.")
print("{ 90 deg rotation around axis "+axis[-1]+" }")
if self._mask_vals is not None:
raise Exception("You should always call set_mask after rotate_90deg")
# mapping for the axis order in the... | |
<reponame>arunrordell/RackHD
"""
Copyright (c) 2017 Dell Inc. or its subsidiaries. All Rights Reserved.
A set of super-simple matchers to use to self-test the matching framework.
"""
from gevent import monkey
monkey.patch_dns()
monkey.patch_time()
monkey.patch_builtins()
monkey.patch_select()
import re
import sys
impo... | |
depth, lr_mul = 0.1):
super().__init__()
layers = []
for i in range(depth):
layers.extend([EqualLinear(emb, emb, lr_mul), leaky_relu()])
self.net = nn.Sequential(*layers)
def forward(self, x):
x = F.normalize(x, dim=1)
return self.net(x)
class RGBBlock(nn.Module):
def __init__(self, latent_dim, input_chann... | |
The query time range.
:type body: ~azure.ai.metricsadvisor.models.IngestionStatusQueryOptions
:param skip: for paging, skipped number.
:type skip: int
:param maxpagesize: the maximum number of items in one page.
:type maxpagesize: int
:keyword callable cls: A custom type or function that will be passed the direct... | |
bool:
"""Check if the binary tree is strict.
A binary tree is strict if all its non-leaf nodes have both the left
and right child nodes.
:return: True if the binary tree is strict, False otherwise.
:rtype: bool
**Example**:
.. doctest::
>>> from binarytree import Node
>>>
>>> root = Node(1)
>>> root.lef... | |
rekey_map[subprocess_stamp] is not None
}
# Log the subprocess timestamps that do not appear in our known list
unknown_keys = [
subprocess_stamp for subprocess_stamp in rekey_map.keys()
if rekey_map[subprocess_stamp] is None
]
if len(unknown_keys) > 0:
logging.getLogger(__name__).warning(
"The following timest... | |
set is
attached
.. attribute:: binding
bindings list
**type**\: list of :py:class:`Binding <ydk.models.cisco_ios_xr.Cisco_IOS_XR_policy_repository_oper.RoutingPolicy.Sets.ExtendedCommunitySegNh.Sets_.Set.Attached.Binding>`
"""
_prefix = 'policy-repository-oper'
_revision = '2015-11-09'
def __init__... | |
# Converts a Rule of Rose (PS2) I3D model file (.MDL) to OBJ.
import argparse
import argparse
import math
import numpy as np
import os
import sys
import struct
parser = argparse.ArgumentParser(description='''
Converts a Rule of Rose (PS2) I3D model file (.MDL) to OBJ.
''')
def err(msg):
print("Error: {}".format(msg... | |
tp2_2
+ Ad[3, 3] * tp2_3
)
values[n] = (
Phi0_0
* (
Phi1_0
* (
Phi2_0 * (coefs[i0 + 0, i1 + 0, i2 + 0])
+ Phi2_1 * (coefs[i0 + 0, i1 + 0, i2 + 1])
+ Phi2_2 * (coefs[i0 + 0, i1 + 0, i2 + 2])
+ Phi2_3 * (coefs[i0 + 0, i1 + 0, i2 + 3])
)
+ Phi1_1
* (
Phi2_0 * (coefs[i0 + 0, i1 + 1, i2 + 0])
+ Phi2_1 * (co... | |
of vectors
KL1 = get_KL(abs_sources[i,:], abs_sources[j,:])
KL2 = get_KL(abs_sources[j,:], abs_sources[i,:])
# Store symmetrised KL-divergence
pair_index = next(ind)
divergences[pair_index] = KL1 + KL2
return divergences
def err(sources, source_cov):
"""
Extract the error vector, F, of all errors to be min... | |
element
"""
return self.sub(words, alias=alias, **kwargs)
def w(self, words=None, role=None, **kwargs):
"""
Create a <W> element
:param words: Words to speak
:param role: Customize the pronunciation of words by specifying the word’s part of speech or alternate meaning
:param kwargs: additional attributes
:r... | |
book['ask_px1'])
self.assertEqual(0, book['ask_size1'])
self.assertEqual(b'', book['ask_provider1'][0])
np.savetxt('/tmp/book_eurusd_0014.csv', book, delimiter=',', fmt='%s')
# 7.) w <- different price/feed/quantity - all combinations as in i
# USD/CAD
# bids | asks
# [0] 2300000 @ 1.37 lp1 | [0] 1200000 @ 1.39... | |
Vivid Recall Of Past Experiences In Order To Predict The Outcome Of Future Choices And Events.",
"Isfjs Place A Great Emphasis On Personal Considerations. Extraverted Feelers Are Focused On Developing Social Harmony And Connection. This Is Accomplished Through Behaviors That Are Viewed As Socially Appropriate Or Benef... | |
section import *
from assembly import *
from step import *
from interaction import *
from load import *
from mesh import *
from job import *
from sketch import *
from visualization import *
from connectorBehavior import *
mdb.models['Model-1'].parts['Part-2'].setMeshControls(algorithm=ADVANCING_FRONT
, regions=mdb.mod... | |
command, output_file_path)
profraw_file_paths = []
if _IsIOS():
profraw_file_paths = [_GetProfrawDataFileByParsingOutput(output)]
elif _IsAndroid():
android_coverage_dir = os.path.join(BUILD_DIR, 'coverage')
for r, _, files in os.walk(android_coverage_dir):
for f in files:
if f.endswith(PROFRAW_FILE_EXTENSION)... | |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import statsmodels.api as sm
from sklearn.impute import SimpleImputer
from sklearn.compose import ColumnTransformer, make_column_selector
from sklearn.preprocessing import StandardScaler, MinMaxScaler, RobustScaler, On... | |
<gh_stars>1-10
import os
import os.path
import pickle
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
import tensorflow as tf
from keras.models import load_model
from scipy.stats import pearsonr
import tools_cython as tools
from utils import *
from mz_calculator import calc_all_fra... | |
the rootfs partition of the device."""
logging.info('Updating rootfs partition')
devserver_bin = os.path.join(self.device_dev_dir,
self.REMOTE_DEVSERVER_FILENAME)
ds = ds_wrapper.RemoteDevServerWrapper(
self.device, devserver_bin, self.is_au_endtoendtest,
static_dir=self.device_static_dir,
log_dir=self.device.wo... | |
"""Association mining -- apriori algo"""
__author__ = 'thor'
from numpy import *
# Modified from:
# <NAME> & <NAME> (https://github.com/cse40647/cse40647/blob/sp.14/10%20-%20Apriori.ipynb)
#
# Itself Modified from:
# <NAME> (https://gist.github.com/marcelcaraciolo/1423287)
#
# Functions to compute and extract associ... | |
<filename>pyaedt/q3d.py
"""This module contains these classes: ``Q2d``, ``Q3d``, and ``QExtractor`."""
from __future__ import absolute_import # noreorder
import os
import warnings
from collections import OrderedDict
from pyaedt.application.Analysis3D import FieldAnalysis3D
from pyaedt.generic.constants import MATRIXO... | |
#
# 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 writing, software
# distributed under the ... | |
from __future__ import print_function #kompatibilita s Python 2.7
import sys
# Implementacni test IB002 2016 - LTree (max 50 bodu)
#
# Vasi ulohou je implementovat ctyri funkce pro datovou strukturou "LTree".
# Muzete si samozrejme pridat vlastni pomocne funkce.
#
# LTree je datova struktura, ktera slouzi k ukladani ... | |
import numpy as np
import pandas as pd
import collect as clct
import constants
import db_operations as dbop
def _check_int(arg):
if type(arg) != int:
raise ValueError("{} is not a int".format(arg))
def _check_iterable(arg):
if not hasattr(arg, "__iter__"):
raise ValueError("{} is not iterable".format(arg))
d... | |
cas_models.ListAppgroupResponse:
"""
Description: 获取应用分组列表
Summary: 获取应用分组列表
"""
UtilClient.validate_model(request)
return cas_models.ListAppgroupResponse().from_map(
self.do_request('1.0', 'antcloud.cas.appgroup.list', 'HTTPS', 'POST', f'/gateway.do', TeaCore.to_map(request), headers, runtime)
)
async def li... | |
<reponame>cornell-brg/lizard
#=========================================================================
# inst_utils
#=========================================================================
# Includes helper functions to simplify creating assembly tests.
from pymtl import *
from tests.context import lizard
#-------... | |
<reponame>nnamua/meson-classification-checker
# SPDX-FileCopyrightText: 2021 <NAME>
#
# SPDX-License-Identifier: Apache-2.0
from buildfile import IGNORE_STRING, BuildFile
from typing import Union
from util import varname
import objects, functions, os
"""
This file specifies templates for each type. The dictionary 'te... | |
= self.params.init
sigma = self.params.sigmas
mins = self.params.mins
maxs = self.params.maxs
centers = self.params.centers
betas = self.params.betas
if not self.params.use_restraints or self.params.fix.ucell:
centers.ucell = [1,1,1,1,1,1]
betas.ucell = [1,1,1,1,1,1]
fix = self.params.fix
P = Parameters()
fo... | |
userdevice += 1
else:
if instance.auto_disk_config:
LOG.debug(_("Auto configuring disk, attempting to "
"resize partition..."), instance=instance)
instance_type = db.instance_type_get(ctx,
instance.instance_type_id)
VMHelper.auto_configure_disk(self._session,
first_vdi_ref,
instance_type['root_gb'])
VMHelper... | |
}
},
"value_expression": {
"type": "named",
"name": "test_named_expression"
}
},
context=factory_context
)
expression2 = ExpressionFactory.from_spec(
{
"type": "nested",
"argument_expression": {
"type": "array_index",
"array_expression": {
"type": "property_name",
"property_name": "indices"
},
"index_... | |
)
self.datTextureTreeBg.place(relx=0.5, rely=0.5, anchor='center')
self.datTextureTreeFiltersMsg = ttk.Label( self.datTextureTree, text='Either no textures were found, or you have them filtered out.', background='white' )
# Item highlighting. The order of the configs below reflects (but does not dictate) the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.