input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
of first to be used without reprojection
# as row/col coordinates of the second.
#
# Assumes second raster has sufficient extent.
# We could demand this, but in practice often read rasters well within their extents,
# because only looking at points within a watershed.
# """
# # may work, though may also fail - ... | |
"""
layers.py
------ BEGIN CODE FROM https://arxiv.org/abs/2101.08176
Introduction to Normalizing Flows for Lattice Field Theory
<NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
License: CC BY 4.0
With slight modifications by Xiao-Yong Jin to reduce global variables
"""
from __future__ import absolute_i... | |
= cllAngles_n[peakAngle_index]
peakAngle_index_cll = cllAngles_i[peakAngle_index]
peakAngle_location = dist_over_centerline(ppCh_phase,cl_point1=proxendcll,
cl_point2=n,type='euclidian') # distance from proximal end centerline
peakAngle_phases.append(peakAngle)
peakAngle_phases_location.append([peakAngle_inde... | |
thruProxy='False')
if _check_step_status(emr, job_flow_id, stepName, maxWaitSecs, cluster ) == 'COMPLETED':
# job completed ...
_print_step_metrics(cluster, 'perf_tp', usePipeline=True)
# GC log analysis for fusion api service _info("Starting gc log analysis")
gc_log_analysis_api(cluster)
def terminate_jobflow(e... | |
result = talib.EMA(self.close, timeperiod=n)
if array:
return result
return result[-1]
def dema(self, n: int, array: bool = False, log: bool = False) -> Union[float, np.ndarray]:
"""
Double Exponential Moving Average. 双指数移动平均线:两条指数移动平均线来产生趋势信号,较长期者用来识别趋势,较短期者用来选择时机。正是两条平均线及价格三者的相互作用,才共同产生了趋势信号。
"""
if log:
r... | |
identifier of the API element.
kindref: The kind of API element referred to.
"""
refid: str
kindref: str
def __init__(self, language_tag: str, refid: str, kindref: str, *contents: DescriptionElement):
super().__init__(language_tag, *contents)
self.refid = refid
self.kindref = kindref
def to_asciidoc(self, co... | |
'Energyz-v0': {
'forward_reward_weight': 1.0,
'ctrl_cost_weight': 0,
'energy_weights': 0,
},
'EnergyOne-v0': {
'forward_reward_weight': 1.0,
'ctrl_cost_weight': 0.1,
'energy_weights': 1.,
},
},
'HalfCheetahSquat2dof': { # 6 DoF
'Energyz-v0': {
'distance_weigth': 5.0,
'ctrl_cost_weight': 0,
'horizontal_w... | |
<reponame>NickChapman/humangen
#!/usr/bin/env python2.7
# coding=utf-8
'''
Parser for Abstract Meaning Represention (AMR) annotations in Penman format.
A *parsing expression grammar* (PEG) for AMRs is specified in amr.peg
and the AST is built by the Parsimonious library (https://github.com/erikrose/parsimonious).
The r... | |
import os
import path
import time
from pbmo.lib._libpbmo import Matrix, BoostMatrix
from pbmo.lib.pymatrix import cpMatrix, pyMatrix, npMatrix
from pbmo.lib.cumatrix import cuMatrix
from pbmo.lib.cublasmatrix import cublasMatrix
from pbmo.lib.numbamatrix import nbMatrix, nbparMatrix
# from pbmo.lib.numbamatrix import ... | |
'label': 'channel 0'},
'input_path_1': {'value': 1,
'ts': '2019-10-09 17:07:08',
'raw_value': 1,
'__class__': 'qcodes.instrument.parameter.Parameter',
'full_name': 'M4iInstrumentAdapter_spcm0_input_path_1',
'inter_delay': 0,
'instrument': 'qcodes_contrib_drivers.drivers.Spectrum.M4i.M4i',
'instrument_name': 'M4... | |
try:
json_['EchoTime%d' % i] = (load_json(json_basename +
'_magnitude%d.json' % i)['EchoTime'])
except IOError as exc:
lgr.error("Failed to open magnitude file: %s", exc)
# might have been made R/O already, but if not -- it will be set
# only later in the pipeline, so we must not make it read-only yet
was_readon... | |
'frame': 185, 'jobName': 'OneTaper3D'})
mdb.jobs['OneTaper3D']._Message(STATUS, {'totalTime': 0.67741375183381,
'attempts': 2, 'timeIncrement': 0.00154294925906893, 'increment': 185,
'stepTime': 0.67741375183381, 'step': 1, 'jobName': 'OneTaper3D',
'severe': 0, 'iterations': 1, 'phase': STANDARD_PHASE, 'equilib... | |
# 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 ... | |
""" Utilities for sympy. ***
SUffix conventions
*Arr - numpy array
*Mat - sympy.Matrix N X N
*Vec - sympy.Matrix N X 1
*s - list
Notes
1. By default, symbols are added to locals() of the caller.
This can be changed by using the dct optional keyword.
This means that all user callable functions must capture
the ... | |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may ch... | |
<filename>batchprocess.py
#from tkinter import *
#from tkinter import ttk
import tkinter.filedialog as filedialog
from tkinter import messagebox
from PIL import Image,ImageDraw,ImageFont
from PIL import ImageTk,ImageGrab
import cv2
from skimage import filters
import matplotlib.pyplot as pyplt
import numpy as np
from ... | |
from ..tokenizer_exceptions import BASE_EXCEPTIONS
from ...symbols import ORTH, NORM
from ...util import update_exc
_exc = {}
_abbrev_exc = [
# Weekdays abbreviations
{ORTH: "пн", NORM: "понедельник"},
{ORTH: "вт", NORM: "вторник"},
{ORTH: "ср", NORM: "среда"},
{ORTH: "чт", NORM: "четверг"},
{ORTH: "чтв", NORM:... | |
I1Ii111 % II111iiii
if 91 - 91: I11i % Ii1I - IiII + iIii1I11I1II1 * iIii1I11I1II1
if 91 - 91: i11iIiiIii + Ii1I
if 85 - 85: I11i % IiII
def lisp_api_ipc ( source , data ) :
return ( "api@" + str ( len ( data ) ) + "@" + source + "@@" + data )
if 68 - 68: Oo0Ooo . I1Ii111 - o0oOOo0O0Ooo * iIii1I11I1II1 - II111iiii... | |
the pore centers.
:param coord: the coordinates of the component(s) which you want a radial distribution of at each frame
:param pore_centers: a numpy array of the locations of each pore center at each trajectory frame
:param cut: cutoff distance for distance calculations. Will not count anything further than cut f... | |
only
# the modified
if self.action_type in ("dl","cr",):
fields = inst.fields + inst.foreignkeys
else: fields = [i.key for i in self.modification_commits.all()]
for field in fields:
if not nohtml:
text += "<strong>%s</strong>: " % field
else:
text += "%s: " % field
# If modified, show what it was like one s... | |
#!/usr/bin/env python
#################################################################
#
# qcVCF
# <NAME>
# Harvard Medical School
# <EMAIL>
#
#################################################################
#################################################################
#
# LIBRARIES
#
#########################... | |
def test_top_3_words_082(self):
self.assertEqual(top_3_words(
"uNA/rbsGjwZCM,;;: jcJIJna:!!.,jcJIJna:jcJIJna:/ "
"yIJluaT/yIJluaT:;uNA/sVBkdu! ?.:ePcY,"
"yIJluaT--_/tdFrNtAJ.JeFDufWml ..?.t'uNq:;tdFrNtAJ!?;?,"
"yIJluaT?;t'uNq, ; -ePcY!-.-.uvkaV_OubJ ?,"
"mLUADYDyCb;._-BDbNx-uNA-/ePcY:/;zeeTdN , WSpFPMTu,"
"BDbNx... | |
<reponame>rabbittsoup/distributed-benchmark-tool-exercise
"""client_test.py
Runs a simple server to collect messages from client.py, which is started in a separate process with a known \
random run time, chunk size, and maximum file size. The messages received are then validated against the \
known data. A START messa... | |
newtree.append(child.process_include_tags(
parser, includedir, follow))
return newtree
def as_etree(self):
tree = Element(self.name)
chunk = []
for child in self:
if isinstance(child, str):
chunk.append(child)
else:
append_text(tree, "".join(chunk))
chunk.clear()
tree.append(child.as_etree())
if chunk:
a... | |
from templates.modifiers import apply_modifiers_to_grammar
from templates.ruar_mods import get_all_modifiers
from templates.areyourobot_grammar import ARobotOrHuman, AHuman, ARobot, Lead, Outro, MaybeALead, LeadOrOut, \
add_trailing_space, safeneg_leads
from templates.common_rules import Adjective, PluralRobots, Plura... | |
is not None) and (end_doy is not None):
if end_doy < 1 or (end_doy > 366):
estr = ''.join(('Day of year (end_doy) is only valid ',
'between and including 1-366.'))
raise ValueError(estr)
end_date = dt.datetime.strptime(
"{:.0f} {:.0f}".format(end_yr, end_doy), "%Y %j")
self.load_step = end_date - date
elif (end... | |
<gh_stars>1000+
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | |
the coefficient has given shape. If no appropriate numbers
could be identified, ``None`` is returned
:rtype: ``tuple`` of two ``int`` values or ``None``
"""
dim=domain.getDim()
if len(shape)>0:
num=max(shape)+1
else:
num=1
search=[]
if self.definesNumEquation() and self.definesNumSolutions():
for u in range(... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=invalid-name
"""End-to-end test launcher."""
from __future__ import print_function
from __future__ import unicode_literals
import abc
import argparse
import difflib
import logging
import os
import shutil
import subprocess
import sys
import tempfile
try... | |
<reponame>cgarwood82/synapse<filename>synapse/storage/data_stores/main/room.py<gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance... | |
lambda_smeft_value**2,'.6e'), '# cledqAbs3x3x2x3'],
[3, 3, 3, 1, format(abs(scaled_wc('ledq_3331')) * lambda_smeft_value**2,'.6e'), '# cledqAbs3x3x3x1'],
[3, 3, 3, 2, format(abs(scaled_wc('ledq_3332')) * lambda_smeft_value**2,'.6e'), '# cledqAbs3x3x3x2'],
[3, 3, 3, 3, format(abs(scaled_wc('ledq_3333')) * lambda_s... | |
= resultBytes.Content[9:]
resultBytes.Content = buffer
return resultBytes
def ReadModBusAddressBase( self, address, length = 1 ):
'''读取服务器的数据,需要指定不同的功能码'''
command = self.BuildReadModbusAddressCommand( address, length )
if command.IsSuccess == False: return OperateResult.CreateFailedResult(command)
resu... | |
= point_offset_preds
ret['center_preds'] = (center_preds, sampled_indexes)
ret['center_semantic_preds'] = (center_semantic_preds, sampled_indexes)
ret['center_offset_preds'] = (center_offset_preds, sampled_indexes)
ret['point_features'] = output_feats
elif self.model_mode == 'Yu_refine_clustering_PointGroup':
... | |
<reponame>nnzhaocs/docker-performance
import sys
import os
from argparse import ArgumentParser
import time
import datetime
import random
import json
import yaml
from dxf import *
from collections import defaultdict
import socket
from concurrent.futures import ProcessPoolExecutor
from concurrent.futures import as_compl... | |
#!/usr/bin/python
# -*- coding: utf-8 -*-
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2002-2010 Prof. <NAME> (<EMAIL>) and the
# RMG Team (<EMAIL>)
#
# Permission is hereby granted, free of charge, to any person obtaining a
#... | |
from __future__ import print_function
import io_expectation as expect
from parameterized import parameterized, param
from six.moves import input
import sys
import unittest
import re
def AssertEquals(lhs, rhs):
if lhs != rhs:
raise AssertionError('Strings are not equals: %s != %s' % (lhs, rhs))
class IoExpectatio... | |
in range(self.n):
ki = 'a' + str(i)
retstr += "{k:<3s}: {v:>10.4f}\n".format(
k=ki, v=p[ki].value)
return retstr
else:
return "Nothing to report."
def calc_p0(self):
""" return p0 from input x, y
"""
if self._model == 'gaussian':
x, xdata = self._x, self._y
x0 = np.sum(x * xdata) / np.sum(xdata)
p0 = {
'... | |
"""
type_name = "redun.Traceback"
def __init__(self, error: Any, frames: List[FrameSummary], logs: Optional[List[str]] = None):
self.error: Any = error
self.frames = frames
self.logs: List[str] = logs or []
def __getstate__(self) -> dict:
return {
"error": self.error,
"frames": self.frames,
"logs": self.lo... | |
92567, 92569, 92581, 92593, 92623,
92627, 92639, 92641, 92647, 92657, 92669, 92671, 92681,
92683, 92693, 92699, 92707, 92717, 92723, 92737, 92753,
92761, 92767, 92779, 92789, 92791, 92801, 92809, 92821,
92831, 92849, 92857, 92861, 92863, 92867, 92893, 92899,
92921, 92927, 92941, 92951, 92957, 92959, 92987, 92993,
... | |
t.save()
t['depends'].remove(dependency2)
t.save()
self.assertEqual(t['depends'], LazyUUIDTaskSet(self.tw, [dependency1['uuid']]))
def test_add_to_dependency_set(self):
# Adds dependency to task with one dependencies
t = Task(self.tw, description='test task')
dependency1 = Task(self.tw, description='needs to ... | |
<reponame>killapop/hypha
import re
from datetime import timedelta
from bs4 import BeautifulSoup
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.test import RequestFactory, TestCase, override_settings
from django.urls i... | |
<gh_stars>1-10
#!/usr/bin/python
#
# nterprise TAPS Phone Deployment Service
# Version: 1.2.1
#
# 2018-05-31 - Added interactive bot functionality with /commands
#
# Written by: <NAME>
# Email: <EMAIL>
# Copyright 2018 Zones nfrastructure
#
# This program can be used to deploy enhanced TAPS-like deployment ... | |
<reponame>pombredanne/github.com-FFY00-pkgcheck
#!/usr/bin/env python
#
# 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 app... | |
').replace('\r', ' ')
r14c1 = request.POST.get('r14c1').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r14c2 = request.POST.get('r14c2').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r14c3 = request.POST.get('r14c3').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ')
r14c4 = request.POST.... | |
# Copyright 2021 University College London. 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 applicab... | |
is the value of variable at location for all simulations.
#Refresh lists that change per image.
R,Z = ProbeLoc[0],ProbeLoc[1]
Trend = list()
Xaxis = list()
#For all simulation folders.
for l in range(0,numfolders):
#Extract image with given process and variable name.
Image = ImageExtractor2D(Data[l][proce... | |
range.e.r = cell.r;
if(range.e && cell.c > range.e.c) range.e.c = cell.c;
if(options.sheetRows && lastcell.r >= options.sheetRows) cell_valid = false;
else out[last_cell] = line;
}
var opts = {
enc: false, // encrypted
sbcch: 0, // cch in the preceding SupBook
snames: [], // sheetnames
sharedf: shared_f... | |
by the token
network contract to verify the secret expiry and calculate the token amounts to transfer.
"""
if len(end_state.merkletree.layers[LEAVES]) == 0: # pylint: disable=len-as-condition
return None
lockhashes_to_locks = dict()
lockhashes_to_locks.update({
lock.lockhash: lock
for secrethash, lock in end_... | |
<reponame>fhoeb/py-tmps<filename>tmps/star/propagator/mps_4o_propagator.py
"""
Container object for MPS fourth order trotter time evolution operators
"""
import mpnum as mp
from scipy.linalg import expm
from tmps.utils.swap import get_swap_mpo
from tmps.star.propagator.propagator_base import StarMPPropagatorBase
cla... | |
"""
=================================
Travelling Salesman Problem (TSP)
=================================
Implementation of approximate algorithms
for solving and approximating the TSP problem.
Categories of algorithms which are implemented:
- Christofides (provides a 3/2-approximation of TSP)
- Greedy
- Simulated A... | |
<filename>node/routingtable.py
"""
Interface and implementation of a Kademlia routing table.
Classes:
RoutingTable -- Interface
OptimizedTreeRoutingTable -- Implementation
"""
from abc import ABCMeta, abstractmethod
import logging
import time
from node import constants, guid, kbucket
class RoutingTable(object):
... | |
from wand.image import Image as WandImage
from wand.color import Color as WandColor
import io
from webclient.models import User, Labeler, Image, ImageLabel, CategoryLabel
from django.conf import settings
import re
import wand.exceptions
import os
from PIL import Image as PILImage
import numpy
import SVGRegex
from webcl... | |
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import io
import os
import unittest
import unittest.mock
import ipywidgets as widgets
import matplotlib.pyplot as plt
i... | |
#
# Group Chat Server
#
# Copyright (C) 2019 Internet Real-Time Laboratory
#
# Written by <NAME> <<EMAIL>>
#
import re
import os
import shlex
import types
import time
import json
import sqlite3
import traceback
import pjsua2 as pj
import time
from types import SimpleNamespace
from email.utils import formatdate, parsead... | |
<filename>lib_scimeta/src/d1_scimeta/util.py<gh_stars>10-100
import inspect
import io
import logging
import os
import pprint
import re
import urllib
import urllib.parse
import lxml
import lxml.etree
import d1_common.iter
import d1_common.iter.path
import d1_common.util
import d1_common.utils.filesystem
import d1_comm... | |
% unpack('<L', valueData)[0]
elif valueType == rrp.REG_QWORD:
print '0x%x' % unpack('<Q', valueData)[0]
elif valueType == rrp.REG_NONE:
try:
if len(valueData) > 1:
print ''
hexdump(valueData, '\t')
else:
print ' NULL'
except:
print ' NULL'
elif valueType == rrp.REG_MULTI_SZ:
print '%s' % valueData.decode('... | |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use... | |
import FWCore.ParameterSet.Config as cms
digiSamples_ = [1,2,3,4,5,6,7,8,9,10]
uncalibOOTAmps_ = [4,6]
ecalGpuTask = cms.untracked.PSet(
params = cms.untracked.PSet(
runGpuTask = cms.untracked.bool(False),
gpuOnlyPlots = cms.untracked.bool(True),
uncalibOOTAmps = cms.untracked.vint32(uncalibOOTAmps_)
),
MEs = c... | |
<reponame>yangjourney/sosotest<filename>AutotestFramework/threads/mainTCPThreads.py
# import threading
# from core.tools.DBTool import *
# from core.tools.RedisTool import *
# from core.const.Do import *
# from core.const.Protocol import *
# from runfunc.runGlobalVars import isCluster
# from runfunc.initial import *
# ... | |
<filename>simbdp3/adultery.py
#!/usr/bin/python3
__version__ = '0.0.11' # Time-stamp: <2021-10-26T07:53:12Z>
## Language: Japanese/UTF-8
"""Simulation Buddhism Prototype No.3 - Adultery
不倫関連
"""
##
## Author:
##
## JRF ( http://jrf.cocolog-nifty.com/statuses/ (in Japanese))
##
## License:
##
## The a... | |
<reponame>windskyer/k_nova<filename>paxes_nova/virt/ibmpowervm/ivm/common.py<gh_stars>0
#
#
# 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/li... | |
#!/usr/bin/env python3
"""Tools to submit multiple jobs to the cluster.
"""
# Copyright 2021 jhauschild, MIT License
# I maintain this file at https://github.com/jhauschild/cluster_jobs in multi_yaml/
# requires Python >= 3.5
import pickle
import subprocess
import os
import sys
import warnings
import importlib
from ... | |
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import os
import sys
import errno
from datetime import datetime
from collections import OrderedDict
from matplotlib.backends.backend_pdf import PdfPages
from readcsv import readvalues_activelatencyboxplot, readvalues_activebandwidthboxplot, \
readv... | |
<gh_stars>1-10
# -*- coding: utf-8 -*-
# Copyright 2009-2013, <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.org/licenses/LICENSE-2.0
#
# Unless required by app... | |
key.split('_')
frame['nonCate_slot_key_words'] = set(frame['nonCate_slot_key_words'])
frame['Cate_slot_key_words'] = []
for key in frame['slots_Cate']:
frame['Cate_slot_key_words'] += key.split('_')
frame['Cate_slot_key_words'] = set(frame['Cate_slot_key_words'])
frame['re... | |
"LI",
"LT",
"LU",
"LV",
"MA",
"MC",
"MT",
"MX",
"MY",
"NI",
"NL",
"NO",
"NZ",
"OM",
"PA",
"PE",
"PH",
"PL",
"PS",
"PT",
"PY",
"QA",
"RO",
"SA",
"SE",
"SG",
"SK",
"SV",
"TH",
"TN",
"TR",
"TW",
"US",
"UY",
"VN",
"ZA"
],
"external_urls": {
"spotify": "https://open.spotify.com/album/0C... | |
self.bin2str(newb)
return newpayload
def cModify(self, clientQ):
if self.action == 'Random':
clientQ[self.mpacNum - 1].payload = self.randomize(clientQ[self.mpacNum - 1].payload)
elif self.action == 'Invert':
clientQ[self.mpacNum - 1].payload = self.bitInv(clientQ[self.mpacNum - 1].payload)
elif self.action =... | |
from math import ceil, floor
import numpy as np
from cplex import Cplex, SparsePair, infinity as CPX_INFINITY
from .coefficient_set import CoefficientSet
from .utils import print_log
#todo: add loss cut
#todo: add constraint function
#todo: default cplex parameters
#todo: check cores
#todo: pass compute_loss to conver... | |
<filename>osbs/utils/__init__.py
"""
Copyright (c) 2015 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import print_function, absolute_import, unicode_literals
from functools import wraps
import c... | |
'''
Created on Mar 24, 2011
@author: ATIA1555
'''
import math as m
class Cone_Check:
'''
classdocs
'''
def __init__(self):
'''
Constructor
'''
self.dmin = 0.0
self.dmax = 0.0
self.h = 0.0
self.tmin = 0.0
self.tmax = 0.0
self.tc = 0.0
self.pmin = 0.0
self.mmin = 0.0
self.pmax = 0.0
self.mmax = 0.0
... | |
beta,
epsilon=self.epsilon,
data_format=self._data_format)
def _fused_batch_norm_inference():
return nn.fused_batch_norm(
inputs,
gamma,
beta,
mean=self.moving_mean,
variance=self.moving_variance,
epsilon=self.epsilon,
is_training=False,
data_format=self._data_format)
output, mean, variance = utils.smart... | |
= "{}_median_{}".format(dbg_str, median_filter_size)
min_t, max_t = min(min_t, max_t), max(min_t, max_t)
mask = cv2.inRange(c, min_t, max_t)
stored_string = "{}_min_{}_max{}".format(dbg_str, min_t, max_t)
return mask, stored_string
def remove_hor_noise_lines(self, **kwargs):
min_line_size = kwargs.g... | |
<filename>data_utils.py
from __future__ import division
from __future__ import print_function
import numpy as np
import pandas as pd
import scipy.sparse as sp
import random
import pdb
# For automatic dataset downloading
from urllib.request import urlopen
from zipfile import ZipFile
import shutil
import o... | |
# TODO All MSOA codes are unique
# TODO Locations have 'Danger' and 'ID' columns
# TODO Number of destination columns ('Loc_*') matches number of locaitons
# TODO Number of origins (rows) in the flow matrix matches number of OAs in the locations
return
@classmethod
def _add_location_columns(cls, locations: pd.Da... | |
output would include this
caption. For formats such as DokuWiki and LaTeX, it is fairly obvious how to
add the table caption, and for the other formats, the caption is added as
plain text on top of the actual table, wrapped to not have endless lines.
.. code-block::
ds = dataset.Dataset()
ds.data.data = np.random.... | |
<reponame>bbahiam/OpenAeroStruct
from __future__ import division, print_function
import numpy as np
from openaerostruct.geometry.utils import generate_mesh
from openaerostruct.integration.aerostruct_groups import AerostructGeometry, AerostructPoint
from openmdao.api import IndepVarComp, Problem, Group, SqliteRecorde... | |
<filename>isi_sdk_8_2_0/isi_sdk_8_2_0/models/performance_settings_settings.py
# coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 7
Contact: <EMAIL>
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noq... | |
<filename>messenger/views.py
import csv
import datetime
import io
import re
from django.apps import apps
from django.conf import settings
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.mixins import UserPassesTestMixin
from django.contrib.auth.mod... | |
# -*- coding: utf-8 -*-
"""Exposes the caffe solvers."""
# pylint: disable=E1101, F0401, C0103, R0913, R0914, W0212, E1121, E0611, W0406
# pylint: disable=duplicate-code, too-many-lines
from __future__ import print_function
from . import monitoring as _monitoring
from . import parallel as _parallel
# CAREFUL! This mus... | |
<filename>functions/utils.py
import pandas as pd
import numpy as np
import re
import cv2
import imageio
import keras
import numpy as np
import nibabel as nib
import streamlit as st
import category_encoders as ce
import matplotlib.pyplot as plt
from IPython.display import Image
from keras import backend as K
from keras... | |
for more information: [Key Types](https://www.vaultproject.io/docs/secrets/transit#key-types)
"""
if allow_plaintext_backup is not None:
pulumi.set(__self__, "allow_plaintext_backup", allow_plaintext_backup)
if backend is not None:
pulumi.set(__self__, "backend", backend)
if convergent_encryption is not None:
pu... | |
multicast_port == DEVICE_INFO_PORT
):
lock_status = parse_message_type_lock_status(dante_message)
parsed_message_redis_hash["message_type_string"] = parsed_message[
"message_type_string"
] = MESSAGE_TYPE_STRINGS[message_type]
# print(
# f"{src_host}:{src_port} -> {multicast_group}:{multicast_port} type `{message... | |
control plane compatible with Data ONTAP 8.1 operating in
Cluster-Mode.
<li> <[vserver:]volume>
On Data ONTAP 8.2 or later operating in Cluster-Mode except
for relationships using a control plane compatible with Data
ONTAP 8.1 operating in Cluster-Mode. This format depends
on the Vserver peering setup betwe... | |
("resnet101", ".layer3.Bottleneck0", 5, 7, 7, True),
("resnet101", ".layer3.Bottleneck2", 5, 7, 7, True),
("resnet101", ".layer3.Bottleneck6", 5, 7, 7, True),
("resnet101", ".layer3.Bottleneck10", 5, 7, 7, True),
("resnet101", ".layer3.Bottleneck14", 5, 7, 7, False),
("resnet101", ".layer3.Bottleneck18", 5, 7... | |
<gh_stars>0
# Gearshift.py - monitors the rFactor 2 shared memory values for the shifter
# and clutch and if a gear change is not done properly it repeatedly sends a
# "Neutral" key press to prevent the gear being selected.
#
# Inspired by http://www.richardjackett.com/grindingtranny
# I borrowed Grind_default.wav from... | |
iprot.readString();
else:
iprot.skip(ftype)
else:
iprot.skip(ftype)
iprot.readFieldEnd()
iprot.readStructEnd()
def write(self, oprot):
if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None:
oprot.trans.write(fastbinary.encode_binary(self, ... | |
self.stack.pop()
# value2 = self.stack.pop()
# self.stack.push(value1)
# self.stack.push(value2)
raise NotImplementedError("swap")
def opcode_0x60(self):
"iadd"
value2 = self.stack.pop()
value1 = self.stack.pop()
self.stack.push(self.intmask(value1 + value2))
def opcode_0x61(self):
"ladd"
value2 = self.st... | |
import datetime
from os import startfile, system
from pathlib import Path
from random import randint
from sys import exit as sysend
class Functions:
def __init__(self):
self.log_prefix = self.log_dated_names()
self.home_path = Path.home()
self.taskymain_path = self.home_path / "Tasky"
self.tasks_path = self.task... | |
2
elif self.agentEmotion == "happy":
cv2.line(self.faceCanvas,(self.baseMouth_X1,self.baseMouth_YHigh),(self.baseMouth_X2,self.baseMouth_Y),self.mouthColor,mouthWidth)
cv2.line(self.faceCanvas,(self.baseMouth_X2,self.baseMouth_Y),(self.baseMouth_X3,self.baseMouth_YHigh),self.mouthColor,mouthWidth)
elif self... | |
config_cmd == '':
if peergroup != '':
my_cmd += 'neighbor {} peer-group\n'.format(peergroup)
if conf_peers != '':
my_cmd += '{} bgp confederation peers {}\n'.format(config_cmd, conf_peers)
if conf_identf != '':
my_cmd += '{} bgp confederation identifier {}\n'.format(config_cmd, conf_identf)
for type1 in config_... | |
externally created or using
Load_Input_File() function in this module.
:return: var_sub_list, element_export_list, export_data
1. var_sub_list = list of state variables to be exported for elements in element_export_list. Default=None if
user has no preferences, meaning later it will include all state variables for... | |
<reponame>ZeroHarbor/blockstack-storage-drivers
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2014-2015 by Halfmoon Labs, Inc.
Copyright (c) 2016 by Blocktatck.org
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated d... | |
import math
import torch
from torch import nn
import matplotlib.pyplot as plt
import numpy as np
import os.path
from matplotlib.lines import Line2D
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.patches as patches
import pandas as pd
import seaborn as sns
import gpytorch
import copy
import matplotlib as mpl
... | |
"""Flask-SQLAlchemy-based database ORM models.
Copyright 2016 AURA/LSST.
Copyright 2014 <NAME>.
"""
from __future__ import annotations
import enum
import urllib.parse
import uuid
from datetime import datetime
from typing import Any, List, Optional, Type, Union
from cryptography.fernet import Fernet
from flask impor... | |
Turns on debugging to the specified level.
no_area : bool, optional
Indicates that no area images are present (assumes equal weighting for
each data pixel)
status_file : str, optional
mBackground output and errors will be written to status_file instead
of stdout.
'''
command = "mBackground"
if debug_level:
... | |
= roslib.message.get_message_class('dynamic_reconfigure/DoubleParameter')()
ros_msg_.name = pb_msg_.name
ros_msg_.value = pb_msg_.value
ros_msg.min.doubles.append(ros_msg_)
for pb_msg_ in pb_msg.min.groups:
ros_msg_ = roslib.message.get_message_class('dynamic_reconfigure/GroupState')()
ros_msg_.name = pb_msg_.nam... | |
#!/usr/bin/env python
# pylint: disable=W0622
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2021
# <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the Free Soft... | |
for part in parts:
if level == 0:
new_parts.extend(self.merge_fixed_omnipresent_at_pos(part))
elif level == 1:
new_parts.extend(self.merge_fixed_only_present_at_pos(part))
else:
raise ValueError('Level out of range (%d)' % level)
if self.verbose:
print('\nOUT:')
print(self.aligned_parts(new_parts))
return new... | |
from __future__ import unicode_literals
import inspect
import logging
from mogwai._compat import array_types, string_types, add_metaclass, integer_types, float_types
from mogwai import connection
from mogwai.exceptions import MogwaiException, ElementDefinitionException, MogwaiQueryError
from mogwai.gremlin import Grem... | |
<filename>semanticGAN/train_enc.py
"""
Copyright (C) 2021 NVIDIA Corporation. All rights reserved.
Licensed under The MIT License (MIT)
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 rest... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.