input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
<reponame>rohitsupekar/learn-PDEs-from-data
import numpy as np
import logging
import pandas as pd
import time
import matplotlib
import matplotlib.pyplot as plt
import seaborn as sns
from joblib import Parallel, delayed
import pickle as pkl
from tqdm import tqdm
import copy
from sklearn import preprocessing
from pdel.so... | |
import numpy as np
import cv2
def applyThresh(image, thresh=(0,255)):
"""
Apply threshold to binary image. Setting to '1' pixels> minThresh & pixels <= maxThresh.
"""
binary = np.zeros_like(image)
binary[(image > thresh[0]) & (image <= thresh[1])] = 1
return binary
def S_channel(image):
"""
Returns the Satura... | |
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing perm... | |
def module_extensions():
class H2OAutoEncoderEstimator(H2ODeepLearningEstimator):
"""
:examples:
>>> import h2o as ml
>>> from h2o.estimators.deeplearning import H2OAutoEncoderEstimator
>>> ml.init()
>>> rows = [[1,2,3,4,0]*50, [2,1,2,4,1]*50, [2,1,4,2,1]*50, [0,1,2,34,1]*50, [2,3,4,1,0]*50]
>>> fr = ml.H2OFra... | |
api calls.
"""
if not is_enum(family, DeviceFamily):
raise ValueError('family Parameter must be of type int, str or DeviceFamily enumeration.')
family = decode_enum(family, DeviceFamily)
family = ctypes.c_int(family)
result = self._lib.NRFJPROG_select_family_inst(self._handle, family)
if result != NrfjprogdllE... | |
# -*- coding: utf-8 -*-
# Copyright 2019 the HERA Project
# Licensed under the MIT License
"""Module for applying calibration solutions to visibility data, both in memory and on disk."""
import numpy as np
import argparse
import copy
import warnings
from . import io
from . import version
from . import utils
from . im... | |
<reponame>CareerVillage/slack-moderation
# -*- coding: utf-8 -*-
from datetime import datetime
import json
import pprint
import re
import requests
import traceback
from django.http import HttpResponse
from accounts.models import AuthToken
from moderations.models import Moderation, ModerationAction
from moderations.uti... | |
<reponame>devops786/awx-demo<filename>awx/main/models/rbac.py
# Copyright (c) 2016 Ansible, Inc.
# All Rights Reserved.
# Python
import logging
import threading
import contextlib
import re
# Django
from django.db import models, transaction, connection
from django.contrib.contenttypes.models import ContentType
from dj... | |
return render_template("accountmgmt/updatename.html", openActions=countActions(), firstname=firstname)
if newName == firstname:
flash('that is not a new name...')
return render_template("accountmgmt/updatename.html", openActions=countActions(), firstname=firstname)
# Update the user's name
db.execute("UPDATE user... | |
import json, zlib, time, random, sys, traceback
PY3 = sys.version_info >= (3,)
PY2 = sys.version_info < (3,)
if PY3:
from urllib.error import HTTPError, URLError
from urllib.request import urlopen, Request
import urllib.request, urllib.parse, urllib.error
from urllib.parse import quote
else:
from urllib2 import ... | |
allocate_public_address(
self,
) -> typing.Optional[typing.Union[builtins.bool, ros_cdk_core.IResolvable]]:
'''Property allocatePublicAddress: Whether to allocate a public network address.'''
result = self._values.get("allocate_public_address")
return typing.cast(typing.Optional[typing.Union[builtins.bool, ros_cdk... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File: rename.py
# Author: ernitron (c) 2017
# Mit License
import os
import sys
import re
Version = "1.4.2"
# To print colored text on term
RED = ''
BLUE = ''
CYAN = ''
GREEN = ''
RESET = ''
BOLD = ''
REV = ''
def color():
global RED, BLUE, CYAN, GREEN, RESET, BOLD, ... | |
from templates import *
import os
class NedTheoryFrame(EcceFrame):
def __init__(self, parent, title, app, helpURL=""):
EcceFrame.__init__(self, parent, title)
panel = NedTheoryPanel(self, helpURL)
self.Finalize()
class NedTheoryPanel(EccePanel):
def __init__(self,parent,helpURL=""):
EccePanel.__init__(self, pa... | |
will be used!
"""
print 'writing an Aurelia User Info File:\n ', fileName
print 'We always use the following format for the User Info Files:'
print ' # 8.17 NH 7 2FMR'
print ' # ppm atomname residuenumber segid'
print ' segid should contain 4 letters or 4 spaces'
auihandle = TextFile.TextFile(fileName, 'w')
for... | |
<filename>src/Tools/CodeGenerator/Plugins/SharedLibraryPlugin.py
# ----------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License
# ----------------------------------------------------------------------
"""Contains the ... | |
"BUNTS",
"BUNTY",
"BUNYA",
"BUOYS",
"BUPPY",
"BURAN",
"BURAS",
"BURBS",
"BURDS",
"BURET",
"BURFI",
"BURGH",
"BURGS",
"BURIN",
"BURKA",
"BURKE",
"BURKS",
"BURLS",
"BURNS",
"BUROO",
"BURPS",
"BURQA",
"BURRO",
"BURRS",
"BURRY",
"BURSA",
"BURSE",
"BUSBY",
"BUSES",
"BUSKS",
"BUSKY",
"BUSSU",
... | |
error_checking.assert_is_numpy_array(
numpy.asarray(field_names_grib1),
exact_dimensions=numpy.array([num_fields]))
# Find grid points for model.
grid_point_x_metres, grid_point_y_metres = (
nwp_model_utils.get_xy_grid_points(
model_name=model_name, grid_name=grid_id)
)
# Project query points to model coords.... | |
"""
@author: <NAME> <<EMAIL>>
"""
from array import array
import unittest
from genty import genty, genty_dataset
from auditok.io import (
AudioParameterError,
BufferAudioSource,
RawAudioSource,
WaveAudioSource,
)
from auditok.signal import FORMAT
from test_util import PURE_TONE_DICT, _sample_generator
def audio_s... | |
return parse_float_vector(self._raw_data.get('flare05_sizes', ""))
@property
def Flare05_color(self):
return parse_int_vector(self._raw_data.get('flare05_color', ""))
@property
def Flare06_texture(self):
return self._raw_data.get('flare06_texture', "")
@property
def Flare06_params(self):
return self._raw_da... | |
<reponame>paaksing/ayolo<filename>ayolo/window.py
import sys
from functools import partial
from pathlib import Path
from typing import List, Tuple
from PyQt5 import QtWidgets, QtCore, QtGui
from darktheme.widget_template import DarkPalette
from .background import Background
from .utilities import PropagableLineEdit
... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
:Autors: <NAME> & <NAME>
Module encapsulating all the classes required to run a simulation.
"""
import sys
sys.path.append("../solver")
import numpy as np
import math
import random as rand
from weatherTLKT import Weather
import matplotlib.pyplot as plt
from mpl_to... | |
<reponame>BramKaashoek/commercetools-python-sdk
# DO NOT EDIT! This file is automatically generated
import datetime
import typing
from commercetools.types._abstract import _BaseType
if typing.TYPE_CHECKING:
from ._channel import ChannelReference
from ._common import LocalizedString, Price, PriceDraft, Reference, R... | |
data.text not in ["condition-true", "condition-false"]:
logging.warning(
"Invalid value for key 'control': {}".format(data.text),
data.sourceline,
)
elif key == witness.STARTLINE:
self.check_linenumber(data.text, data.sourceline)
elif key == witness.ENDLINE:
self.check_linenumber(data.text, data.sourceline)
el... | |
"""
The trained 1900-dimensional mLSTM babbler.
From the UniRep Paper [Alley2019]
"""
import tensorflow.compat.v1 as tf
tf.disable_v2_behavior()
import tensorflow_addons as tfa
import tensorflow_probability as tfp
import numpy as np
import pandas as pd
import sys
sys.path.append('../')
from utils import aa_seq_to_int,... | |
in enumerate(layers):
h = misc.CaptureLayerOutput(post_process=None)
_ = self.module_layer._modules[l].register_forward_hook(h)
self.activation_hooks.append(h)
r'''
This object will be used to combine all the saliency maps together after we compute them.
'''
self.combine_maps = CombineSaliencyMaps(output_siz... | |
<reponame>siduojiang/BERTVision
###########################################################################################################
## IMPORTS
###########################################################################################################
import os
import math
import numpy as np
import pandas as pd
... | |
""" Module for calculating pseudoinverses. """
from sympy import *
class Calculator:
@staticmethod
def load_matrix(m, n):
"""
Returns the matrix which user gives as input or None if the input is incorrect.
"""
matrix = []
for i in range(m):
matrix.append(input().split())
if len(matrix[i]) != n:
return None... | |
if weight is None or weight.node().mustBeNone():
assert len(input_sizes) > 1
weight_value = torch.tensor([1.] * input_sizes[1]).type(
'torch.' + input.type().scalarType() + 'Tensor')
weight = g.op("Constant", value_t=weight_value)
if bias is None or bias.node().mustBeNone():
assert len(input_sizes) > 1
bias_valu... | |
identifier for the identity.
- name: --microsoft-graph-identity-application
short-summary: "identity"
long-summary: |
Usage: --microsoft-graph-identity-application display-name=XX id=XX
display-name: The identity's display name. Note that this may not always be available or up to date. For \
example, if a ... | |
<gh_stars>0
#### Created as part of the Metro21 Fire Risk Analysis project
#### In partnership with the City of Pittsburgh's Department of Innovation and Performance, and the Pittsburgh Bureau of Fire
# Authors:
# <NAME>
# <NAME>
# <NAME>
# <NAME>
# <NAME>
# <NAME>
# <NAME>
#importing relevant libraries
import matpl... | |
QtGui.QPushButton(self.gb_ETFOrder_4)
self.gb_pb_sell_volume_row_4_4.setGeometry(QtCore.QRect(210, 60, 31, 23))
font = QtGui.QFont()
font.setFamily(_fromUtf8("Book Antiqua"))
font.setPointSize(8)
self.gb_pb_sell_volume_row_4_4.setFont(font)
self.gb_pb_sell_volume_row_4_4.setStyleSheet(_fromUtf8("QPushButton { bor... | |
ideograph
0x275E3B: (0x9508, 0), # East Asian ideograph
0x21574E: (0x521D, 0), # East Asian ideograph
0x6F5859: (0xCAC0, 0), # Korean hangul
0x233651: (0x8CBA, 0), # East Asian ideograph
0x233652: (0x8CB5, 0), # East Asian ideograph
0x213653: (0x553E, 0), # East Asian ideograph
0x213654: (0x5563, 0), # East Asia... | |
self.input)
raise eee
cnt17 += 1
retval.stop = self.input.LT(-1)
retval.tree = self._adaptor.rulePostProcessing(root_0)
self._adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop)
except RecognitionException, re:
self.reportError(re)
self.recover(self.input, re)
retval.tree = self._adapt... | |
C++ signature :
void _set_input_arrays(caffe::Net<float>*,boost::python::api::object,boost::python::api::object)
"""
pass
def _top_ids(self, Net, *args, **kwargs): # real signature unknown; NOTE: unreliably restored from __doc__
"""
_top_ids( (Net)arg1, (int)arg2) -> IntVec :
C++ signature :
std::vector<i... | |
== 0 and K_cstr_ss == True):
print 'Initial guess is not feasible because sum of K_{m}<=0.'
elif GoodGuess == True:
print 'Initial guess is feasible.'
# Compute steady state
print 'BEGIN STEADY STATE COMPUTATION'
ss_params = (S, alpha, beta, sigma, ss_tol)
(r_ss, w_ss, p_c_ss, p_tilde_ss, b_ss, c_tilde_s... | |
<filename>src/qecsim/cli.py
"""
This module contains the qecsim command line interface (CLI).
Components are integrated into the CLI via entries in the ``[options.entry-points]`` section of ``setup.cfg``. The
format of entries is ``<short_name> = <module_path>:<class_name>``. Codes, error models and decoders appear un... | |
desc
class MOPSFeatureDescriptor(FeatureDescriptor):
# TODO: Implement parts of this function
def describeFeatures(self, image, keypoints):
'''
Input:
image -- BGR image with values between [0, 255]
keypoints -- the detected features, we have to compute the feature
descriptors at the specified coordinates
Out... | |
<gh_stars>0
import os
import numpy as np
import h5py
from audiomate.feeding import PartitioningFeatureIterator
from audiomate.feeding import partitioning
from audiomate import containers
import pytest
class TestPartitioningContainerLoader:
def test_scan_computes_correct_size_for_one_container(self, tmpdir):
c1 ... | |
College of Applied Technology-Morristown","Tennessee College of Applied Technology-Morristown"),
("Tennessee College of Applied Technology-Murfreesboro","Tennessee College of Applied Technology-Murfreesboro"),
("Tennessee College of Applied Technology-Nashville","Tennessee College of Applied Technology-Nashville"),
... | |
"""
gamd.py: Implements the GaMD integration method.
Portions copyright (c) 2020 University of Kansas
Authors: <NAME>, <NAME>
Contributors: <NAME>
"""
from __future__ import absolute_import
__author__ = "<NAME>"
__version__ = "1.0"
from simtk import unit as unit
from abc import ABCMeta, ABC
from abc import abstrac... | |
<reponame>choderalab/gin<gh_stars>10-100
# =============================================================================
# imports
# =============================================================================
import os
import sys
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import tensorflow as tf
tf.compat.v1.logging.se... | |
#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
from thrift.Thrift import *
from ttypes import *
from thrift.Thrift import TProcessor
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
from thrift.protocol import fastbinary
excep... | |
window length of `STFT`
hop_length (int): hop length of `STFT`
window_name (str or None): *Name* of `tf.signal` function that returns a 1D tensor window that is used in analysis.
Defaults to `hann_window` which uses `tf.signal.hann_window`.
Window availability depends on Tensorflow version. More details are at `kap... | |
from base64 import b64encode, b64decode
from bs4 import BeautifulSoup as soup
from bz2 import BZ2File
from collections import Counter, OrderedDict
from copy import deepcopy
from datetime import datetime as dt, timedelta
try:
from etk.extractors.date_extractor import DateExtractor
except OSError:
from spacy.c... | |
works on file streams.
Args:
fh: The stream to get the length of.
Returns:
The length of the stream.
"""
pos = fh.tell()
fh.seek(0, 2)
length = fh.tell()
fh.seek(pos, 0)
return length
def GetUserAgent(get_version=sdk_update_checker.GetVersionObject,
get_platform=appengine_rpc.GetPlatformToken,
sdk_prod... | |
<reponame>dbmi-pitt/DIKB-Evidence-analytics
"""Low-level interface to NCBI's EUtils for Entrez search and retrieval.
For higher-level interfaces, see DBIdsClient (which works with a set
of database identifiers) and HistoryClient (which does a much better
job of handling history).
There are five classes of services:
... | |
# Script for Da-Tacos cover song identification from Feature Fused Matrices
#Importing
import librosa
import numpy as np
import scipy
from scipy.spatial.distance import pdist, squareform
from scipy.interpolate import interp2d
from scipy.sparse.csgraph import laplacian
from scipy.spatial.distance import directed_hausdo... | |
op2.MixedDataSet(dsets)
assert not op2.MixedDataSet(dsets) != op2.MixedDataSet(dsets)
def test_mixed_dset_ne(self, dset, diterset, dtoset):
"MixedDataSets created from different DataSets should not compare equal."
mds1 = op2.MixedDataSet((dset, diterset, dtoset))
mds2 = op2.MixedDataSet((dset, dtoset, diterset))
... | |
as error:
LOG.debug('Unmount attempt %(attempt)s failed: %(error)s, '
'retrying unmount NFS share %(share)s mounted '
'at %(mntpoint)s',
{'attempt': attempt, 'error': error,
'share': share, 'mntpoint': mntpoint})
if attempt == attempts:
LOG.error('Failed to unmount NFS share %(share)s '
'mounted at %(mntpoint)s... | |
<filename>model/validation.py
import os
import numpy as np
from sklearn.metrics import jaccard_score, precision_score, recall_score, f1_score
from sklearn.model_selection import StratifiedShuffleSplit, StratifiedKFold
from data_processing.sliding_window import apply_sliding_window
from model.DeepConvLSTM import DeepC... | |
<filename>OpticalRS/AlbedoIndex.py
# -*- coding: utf-8 -*-
"""
AlbedoIndex
===========
Code for generating a water column corrected image from multispectral imagery.
This is a method of water column correction for habitat mapping. It is based on
Maritorena et al. 1994 and is described in detail in Chapters 4 and 5 of ... | |
import tkinter as tk
from tkinter import ttk
from tkinter.messagebox import showinfo
import random
from Color import color
# Clearer Ui using ctypes
import ctypes
ctypes.windll.shcore.SetProcessDpiAwareness(1)
class SAVApp(tk.Tk):
def __init__(self):
super().__init__()
self.array = []
self.no_of_items = tk.IntVa... | |
<filename>python_scripts/run_compute_precision_recall.py<gh_stars>1-10
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (c) 2015--, <NAME>.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distr... | |
import logging
import uuid
import re
logger = logging.getLogger(__name__)
DEFAULT_TRUSTZONE = "b61d6911-338d-46a8-9f39-8dcd24abfe91"
def format_source_objects(source_objects):
if not isinstance(source_objects, list):
source_objects = [source_objects]
return source_objects
def get_mappings_for_name_and_tags(map... | |
"""
Author: <NAME>, Phd Student @ Ishida Laboratory, Department of Computer Science, Tokyo Institute of Technology
Created on: February 21st, 2020
Description: This file contains necessary functions for the generation and splitting of the raw original dataset.
"""
import os
import random
import numpy as np
import pand... | |
<filename>src/decoding.py<gh_stars>0
from collections import namedtuple
import torch
import util
from dataloader import BOS_IDX, EOS_IDX, STEP_IDX
from model import Categorical, HardMonoTransducer, HMMTransducer, dummy_mask
from transformer import Transformer
DEVICE = torch.device("cuda" if torch.cuda.is_available()... | |
"Charleston",
"ru_RU": "Чарльстон"
},
"CHARLOTTETOWN": {
"de_DE": "Charlottetown",
"es_ES": "Charlottetown",
"fr_FR": "Charlottetown",
"it_IT": "Charlottetown",
"ja_JP": "シャーロットタウン",
"ko_KR": "샬럿타운",
"pl_PL": "Charlottetown",
"pt_BR": "Charlottetown",
"ru_RU": "Шарлоттаун"
},
"CHARTES": {
"de_DE": "Chart... | |
<reponame>khromiumos/chromiumos-chromite
# -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Run lint checks on the specified files."""
from __future__ import print_function
... | |
<reponame>ksmit799/POTCO-PS<filename>pirates/piratesgui/NewTutorialPanel.py
# File: N (Python 2.4)
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from pirates.piratesgui import GuiPanel, PiratesGuiGlobals
from pirates.piratesbase import PLocalizer, PiratesGlobals
from direct.interval.IntervalGlob... | |
)
# client.set_options( url=self.HIS_Central_URL, proxy=proxy )
# ERROR: Unexpected Python exception: <urlopen error [Errno 111]
# Connection refused>
#----------------------------------------------------------------------
# from suds.transport.http import HttpTransport
# tran = HttpTransport()
# import urllib2
... | |
def id(self) -> str:
"""
The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the backup being referenced.
"""
return pulumi.get(self, "id")
@property
@pulumi.getter(name="isAutomatic")
def is_automatic(self) -> bool:
"""
True if this object is automatically created
"""
... | |
# yellowbrick.features.radviz
# Implements radviz for feature analysis.
#
# Author: <NAME>
# Created: Fri Oct 07 13:18:00 2016 -0400
#
# Copyright (C) 2016 The scikit-yb developers
# For license information, see LICENSE.txt
#
# ID: radviz.py [0f4b236] <EMAIL> $
"""
Implements radviz for feature analysis.
"""
########... | |
= []
if self._offset == self._failure:
self._expected.append('[0-9a-zA-Z_]')
self._offset = index55
if address54 is FAILURE:
address54 = TreeNode(self._input[self._offset:self._offset], self._offset, [])
self._offset = self._offset
else:
address54 = FAILURE
if address54 is not FAILURE:
elements26.append(addre... | |
'^n'),
'|', '^d'),
'~')
FROM db_1.schema_1.[Animal] AS [Animal_4]
JOIN db_1.schema_1.[Animal] AS [Animal_3]
ON [Animal_4].uuid = [Animal_3].parent
WHERE [Animal_2].parent = [Animal_4].uuid
FOR XML PATH ('')
), '') AS fold_output_name
FROM db_1.schema_1.[Animal] AS [Animal_2]) AS folded_subquery_1
ON [Animal_1... | |
not in self.table_featurizer:
print("table: {} not found in featurizer".format(table))
# assert False
continue
# Note: same table might be set to 1.0 twice, in case of aliases
tfeats[self.table_featurizer[table]] = 1.00
if self.sample_bitmap:
assert bitmaps is not None
startidx = len(self.table_featurizer)
sb... | |
"""
uncond_dcgan1 made with 64x64 images from https://s3.amazonaws.com/udipublic/acro.images.tgz for train.tar.gz
"""
import argparse
parser = argparse.ArgumentParser(description='train uncoditional dcgan')
parser.add_argument('--desc',
default='uncond_dcgan',
help='name to uniquely describe this run')
parser.add_ar... | |
import time
import cv2
import numpy as np
from queue import Empty
import os
from improv.actor import Actor, Spike, RunManager
from improv.store import ObjectNotFoundError
import logging; logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
class MeanAnalysis(Actor):
#TODO: Add additional error handlin... | |
%s buildstep for %s builder: %s\n" % (buildStepName, builderName, e))
return doTest
expected_build_steps = {
'Apple Win 10 Debug (Tests)': ['configure build', 'svn', 'kill old processes', 'delete WebKitBuild directory', 'delete stale build files', 'compile', 'download-built-product', 'extract-built-product', 'jscor... | |
import spyral
import types
import sys
import functools
import math
import string
import pygame
from bisect import bisect_right
class BaseWidget(spyral.View):
"""
The BaseWidget is the simplest possible widget that all other widgets
must subclass. It handles tracking its owning form and the styling that
should be a... | |
<filename>calvin/tests/test_calvinscript.py
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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/LICENS... | |
not use the GC calculation from Biopython
# Because it does not deal with 'N' nucleotides
# gc_content = GC(sequence)/100
else:
gc_content = np.NaN
return gc_content
# TODO GC exact computation to account for ambiguous nucleotides S(G or C)
# TODO Test gc_cds for GC1, GC2, GC3 contents
def gc_codon(fasta, gff,... | |
#!/usr/bin/env python 3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 PanXu, Inc. All Rights Reserved
#
"""
基于 <<Chinese NER Using Lattice LSTM>> 论文
论文地址: https://www.aclweb.org/anthology/P18-1144/
实现 lattice lstm 模型
相关说明文档参考:
docs/ner/Chinese NER Using Lattice LSTM.md
Authors: PanXu
Date: 2021/01/20 19:48:00
"""
... | |
<reponame>evolv-ai/experiment-management-cli
from .util import EvolvError
from .request import EvolvRequest
from .collections import METAMODELS, ACCOUNTS, EXPERIMENTS, ENVIRONMENTS, CANDIDATES
class EvolvClient:
def __init__(self, config):
"""Constructs a new Experiment Client.
:param EvolvConfig config: configu... | |
#
# Copyright (c) SAS Institute Inc.
# SPDX-License-Identifier: Apache-2.0
# this has been significantly modified from the original#
#
# Visit https://aboutcode.org and https://github.com/nexB/univers for support and download.
import unittest
from univers.maven import Version
from univers.maven import VersionRange
f... | |
<filename>kaloom_kvs_agent/kvs_net.py
# Copyright 2019 Kaloom, Inc. 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
#
# Unles... | |
from collections import defaultdict
from itertools import count
from operator import itemgetter
from pathlib import Path
from typing import Dict, Optional
from typing import List, Tuple, Union
import htbuilder
import streamlit as st
from htbuilder import span, div, script, style, link, styles, HtmlElement, br
from htb... | |
with the specified name exists in the database.
:param name: name of the mission
:return: True if such mission exists
"""
record = self._run_query("MATCH (m:Mission) \
WHERE m.name = $name \
RETURN m.name",
**{'name': name})
return record.single() is not None
def delete_mission(self, name):
"""
Delete miss... | |
def connect(self, connector):
if self.parent is None:
self.parent = Node(connector)
self.parent.children.append(self)
def __or__(self, rhs):
self.connect('OR')
return self.parent | rhs
def __and__(self, rhs):
self.connect('AND')
return self.parent & rhs
def __invert__(self):
self.negated = not self.neg... | |
<gh_stars>1-10
#!/usr/bin/env python3
##############################################################
# Copyright 2019 <NAME> <<EMAIL>>
# (c.f. COPYING)
#
# This file is part of BREWCOP, a coffee pot monitor.
# For details, see https://github.com/garlick/brewcop.
#
# SPDX-License-Identifier: BSD-3-Clause
##############... | |
'v_5'), ('t_1', 'v_3'), ('t_2', 'v_2')}},
{'DOMAIN': {'v_1', 'v_4', 't_2', 't_1', 'c_1', 'v_2', 'v_5', 'v_3'}, 'City': {'c_1'}, 'Town': {'t_2', 't_1'},
'Village': {'v_4', 'v_1', 'v_2', 'v_5', 'v_3'},
'Road': {('t_1', 'v_1'), ('v_3', 't_1'), ('c_1', 'v_5'), ('t_1', 'c_1'), ('c_1', 't_2'), ('t_2', 'v_4'),
('v_2', 't_... | |
r"""JSON (JavaScript Object Notation) <http://json.org> is a subset of
JavaScript syntax (ECMA-262 3rd edition) used as a lightweight data
interchange format.
:mod:`simplejson` exposes an API familiar to users of the standard library
:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained
versi... | |
import ast
import re
import pymel.core as pm
import maya.cmds as cmds
import maya.OpenMaya as api
import utils
__all__ = [
'decodeMetaData',
'decodeMetaDataValue',
'encodeMetaData',
'encodeMetaDataValue',
'findMetaNodes',
'getMetaClasses',
'getMetaData',
'hasMetaClass',
'isMetaNode',
'removeMetaData',
'... | |
7, 8], num_classes=n_classes,
anchors=[12, 16, 19, 36, 40, 28, 36, 75, 76, 55, 72, 146, 142, 110, 192, 243, 459, 401],
num_anchors=9, stride=32)
def forward(self, input1, input2, input3):
x1 = self.conv1(input1)
x2 = self.conv2(x1)
x3 = self.conv3(input1)
# R -1 -16
x3 = torch.cat([x3, input2], dim=1)
x4 = s... | |
pixels referenced from 0
x, y = x+1, y+1
return (x, y)
def pixtosystem(self, idxs, system=None, coords='data'):
if self.coordsys == 'raw':
raise WCSError("No usable WCS")
if system == None:
system = 'j2000'
# Get a coordinates object based on ra/dec wcs transform
ra_deg, dec_deg = self.pixtoradec(idxs, c... | |
# -*- coding: utf-8 -*-
#
# Authors: Swolf <<EMAIL>>
# Date: 2021/1/07
# License: MIT License
"""
Common Spatial Patterns and his happy little buddies!
"""
from copy import deepcopy
from typing import Union, Optional, List, Dict, Tuple
from functools import partial
import numpy as np
from numpy import ndarray
from sc... | |
# (C) Copyright 2017 Inova Development Inc.
# 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 applica... | |
<filename>hazma/vector_mediator/__init__.py<gh_stars>1-10
from typing import Union
import numpy as np
from hazma.parameters import Qd, Qe, Qu
from hazma.parameters import charged_kaon_mass as _MK
from hazma.parameters import charged_pion_mass as _MPI
from hazma.parameters import eta_mass as _META
from hazma.parameter... | |
["po/lin", -1], ["u(po/", -1]]
}
},
{"Tester": Rule_SW_20, "ruleName": "SW.20: Forms of eu)qu/s", "Short_Name": "SW.20",
"Test_Forms": {
DIALECT.IONIC: [["i)qu/s", -1], ["i)qei=a", -1]],
DIALECT.AEOLIC: [["eu)qu/s", -1], ["eu)qei=a", -1]],
DIALECT.HOMERIC: [],
DIALECT.ANY: [["xe/ras", -1], ["paideu/w", -1], ["pai... | |
<reponame>AdamSchnapp/pyrocoto
#!/usr/bin/env python
from xml.etree.ElementTree import Element, tostring
from xml.dom import minidom
from .helpers import Validator, Borg
from itertools import product
import logging
logger = logging.getLogger(__name__)
class String(Validator):
def __init__(self, contains=... | |
up0 = self.upsample_0(conv4)
up0 = self.decoderblock_0(up0)
deconv0 = torch.cat([up0,conv3],-1)
deconv0 = self.decoderlayer_0(deconv0,mask=mask)
up1 = self.upsample_1(deconv0)
up1 = self.decoderblock_1(up1)
deconv1 = torch.cat([up1,conv2],-1)
deconv1 = self.decoderlayer_1(deconv1,mask=mask)
up2 = self.upsamp... | |
# -*- coding: utf-8 -*-
"""
File name: quad_mdl.py
Author: <NAME>
Created: June 2019
Description: A fault model of a multi-rotor drone.
"""
import numpy as np
from fmdtools.modeldef import *
#Define specialized flows
class Direc(Flow):
def __init__(self):
self.traj=[0,0,0]
super().__init__({'x': self.traj[0], 'y': ... | |
2400
)
self.assertEqual(
invoice.paid,
0
)
self.assertEqual(
invoice.total,
2400
)
url = reverse("sales:edit", kwargs={"pk": invoice.pk})
data = {}
header_data = create_header(
HEADER_FORM_PREFIX,
{
"type": invoice.type,
"customer": invoice.customer.pk,
"period": invoice.period.pk,
"ref": invoice.ref... | |
SconsBuilderConfig.UNITTEST_TEST_PREFIX,
SCB_UNITTEST_LIB_PREFIX = SconsBuilderConfig.UNITTEST_LIB_PREFIX,
SCB_UNITTEST_LIB_DIR = SconsBuilderConfig.UNITTEST_LIB_DIR,
SCB_UNITTEST_LIB = SconsBuilderConfig.UNITTEST_LIB,
SCB_UNITTEST_INCLUDE_DIR = SconsBuilderConfig.UNITTEST_INCLUDE_DIR,
SCB_UNITTEST_TESTRUNNER = Sc... | |
raise KeyError("%s is not a tracked array"%key)
def __init__(
self,
UIname,
coordinates,
tracked_arrays = [],
tracked_names = [],
tracked_filter_flags = [],
decimation_factor = 1,
filenames_and_nparts = None,
**option_kwargs):
"""
`UIname` - Name of the particle group that shows up in the UI, 4-5 characte... | |
cluster members, and resolve any connectivity issues before upgrade process '
return ping_output, ping_output_failed,check_result,check_analysis,check_action
except Exception as e:
log_file_logger.exception(e)
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>... | |
integer, a tuple, a string that makes sense to R, or an RElement
OUTPUT: RElement
EXAMPLES::
sage: x = r([10.4,5.6,3.1,6.4,21.7])
sage: x[0]
numeric(0)
sage: x[1]
[1] 10.4
sage: x[-1]
[1] 5.6 3.1 6.4 21.7
sage: x[-2]
[1] 10.4 3.1 6.4 21.7
sage: x[-3]
[1] 10.4 5.6 6.4 21.7
sage: x['c(2,3)']
[1] 5.6 3.1... | |
51, 46, 49, 52, 47, 50, 53, 38, 37, 36, 41, 40, 39, 44, 43,
42, 35, 32, 29, 34, 31, 28, 33, 30, 27, 6, 7, 8, 3, 4, 5, 0,
1, 2, 26, 23, 20, 25, 22, 19, 24, 21, 18, 17, 14, 11, 16, 13, 10,
15, 12, 9]])
opp_action_permutations = \
np.array([[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
[ 1, 0, 3, 2, 5, 4, 7, 6, 11, 10, 9... | |
import os
import numpy as np
try:
import pymake
except:
msg = "Error. Pymake package is not available.\n"
msg += "Try installing using the following command:\n"
msg += " pip install https://github.com/modflowpy/pymake/zipball/master"
raise Exception(msg)
try:
import flopy
except:
msg = "Error. FloPy package is... | |
body='{"data": {"key": "value"}}',
status=200,
content_type="application/json",
)
with pytest.raises(TypeError):
await none_semaphore_client.test().get()
"""
test iterator features
"""
async def test_simple_pages_iterator(mocked, client):
next_url = "http://api.example.org/next_batch"
mocked.get(
client.t... | |
<gh_stars>0
from typing import Dict, Tuple, Optional, Any
import demistomock as demisto
import urllib3
from CommonServerPython import *
# Disable insecure warnings
urllib3.disable_warnings()
INTEGRATION_CONTEXT_NAME = 'MSGraphGroups'
NO_OUTPUTS: dict = {}
APP_NAME = 'ms-graph-groups'
def camel_case_to_readable(tex... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.