input
stringlengths
2.65k
237k
output
stringclasses
1 value
# -*- coding: utf-8 -*- #!/usr/bin/python3 import numpy as np import unittest from src import boardcontrol class Unit_tests_boardcontrol(unittest.TestCase): """The class containing the unit-test functions (boardcontrol). These include setting up the board properly as well as piece movement validation (including ...
The constructor is CartesianProduct. Such strategies by default assume ignore_parent=True, inferrable=False, possibly_empty=False, and workable=True. The bijection maps an object a -> (b1, ..., bk) where bi is the object in the child at index i returned by the decomposition function. """ def __init__( self, ...
self.FindLoop(keyname) if loop_no >= 0: return self.loops[loop_no] else: raise KeyError('%s is not in any loop' % keyname) def AddToLoop(self,dataname,loopdata): thisloop = self.GetLoop(dataname) for itemname,itemvalue in loopdata.items(): thisloop[itemname] = itemvalue def AddToLoop(self,dataname,loopdata):...
coron_shift_x_orig self.options['coron_shift_y'] = coron_shift_y_orig self.options['bar_offset'] = bar_offset_orig # Crop distorted borders if add_distortion: osamp = hdul[0].header['DET_SAMP'] npix_over = npix_extra * osamp hdul[0].data = hdul[0].data[npix_over:-npix_over,npix_over:-npix_over] hdul[2].data = ...
<reponame>augustoproiete-forks/pandas-dev--pandas #!/usr/bin/env python # coding: utf-8 import nose import itertools import os import string import warnings from distutils.version import LooseVersion from pandas import Series, DataFrame, MultiIndex from pandas.compat import range, lmap, lzip import pandas.util.testin...
<reponame>justinnoah/typhon # Copyright (C) 2015 Google 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 req...
http://hl7.org/fhir/ValueSet/ucum-common in valuesets.xml """ NanomolePerHourPerLiter = CommonUCUMUnitsCode("nmol/h/L") """ From: http://hl7.org/fhir/ValueSet/ucum-common in valuesets.xml """ NanomolePerHourPerMilligramOfProtein = CommonUCUMUnitsCode("nmol/h/mg{protein}") """ From: http://hl7.org/fhir/ValueSet/...
index=idx, columns=pd.MultiIndex.from_arrays([[""], ["$Q_{95\%}$"]]), ) col = pd.MultiIndex.from_product( [["training", "test"], ["mean $\pm$ std", "mean", "std", "RRMSE", "RRMSE(b)"]] ) error_table = pd.concat( [error_table, pd.DataFrame("", index=idx, columns=col)], axis=1 ) error_table.loc[:, ("training",...
from collections import namedtuple import datetime import io import matplotlib matplotlib.use('Agg') # noqa: E402 import matplotlib.patches as patches import matplotlib.pyplot as plt import numpy as np import scipy as sp import scipy.stats import time from tensorboardX import SummaryWriter import pyro import pyro.dis...
x = b) for coeffs on each input coeffs = np.zeros((self.system.ninputs, self.basis.N)) for i in range(self.system.ninputs): # Set up the matrices to get inputs M = np.zeros((self.timepts.size, self.basis.N)) b = np.zeros(self.timepts.size) # Evaluate at each time point and for each basis function # TODO: vector...
<gh_stars>0 """ This module defines the database classes. """ import json import zlib from typing import Any import gridfs from bson import ObjectId from maggma.stores.aws import S3Store from monty.dev import deprecated from monty.json import MontyEncoder from pymatgen.electronic_structure.bandstructure import ( Ban...
Ports # pol_group: Name of the Policy Group to apply # mod (Optional): Mod as an integer (almost always 1) # Port: Part as an integer # sub_start: Starting sub port as an integer # sub_end: Ending sub port as an integer def int_sub_selector_individual(self, **kwargs): required_args = {'name': '', 'status': '', ...
<gh_stars>0 ## Output data: # Area: A # Second moments of area: Ix, Iy # Product moment of area: Ixy # Section moduli: Kx, Ky # (Plus in case of circularly symmetric cross-section: # Polar moment of area: Ip # Polar modulus: Kp) from re import S from telnetlib import IP import numpy as np import math def transform(func...
import re import yaml import logging logger = logging.getLogger(__name__) from pylatexenc.macrospec import MacroSpec, ParsedMacroArgs, MacroStandardArgsParser from pylatexenc import latexwalker from latexpp.macro_subst_helper import MacroSubstHelper from latexpp.fix import BaseFix # parse entropy macros etc. _q...
= [7.0*c, 13.0*c, c, -7.0*c, -13.0*c, -c, -7.0*c, -13.0*c, -c, 7.0*c, 13.0*c, c] l2mat[:, 2] = [-13.0*c, -7.0*c, -c, 13.0*c, 7.0*c, c,-13.0*c, -7.0*c, -c, 13.0*c, 7.0*c, c] l2mat[:, 3] = [7.0*c, c, 13.0*c, -7.0*c, -c, -13.0*c, -7.0*c, -c, -13.0*c, 7.0*c, c, 13.0*c] l2mat[:, 4] = [-a, z, a, -a, z, a, -a, z, a, -a, z,...
initialize=0) m.x302 = Var(within=Reals, bounds=(0,None), initialize=0) m.x303 = Var(within=Reals, bounds=(0,None), initialize=0) m.x304 = Var(within=Reals, bounds=(0,None), initialize=0) m.x305 = Var(within=Reals, bounds=(0,None), initialize=0) m.x306 = Var(within=Reals, bounds=(0,None), initialize=0) m.x307 = Var(wit...
<filename>pdfa_parser/avisleser.py<gh_stars>10-100 #!/usr/bin/env python import argparse import faulthandler import io import logging import os import re import signal import statistics import string import sys import tarfile import traceback from collections import Counter from collections.abc import Iterable from con...
import abc import functools import numpy as np import scipy.linalg from probnum import diffeq, random_variables, statespace, utils from probnum._randomvariablelist import _RandomVariableList from bvps import ( bridges, bvp_initialise, control, error_estimates, kalman, mesh, ode_measmods, problems, quadrature...
<gh_stars>1-10 # Copyright © 2019 Province of British Columbia # # 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...
<reponame>suhasghorp/FinancePy<filename>financepy/products/equity/FinEquityBarrierOption.py # -*- coding: utf-8 -*- """ Created on Fri Feb 12 16:51:05 2016 @author: <NAME> """ # from math import exp, log, sqrt import numpy as np from enum import Enum from ...finutils.FinError import FinError from ...finutils.FinMath ...
rows: rows_list.append(row) for row in rows_list: fueltype_str = row[0] fueltype_int = fueltypes_lu[fueltype_str] for cnt, entry in enumerate(row[1:], 1): enduse = headings[cnt] sector = _secondline[cnt] fuels[enduse][sector][fueltype_int] += float(entry) except ValueError: raise Exception( "The service sec...
[107.631592,-6.99563], [107.631622,-6.99599], [107.63163,-6.99629], [107.631638,-6.99639], [107.631683,-6.99648], [107.631737,-6.99658], [107.632019,-6.99672], [107.632507,-6.99689], [107.632988,-6.99708], [107.633209,-6.99721], [107.633423,-6.99735], [107.63353,-6.99746], [107.633636,-6.99761], [107.63366...
# 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 agreed to in writing, softw...
from .toornament_connection import SyncToornamentConnection, AsyncToornamentConnection from .viewer_schemas import * from typing import Optional from .range import Range class SyncViewerAPI(SyncToornamentConnection): @staticmethod def _base_url(): return 'https://api.toornament.com/viewer/v2' def get_match(self...
<reponame>astroumd/admit #! /usr/bin/env casarun # # # admit1.py : an example ADMIT pipeline/flow for line cubes with an optional continuum map # # Usage: $ADMIT/admit/test/admit1.py [line.fits [alias]] [cont.fits] # # this will create a line.admit directory with all the # BDP's and associated data products inside. Lin...
<reponame>LittleNed/toontown-stride<filename>toontown/questscripts/TTQUESTS.py # NOTE: \a is the delimiter for chat pages # Quest ids can be found in Quests.py SCRIPT = ''' ID reward_100 SHOW laffMeter LERP_POS laffMeter 0 0 0 1 LERP_SCALE laffMeter 0.2 0.2 0.2 1 WAIT 1.5 ADD_LAFFMETER 1 WAIT 1 LERP_POS laffMeter -1.18...
def flist(self): return list(self._files.keys()) def unlink(self, path): "Unlink (delete) the given file." path = cygwin2nt(path) return os.unlink(path) def rename(self, src, dst): "Rename file from src to dst." src = cygwin2nt(src) dst = cygwin2nt(dst) return os.rename(src, dst) # directory methods def ...
accept a few camel-cased familyname exceptions, # so this one should also be fine: ttFont = TTFont(TEST_FILE("abeezee/ABeeZee-Regular.ttf")) assert_PASS(check(ttFont), "with a good camel-cased fontname...") def NOT_IMPLEMENTED_test_check_name_postscriptname(): """ Check name table: POSTSCRIPT_NAME entries. """ ...
<gh_stars>0 """Jahnke, Student ID: 0808831 <EMAIL> / <EMAIL> CSCI 160, Spring 2022, Lecture Sect 02, Lab Sect L03 Program 12, Part 2 Copyright (C) 2022 <NAME> Assignment: 1. Write the required functions. #. Prompt user for text file name containing menu data. #. Display/manipulate the data as prescribed by required...
<gh_stars>10-100 """ FILENAME: controller.py controller.py is the client and SUMO is the server """ """ DIRECTORIES & PATHS """ PORT = 8813 """ LIBRARIES """ import os import sys if 'SUMO_HOME' in os.environ: tools = os.path.join(os.environ['SUMO_HOME'], 'tools') sys.path.append(tools) else: sys.exi...
<reponame>totologic/NaoRemoteCsharp """Multiple-producer-multiple-consumer signal-dispatching dispatcher is the core of the PyDispatcher system, providing the primary API and the core logic for the system. Module attributes of note: Any -- Singleton used to signal either "Any Sender" or "Any Signal". See document...
not hasattr(self.dll, "IW_IncrementTime"): raise AttributeError( 'IWFM API does not have "{}" procedure. ' "Check for an updated version".format("IW_IncrementTime") ) # check that date is valid self._validate_iwfm_date(date_string) # check that time_interval is a valid IWFM time_interval self._validate_time_i...
0] == pytest.approx(0.0, 1.0e-4) assert deflections[0, 1] == pytest.approx(factor * 0.38209715, 1.0e-4) deflections = truncated_nfw.deflections_from_grid( grid=aa.grid_irregular.manual_1d([[1.0, 1.0]]) ) factor = (4.0 * 1.0 * 1.0) / (np.sqrt(2) / 1.0) assert deflections[0, 0] == pytest.approx( (1.0 / np.sqrt(2...
<reponame>Qointum/pypy import py, weakref from rpython.jit.backend import model from rpython.jit.backend.llgraph import support from rpython.jit.backend.llsupport import symbolic from rpython.jit.metainterp.history import AbstractDescr from rpython.jit.metainterp.history import Const, getkind from rpython.jit.metainter...
<reponame>yiannist/pkg-ganeti<gh_stars>0 # # # Copyright (C) 2006, 2007, 2010, 2011, 2012, 2013, 2014 Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of sourc...
<reponame>vishalbelsare/pydmrs from pydmrs.pydelphin_interface import parse, generate from pydmrs.mapping.mapping import dmrs_mapping from pydmrs.graphlang.graphlang import parse_graphlang import examples.examples_dmrs as examples if __name__ == '__main__': # basic functionality dmrs = examples.the_dog_chases_the_...
#!/usr/bin/env python # -*- coding:utf-8 -*- from __future__ import print_function, division, absolute_import import os.path import sys dependencyDir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "../Dep") sys.path.insert(0, dependencyDir) import re from time import mktime from datetime import datetime...
:type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: AddressResource, or the result of cls(response) :rtype: ~azure.mgmt.edgeorder.v2020_12_01_preview.models.AddressResource :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwar...
row in self.rows: # Remove any double quotes from around the data before storing self.qstn_metadata[row.descriptor] = row.value.strip('"') # ------------------------------------------------------------------------- def get(self, value, default=None): """ This will return a single metadata value held by the widge...
#!/usr/bin/env python __author___= "<NAME>" __copyright__= "Copyright 2017" __license__= "Apache License, Version 2.0" __email__= "<EMAIL>" ''' This program parses .jimple files (Soot output) from each provided Java project (app) and extracts API methods and exceptions that developers use (to handle called API method...
value) def write_stderr(self, value): """writes a string to standard input in the remote console""" with self.send_lock: write_bytes(self.conn, ReplBackend._STDE) write_string(self.conn, value) ################################################################ # Implementation of execution, etc... def executio...
import sqlite3 import tkinter as tk import sqlite3 from logik import Logik class ModelHotel: def __init__(self,tab,text,Button): self.tab = tab self.text = text self.button = Button self.counter1 = 1 self.counter2 = 2 self.counter3 = 3 self.counter4 = 4 self.counter5 = 5 self.counter6 = ...
emit a harmless # "received unexpected notification" warning with self.lock: for v in self.subscriptions.values(): if callback in v: v.remove(callback) def _connection_down(self, server, blacklist=False): '''A connection to server either went down, or was never made. We distinguish by whether it is in self.int...
<gh_stars>1-10 # source: https://github.com/pytorch/vision/blob/master/references/detection/ import math import time import torch import torchvision.models.detection.mask_rcnn from sklearn.metrics import roc_auc_score, matthews_corrcoef import numpy as np from scipy.special import softmax import sys import nucls_mod...
try: num1 = float(menor[i]) num2 = float(mayor[i]) result.append(mt.div(num1,num2)) except ValueError: e = CError(0,0,"Error en funcion matematica",'Semantico') errores.insert_error(e) return e newdict = { 'valores':result, 'columna': exp1['columna'].append(exp2['columna'][0]) } return newdict else: #Sol...
Godunov update for m in xrange(num_eqn): q[m,LL:UL] -= dtdx[LL:UL]*apdq[m,LL-1:UL-1] q[m,LL-1:UL-1] -= dtdx[LL-1:UL-1]*amdq[m,LL-1:UL-1] elif state.problem_data['method'] == 'h_box': # # add corrections wave,s,amdq,apdq,f_corr_l,f_corr_r = self.rp(q_l,q_r,aux_l,aux_r,state.problem_data) LL = self.num_ghost - 1 ...
<gh_stars>0 import datetime from onecodex.exceptions import OneCodexException class set_style(object): """Inserts a <style> block in <head>. Used to override default styling. Parameters ---------- style : `string` CSS to override default styling of the entire report. """ def __init__(self, style): if not s...
12:52:00,8.95,632.0,9.35 3189,11,4986.0,532,Travel and Other,1970-01-01 12:52:00,6.76,517.0,7.65 3190,4,1962.0,532,Child Care,1970-01-01 12:52:00,2.66,134.0,1.98 3191,5,449.0,532,Adult Care,1970-01-01 12:52:00,0.61,119.0,1.76 3192,6,32681.0,533,Work and Education,1970-01-01 12:53:00,44.31,2945.0,43.58 3193,10,2709...
# Copyright 2019 Graphcore Ltd. import os import sys import json import argparse import math from typing import List, Any, Optional import numpy as np import onnx from logging import getLogger from onnx import TensorProto, numpy_helper from bert_model import BertConfig logger = getLogger(__name__) def load_initiali...
<reponame>AstraZeneca/magnus-extensions import logging import json from string import Template as str_template import datetime from collections import OrderedDict from magnus.datastore import BaseRunLogStore, RunLog, StepLog, BranchLog from magnus import defaults from magnus import exceptions logger = logging.getLog...
<reponame>teixemf/netbox from django import forms from django.contrib.auth.models import User from django.utils.translation import gettext as _ from dcim.choices import * from dcim.constants import * from dcim.models import * from tenancy.models import * from extras.forms import CustomFieldModelFilterForm, LocalConfig...
<reponame>centrologic/django-codenerix-geodata # -*- coding: utf-8 -*- # # django-codenerix-geodata # # Copyright 2017 Centrologic Computational Logistic Center S.L. # # Project URL : http://www.codenerix.com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compl...
<filename>code/examples/classifier_compression/sinreq_v2_svhn_runcode/networks/alexnet.py import tensorflow as tf from .helper import * def quantize_acti(x, k): mini = tf.reduce_min(x) maxi = tf.reduce_max(x) x = (x - mini)/(maxi - mini) G = tf.get_default_graph() n = float(2**k - 1) with G.gradient_override_map...
from asyncio import get_event_loop, InvalidStateError import time import pytest from aiorpcx.curio import * def sum_all(*values): return sum(values) async def my_raises(exc): raise exc async def return_value(x, secs=0): if secs: await sleep(secs) return x # Test exports sleep CancelledError Event Lock Qu...
<gh_stars>0 #copyright ReportLab Inc. 2000-2019 #see license.txt for license details """preppy - a Python preprocessor. This is the Python equivalent of ASP or JSP - a preprocessor which lets you embed python expressions, loops and conditionals, and 'scriptlets' in any kind of text file. It provides a very natural so...
_cv.CvConvexityDefect_end_set) __swig_setmethods__["depth_point"] = _cv.CvConvexityDefect_depth_point_set __swig_getmethods__["depth_point"] = _cv.CvConvexityDefect_depth_point_get if _newclass:depth_point = _swig_property(_cv.CvConvexityDefect_depth_point_get, _cv.CvConvexityDefect_depth_point_set) __swig_setmetho...
<reponame>mjaquiery/legUp """ Updated on Sun Feb 25 15:26 2018 - tkinter library used to enable file selection dialogues for loading data and saving output - options now specified with a dialogue box rather than a command line Created on Thu Feb 06 17:29:27 2015 This program takes csv files containing voltage readings...
order_by: :param limit: :return: A Pandas dataframe """ result_list = self.get_nodes(match=match, order_by=order_by, limit=limit) return pd.DataFrame(result_list) def find(self, labels=None, neo_id=None, key_name=None, key_value=None, properties=None, subquery=None, dummy_node_name="n") -> dict: """ Regis...
# model_id self.model_id = model_id def validate(self): self.validate_required(self.id, 'id') self.validate_required(self.model_id, 'model_id') def to_map(self): result = dict() if self.auth_token is not None: result['auth_token'] = self.auth_token if self.id is not None: result['id'] = self.id if self.mod...
function(opt) { var viz = this.viz; var graph = viz.graph; var animation = this.nodeFxAnimation; var nodes = $.merge(this.viz.config, { elements : { id : false, properties : {} }, reposition : false }); opt = $.merge(nodes, opt || {}, { /** @type {function (): undefined} */ onBeforeCompute : $.empty, /** ...
# # Imports (JSON library based on import try) import sys from postmark import __version__ try: from email.mime.base import MIMEBase except ImportError as e: from email import MIMEBase if sys.version_info[0] < 3: from urllib2 import Request, urlopen, HTTPError, URLError from httplib import HTTPConnection from u...
import zipfile from collections import defaultdict from django.http import HttpResponse from rdmo.core.exports import prettify_xml from rdmo.core.renderers import BaseXMLRenderer from rdmo.projects.exports import Export class RadarExport(Export): identifier_type_options = { 'identifier_type/doi': 'DOI', 'identif...
(bool): specifies if type checking should be done one the data sent to the server. Default is True. _check_return_type (bool): specifies if type checking should be done one the data received from the server. Default is True. _host_index (int/None): specifies the index of the server that we want to use. Default ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ """ from __future__ import annotations import cv2 import numpy as np import torch from multipledispatch import dispatch from torch import nn from torch import Tensor from torchvision.transforms.functional import adjust_brightness from torchvision.transforms.functiona...
function cFuncNowUnc = interpolator(mLvl, pLvl, cLvl) # Combine the constrained and unconstrained functions into the true consumption function cFuncNow = LowerEnvelope2D(cFuncNowUnc, self.cFuncNowCnst) # Make the marginal value function vPfuncNow = self.makevPfunc(cFuncNow) # Pack up the solution and return it...
<filename>Website/FlaskWebsite/env/Lib/site-packages/matplotlib/tests/test_colorbar.py import numpy as np import pytest from matplotlib import cm import matplotlib.colors as mcolors from matplotlib import rc_context from matplotlib.testing.decorators import image_comparison import matplotlib.pyplot as plt fr...
<filename>EvalData/admin.py<gh_stars>10-100 """ Appraise evaluation framework See LICENSE for usage details """ # pylint: disable=C0330 from datetime import datetime from django.contrib import admin, messages from django.http import HttpResponseRedirect from django.urls import reverse from django.utils.timezone import...
<filename>environments/sokoban.py # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. # Adapted from https://github.com/mpSchrader/gym-sokoban # <NAME>, 2018. import os from os import listdir from os import path from os.path import isfile, join import random import numpy as np from utils.graph im...
<= 0) m.c1429 = Constraint(expr= m.x1428 - m.b3010 <= 0) m.c1430 = Constraint(expr= m.x1429 - m.b3010 <= 0) m.c1431 = Constraint(expr= m.x1430 - m.b3010 <= 0) m.c1432 = Constraint(expr= m.x1431 - m.b3010 <= 0) m.c1433 = Constraint(expr= m.x1432 - m.b3010 <= 0) m.c1434 = Constraint(expr= m.x1433 - m.b3010 <= 0) m...
(if any), else async enabled_sections: Sections to load regardless of current settings Returns: Queryset with all requested eve objects """ ids = set(map(int, ids)) enabled_sections = self.model._enabled_sections_union(enabled_sections) enabled_sections_filter = self._enabled_sections_filter(enabled_sections) ...
<reponame>ostadabbas/PressureEye<filename>options/base_options.py<gh_stars>1-10 import argparse import os from util import util import torch import models import data class BaseOptions(): """This class defines options used during both training and test time. It also implements several helper functions such as pars...
**SourcePath** *(string) --* The local absolute path of the volume resource on the host. The source path for a volume resource type cannot start with ''/sys''. - **S3MachineLearningModelResourceData** *(dict) --* Attributes that define an Amazon S3 machine learning resource. - **DestinationPath** *(string) --* The ab...
<gh_stars>0 import mmcv import torch from mmdet.core import bbox2roi, build_assigner, build_sampler from mmdet.models.dense_heads import (AnchorHead, CornerHead, FCOSHead, FSAFHead, GuidedAnchorHead, SOLOHead) from mmdet.models.roi_heads.bbox_heads import BBoxHead from mmdet.models.roi_heads.mask_heads import FCNMas...
<gh_stars>0 ''' pydevd - a debugging daemon This is the daemon you launch for python remote debugging. Protocol: each command has a format: id\tsequence-num\ttext id: protocol command number sequence-num: each request has a sequence number. Sequence numbers originating at the debugger are odd, sequence numbers ori...
# NURBSLib_EVM # (c) <NAME> 2016-2017 # <EMAIL> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is di...
conf, section = "Service"): return self.expand_special(conf.get(section, "CacheDirectory", ""), conf) def get_LogsDirectory(self, conf, section = "Service"): return self.expand_special(conf.get(section, "LogsDirectory", ""), conf) def get_ConfigurationDirectory(self, conf, section = "Service"): return self.expand...
<filename>emtypen/emtypen.py #!/usr/bin/env python import clang from clang.cindex import Index import argparse import os import re import sys indent_spaces = 4 indentation = ' ' * indent_spaces output = [''] class client_data: def __init__(self): self.tu = None self.current_namespaces = [] # cursors self.curre...
noqa: E501 else: (data) = self.__get_templates_with_http_info(bt_locator, **kwargs) # noqa: E501 return data def get_trigger(self, bt_locator, trigger_locator, **kwargs): # noqa: E501 """get_trigger # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, plea...
import copy import math from collections import defaultdict from typing import List, Set from propositional_logic.syntax import Formula as PropositionalFormula, is_variable from propositional_logic.semantics import Model UNSAT = "UNSAT" SAT = "SAT" SAT_UNKNOWN = "SAT_UNKNOWN" class CNFClause: def __init__(self, ...
# with Gaze ------------------ import bpy import numpy as np from itertools import repeat import random import os import sys from sympy.geometry import Point from numpy import cos, sin from math import radians import mathutils from bpy import context """ Render the images, Depth and capture the metadata Scenario ...
one for the output of each layer) of shape :obj:`(batch_size, sequence_length, hidden_size)`. Hidden-states of the model at the output of each layer plus the initial embedding outputs. attentions (:obj:`tuple(tf.Tensor)`, `optional`, returned when ``output_attentions=True`` is passed or when ``config.output_attenti...
so it is automatically scaled to device coordinates. The order in which the annotations are drawn is not guaranteed so if it is important, the z_index property should be set. Args: annotation: perrot.plot.Annotation or pero.Glyph Annotation to be added. x_axis: str or perrot.plot.Axis X-axis tag or the axi...
Val1: TVec< TInt,int > const & GetV(TIntV Val1, TIntV Val2) -> TIntIntVV Parameters: Val1: TVec< TInt,int > const & Val2: TVec< TInt,int > const & GetV(TIntV Val1, TIntV Val2, TIntV Val3) -> TIntIntVV Parameters: Val1: TVec< TInt,int > const & Val2: TVec< TInt,int > const & Val3: TVec< TInt,int > const & ...
<reponame>leo-b/xmlschema<filename>xmlschema/validators/global_maps.py # # Copyright (c), 2016-2020, SISSA (International School for Advanced Studies). # All rights reserved. # This file is distributed under the terms of the MIT License. # See the file 'LICENSE' in the root directory of the present # distribution, or h...
<gh_stars>0 ##################################################################### # The patcher for factory ase.calculator.vasp.Vasp class # # will change the behavior of the POSCAR writer to use vasp5 format # ##################################################################### from ase.calculators.vasp.create_inpu...
###################################################################### # CliNER - model.py # # # # <NAME> # # # # Purpose: Define the model for clinical concept extraction. # ###################################################################### import sys from sklearn.feature_extraction import DictVectorizer import o...
<reponame>albarrom/GII_O_MA_21.05<gh_stars>0 import pandas as pd import plotly.express as px import dash from dash import Dash, dcc, html, Input, Output, State import dash_bootstrap_components as dbc import numpy as np #crear un dataframe con toda la informacion de la encuesta df21 = pd.read_csv ('survey/survey_resul...
#!/usr/bin/env python3 """ cifar10.py CNN for CIFAR-10 dataset <NAME> 06/30/2020 References: https://keras.io/getting_started/intro_to_keras_for_engineers/ https://keras.io/guides/training_with_built_in_methods/#api-overview-a-first-endtoend-example https://keras.io/api/ """ import numpy as np import time imp...
<reponame>m---w/pya<filename>pya/pya.py from .Aserver import Aserver import numbers from itertools import compress import matplotlib.pyplot as plt import numpy as np import scipy.interpolate import scipy.signal from scipy.fftpack import fft, fftfreq, ifft from scipy.io import wavfile from .helpers import ampdb, dbamp, ...
<gh_stars>1-10 # Copyright (c) 2018-2021 <NAME> # SPDX-License-Identifier: MIT # # Copyright (c) 2019 <NAME> # SPDX-License-Identifier: Apache-2.0 # # Copyright (C) 2020-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # # pylint: disable=protected-access,pointless-string-statement from __future__ import ...
be fit as if it was new, as well as deep-copied.""" model = self.model self.model = None template = copy.deepcopy(self) template.reset_metrics() self.model = model return template def convert_to_refit_full_template(self): """After calling this function, returned model should be able to be fit without X_val, y_...
frequent organism most_frequent = max(self.organism_frequency.keys(), key=(lambda k: self.organism_frequency[k])) # noqa if most_frequent in organisms_to_match: entity_id, organism_id, closest_distance = self._get_closest_entity_organism_pair( # noqa entity=token, organism_matches={most_frequent: organisms_to_matc...
parts # $ argv "${a[@]}${undef[@]:-${c[@]}}" # ['1', '24', '5'] #log('DQ part %s', part) # Special case for "". The parser outputs (DoubleQuoted []), instead # of (DoubleQuoted [Literal '']). This is better but it means we # have to check for it. if len(parts) == 0: v = part_value.String('', True, False) par...
<filename>DynaShp_adj.py # ---------------------------------------------------------------------- # DynaShp_adj.py # ---------------------------------------------------------------------- # Author: <NAME> # Date: 05 February 2020 # Purpose: Script to create stn/msr shapefiles from DynAdjust .adj file # ----------------...
import chex import haiku as hk import jax import jax.numpy as jnp import numpy as np import pax import pytest # def test_batchnorm_train(): # bn = pax.BatchNorm( # 3, True, True, 0.9, reduced_axes=[0, 1], param_shape=[1, 1, 3] # ) # bn = pax.enable_train_mode(bn) # x = jnp.ones((1, 10, 3)) # old_state = bn.ema_var.av...
#!/bin/env python3 # import os # os.environ['PYTHONASYNCIODEBUG'] = '1' # import logging # logging.getLogger('asyncio').setLevel(logging.DEBUG) from datetime import datetime import traceback import atexit import argparse import os from os import path import sys import logging from struct import pack import random fro...
<reponame>enomotom/nnabla # Copyright (c) 2017 Sony Corporation. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
<gh_stars>0 from collections import namedtuple import numpy as np import param from param.parameterized import bothmethod from .core.dimension import OrderedDict from .core.element import Element, Layout from .core.options import CallbackError, Store from .core.overlay import NdOverlay, Overlay from .core.spaces imp...
<filename>src/Dijkstra_rigid_Vis.py import numpy as np import cv2 try: radius = int(input('Enter radius of the robot: ')) if radius < 0: print("Invalid radius, setting radius to 0") radius = 0 clearance = int(input('Enter clearance: ')) if clearance < 0: print("Invalid clearance, setting clearance to 0") clea...
self._parents[node]}) # if coming from parent and see unconditioned node, can go through children if node not in C: schedule.update({(child, _p) for child in self._children[node]}) return True def local_markov_statements(self) -> Set[Tuple[Any, FrozenSet, FrozenSet]]: """ Return the local Markov statements of...