input
stringlengths
2.65k
237k
output
stringclasses
1 value
<gh_stars>1000+ # coding=utf-8 # Copyright 2021 The Tensor2Tensor 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 required b...
<filename>gips/gistmodel/post_processing.py import numpy as np import copy from gips import FLOAT from gips import DOUBLE class post_processing(object): def __init__(self, fitter, x, pairs=False, prefix=None): self.fitter = fitter self.x = x self.pairs = pairs self.case = 0 score_dict = { 4 : self.parms4, 5...
i=qq,dd dd=0 o=dd,pp pp=1 i=cc,aa +->context_3_2a_1+| o=dd,ll | | i=aa,ab +->context_2a| i=aa aa=0 | o=cc,ab | dd=10 | o=aa,ll ll=1 | sh0->context_1-->sh1| ll=11 +->context_3_2a_2+|->sh1 cc=0 | i=cc,aa +->context_3_2b_1+| ab=1 | o=nn,mm | i=nn,ba mm=0 | +->context_2b| o=mm,ba ba=1 | nn=0 | | mm=1 +->context_...
apply changes to the API objects if item.api_object is not None: item.api_object.x = x item.api_object.y = y max_x = max(max_x, x) min_x = min(min_x, x) max_y = max(max_y, y) min_y = min(min_y, y) else: # shrink all for item in self.diagramScene.items(): if type(item) is BusGraphicItem: x = item.pos().x()...
"""Tests for the /login route with OpenID Connect.""" from __future__ import annotations from typing import TYPE_CHECKING from unittest.mock import ANY from urllib.parse import parse_qs, urlparse import pytest from tests.support.logging import parse_log if TYPE_CHECKING: from _pytest.logging import LogCaptureFixt...
<gh_stars>1-10 import matplotlib.pyplot as plt import seaborn as sns import numpy as np import os from typing import Union import pandas as pd import signatureanalyzer as sa # Cluster Color map COLORMAP={ 0:'#0073C2FF', 1:'#EFC000FF', 2:'#868686FF', 3:'#CD534CFF', 4:'#7AA6DCFF', 5:'#003C67FF', } COLORMAP2={ "C...
internal_tangent, componentType, count, type, "ARRAY_BUFFER") if tangent < 0: printLog('ERROR', 'Could not create accessor for tangent') continue attributes['TANGENT'] = tangent # texture coords v3dExt['uvLayers'] = {} texcoord_index = 0 process_texcoord = True while process_texcoord: texcoord_id = 'TEXC...
namespaces: asic_id = multi_asic.get_asic_index_from_namespace(namespace) for key in natsorted(port_table_keys[asic_id]): port = key.split("|")[1] muxcable_health_dict[asic_id] = per_npu_statedb[asic_id].get_all( per_npu_statedb[asic_id].STATE_DB, 'MUX_LINKMGR_TABLE|{}'.format(port)) muxcable_info_dict[asic_id] =...
<reponame>creare-com/podpac """ Weather Citizen Crowd sourced environmental observations from mobile devices (https://weathercitizen.org) - Documentation: https://weathercitizen.org/docs - API: https://api.weathercitizen.org Requires - requests: `pip install requests` - pandas: `pip install pandas` Optionally: - ...
RasterUtilClass.write_gtiff_file(dstfile, src_r.nRows, src_r.nCols, dst_data, src_r.geotrans, src_r.srs, no_data, gdaltype) @staticmethod def write_gtiff_file(f_name, n_rows, n_cols, data, geotransform, srs, nodata_value, gdal_type=GDT_Float32): """Output Raster to GeoTiff format file. Args: f_name: output gti...
"source_dir": join(TEST_DIR, "mbed", "reset"), "dependencies": [MBED_LIBRARIES], "duration": 15 }, { "id": "MBED_7", "description": "stdio benchmark", "source_dir": join(TEST_DIR, "mbed", "stdio_benchmark"), "dependencies": [MBED_LIBRARIES], "duration": 40 }, { "id": "MBED_8", "description": "SPI", "source_...
<gh_stars>0 import numpy as np from .build_processing_chain import build_processing_chain from collections import namedtuple from pprint import pprint import multiprocessing as mp from multiprocessing import get_context def run_one_dsp(tb_data, dsp_config, db_dict=None, fom_function=None, verbosity=0, fom_kwargs=None...
# RMIT University Vietnam # Course: COSC2429 Introduction to Programming # Semester: 2020C # Assignment: Assignment 1.2 - Turtle graphics, loops, and function # Author: <NAME> (s3608100) # Created date: 13/11/2020 # Last modified date: 10/12/2020 # This program is a demonstration of Carl Eranio's budding code sk...
of parameters to be passed to the optimizer disp = self.verbose - 2 if self.verbose > 1 else -1 optimizer_params = {'method': 'L-BFGS-B', 'fun': self._loss_grad_lbfgs, 'jac': True, 'args': (X_valid, y_valid, classes, target_neighbors, grad_static, use_sparse), 'x0': transformation, 'tol': self.tol, 'options':...
import os import inspect from google.auth import credentials, environment_vars from google.auth.exceptions import RefreshError from google.api_core.gapic_v1.client_info import ClientInfo from google.cloud import bigquery from google.cloud.exceptions import Forbidden from google.cloud.bigquery._http import Connection fr...
<reponame>rcsmit/newagebullshitgenerator # * New Age Bullshit Generator # * © 2014-15 <NAME> (<EMAIL>) # * Licensed under the MIT License. # * Converted into Python by <NAME>, Nov. 2020 import random import re import streamlit as st def cleanSentence(sentence): # replace 'a [vowel]' with 'an [vowel]' - works # <NAM...
#!/usr/bin/python3 import copy from gf256 import GF256 class AES: """ AES standard cryptography cipher """ Sbox = [ [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76], [0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0],...
# Copyright (c) <NAME>, TU Delft. # All rights reserved. # See COPYRIGHT for details. import ConfigParser from ConfigParser import NoOptionError import config import getopt import os import sys import utils import time def usage(): message = """ Welcome to johannes, the ugliest downloading/unpacking/configuring/buil...
from amuse.community import * from amuse.community.interface.gd import GravitationalDynamicsInterface from amuse.community.interface.gd import GravitationalDynamics from amuse.community.interface.gd import SinglePointGravityFieldInterface from amuse.community.interface.gd import GravityFieldCode class ReboundInterface...
'-126', '-125', '-3', '-2', '-1', '0', '0', '1', '2', '127', '128', '253', '254', '255']], '-1', ['i8x16', 'i8x16', 'i8x16']]) # dec vs dec case_data.append(['#', 'dec vs dec']) case_data.append(['ge_s', ['-1', '-1'], '-1', ['i8x16', 'i8x16', 'i8x16']]) case_data.append(['ge_s', ['0', '0'], '-1', ['i8x16', 'i8x16'...
1e-9)) / N def predict(self,X): """ Return predictions, (not one hot encoded format) """ # Give zeros to hidden/cell states: pasts = np.zeros((X.shape[0],self.hidden_dim_1)) _,__,___,____,_____,______,_______,_______,probs,a,b = self.forward(X,pasts,pasts) return np.argmax(probs[149],axis=1) def history(se...
import bs import random import bsUtils import bsSpaz import copy #import PlayerSpaz def bsGetAPIVersion(): # see bombsquadgame.com/apichanges return 4 def bsGetGames(): return [ZombieHorde] class Icon(bs.Actor): def __init__(self,player,position,scale,showLives=True,showDeath=True, nameScale=1.0,nameMaxWidth...
<filename>research/seq_flow_lite/layers/qrnn_layers.py # Copyright 2020 The TensorFlow Authors 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/l...
to the WriteByteList and continue with next DWORD if store2Cmds[2][0][0] != 2 and store2Cmds[2][1][0] != 2: for byteIdx in range(2): cmd = store2Cmds[2][byteIdx] if cmd[0] == 3: writeByteList.append((offX+byteIdx, cmd[1])) return self.Permute6309StoreCodeGen(bestRowAsm, layoutDict, writeByteList, 2, None) # gene...
import logging import random from django.conf import settings from django.core.exceptions import ValidationError from django.db import models, transaction, IntegrityError from django.db.models import Q, F, Count from django.http.response import ( HttpResponse, JsonResponse, StreamingHttpResponse, ) from django.sho...
pip has moved many things to `_internal` starting with pip 10 if LooseVersion(pip.__version__) < LooseVersion('10.0'): from pip.utils.logging import indent_log # pylint: disable=no-name-in-module else: from pip._internal.utils.logging import indent_log # pylint: disable=no-name-in-module platform_bits, _ = platfor...
Classifier Model loaded ====================") #SVM_accur() output = [] #print(sentence) lab = model.predict(cv.transform(sentence)) # testing sentence given as list elements #print(lab) length = len(lab) # print(x_testp) #print("Running loop") for i in range(length): # print("inside loop") if lab[i] == 0: ...
# Copyright 2021 Universidade da Coruña # # 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 wr...
"""cookiecutter-py3-package test suite.""" import datetime import importlib import os import shlex import subprocess # nosec from contextlib import contextmanager from click.testing import CliRunner from cookiecutter.utils import rmtree def post_gen_setup(*args, supress_exception=False, cwd=None): """Helper to set ...
c.partition(2, loadDefault=True) >>> len(c) 3 >>> str(c) '{1/128+1/128+1/128}' ''' if common.isListLike(value): self.partitionByList(value) elif isinstance(value, MeterSequence): self.partitionByOtherMeterSequence(value) elif common.isNum(value): self.partitionByCount(value, loadDefault=loadDefault) else: ...
# Copyright 2004-2019 <NAME> <<EMAIL>> # # 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 restriction, # including without limitation the rights to use, copy, modify, merge, # publish,...
is None: image = tf.image.per_image_standardization(image) else: assert isinstance(mean, (int, float, tuple, list)), 'mean type one of int, float, tuple, list.' assert isinstance(std, (int, float, tuple, list)), 'std type one of int, float, tuple, list.' image = tf.math.divide(tf.math.subtract(image, mean), std) ...
import base64 from contextlib import closing import gzip from http.server import BaseHTTPRequestHandler import os import socket from socketserver import ThreadingMixIn import sys import threading from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple from urllib.error import HTTPError from urllib.parse...
def IS_SV(self, is_sv): self.__is_sv = is_sv @property def ALLELES(self): ''' list of REF and ALT alleles in order ''' if self.__ALLELES is None: self.__ALLELES = [self.REF] + self.ALT.split(',') return self.__ALLELES @ALLELES.setter def ALLELES(self, alleles): self.__ALLELES = alleles @property def DEC...
# -*- coding: utf-8 -*- import tkinter as tk import sys import glob import serial as serial import time import tensorflow as tf import cv2 RightLeftCounter = 370 j2=370 j1=300 j3=300 j4=300 j5=300 j6=300 j7=300 j14=600 j15=450 delay=0.5 j1min=130 j1max=650 j2min=130 j2max=650 j3min=130 j3max...
9003405: "Mag. Black Iron Grtshld.+5", 9003406: "Mag. Black Iron Grtshld.+6", 9003407: "Mag. Black Iron Grtshld.+7", 9003408: "Mag. Black Iron Grtshld.+8", 9003409: "Mag. Black Iron Grtshld.+9", 9003410: "Mag. Black Iron Grtshld.+10", 9003600: "Div. Black Iron Greatshield", 9003601: "Div. Black Iron Grtsh...
nb_iterations = 1000 nb_inverted = 0 aug = iaa.Invert(p=iap.Binomial(0.8)) img = np.zeros((1, 1, 1), dtype=np.uint8) + 255 expected = np.zeros((1, 1, 1), dtype=np.uint8) for i in sm.xrange(nb_iterations): observed = aug.augment_image(img) if np.array_equal(observed, expected): nb_inverted += 1 pinv = nb_invert...
import re import unittest from unittest.mock import Mock from pyats.topology import Device from genie.metaparser.util.exceptions import (SchemaEmptyParserError, SchemaMissingKeyError) from genie.libs.parser.iosxr.show_interface import (ShowInterfacesDetail, ShowVlanInterface, ShowIpv4VrfAllInterface, ShowIpv6Vrf...
<filename>workers/tasks/cast.py #!/usr/bin/env python # encoding: utf-8 """ @author: <NAME> 刘祥德 @license: (C) Copyright 2019-now, Node Supply Chain Manager Corporation Limited. @contact: <EMAIL> @software: @file: cast.py @time: 2020/8/16 22:15 @version 1.0 @desc: """ # %% import time from cast.network import * from t...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Apr 19 14:55:02 2021 @author: <NAME> Copyright 2021 <NAME> 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...
from django.contrib.auth.base_user import BaseUserManager from django.db import models from django.core.validators import MinLengthValidator from django.core.validators import MaxLengthValidator from django.core.validators import RegexValidator from django.contrib.auth.models import AbstractUser from wagtail.core.model...
triplet loss loss_global, prec_global = self.criterions[1](outputs[1], targets, epoch) return loss_tri + loss_global, prec_global # trainer = CoTrainerAsyMean( # model, coModel, model_ema, coModel_ema, train_loader, unLoader, criterion, optims, alpha=args.alpha # ) class CoTrainerAsyMean(object): def saveImg(self...
# -*- coding: utf-8 -*- """ TODO: - [ ] Replace internal padded slice with kwarray.padded_slice """ from __future__ import absolute_import, division, print_function, unicode_literals import ubelt as ub import numpy as np import kwarray from distutils.version import LooseVersion try: import torch import torch.nn.fun...
import time import logging import threading import zmq from zaber.serial import * from collections import OrderedDict class ZaberXYStage: """Class for interfacing the Zaber XY-stage of the irradiation setup at Bonn isochronous cyclotron""" def __init__(self, serial_port='/dev/ttyUSB0'): """ Define the attributes...
<reponame>ToxicKidz/hata __all__ = ('SlashCommand',) from ...backend.utils import WeakReferer from ...backend.export import export from ...discord.events.handling_helpers import ( route_value, check_name, Router, route_name, _EventHandlerManager, create_event_from_class, ) from ...discord.guild import Guild fro...
!= "u" : print("\nWrong!\n") numberOfErrors = numberOfErrors + 1 wrongChars = wrongChars + "u" + ", " if guessChar == "V" or guessChar == "v" : if word[1] == "V" or word[1] == "v" : toGuess = toGuess[:1] + "v" + toGuess[2:] if word[2] == "V" or word[2] == "v" : toGuess = toGuess[:2] + "v" + ...
<filename>UI/UI_old.py # -*- coding: utf-8 -*- #Size Policies sizePolicy_MF = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Fixed) sizePolicy_MF.setHorizontalStretch(0) sizePolicy_MF.setVerticalStretch(0) sizePolicy_FP = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Preferred) sizePolicy_FP.setHorizontalStretch(0) sizePo...
default, pods share the same subnet and security groups as the worker node's primary interface. Setting this variable to true causes ipamd to use the security groups and VPC subnet in a worker node's ENIConfig for elastic network interface allocation. You must create an ENIConfig custom resource for each subnet that yo...
''' This function function used for training and cross-validating model using. The database is not included in this repo, please download the CinC Challenge database and truncate/pad data into a NxM matrix array, being N the number of recordings and M the window accepted by the network (i.e. 30 seconds). For more ...
<gh_stars>0 # -*- coding: utf-8 -*- """Client for HP Quality Center .. module:: trackapps.qc :platform: Unix :synopsis: Client for HP Quality Center .. moduleauthor:: <NAME> <<EMAIL>> """ """ Events: ------- track_before_connect track_after_connect track_before_read track_after_read track_before_create track_after...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- # # A python class to replay Kongsberg .kmall files over unicast/multicast. # Adapted from <NAME>'s HydrOffice hyo2_kng code. # # <NAME>, CCOM import datetime import getopt import KMALL import logging import numpy as np import os import socket import struct imp...
CWD, CDUP, SIZE, RNFR, RNTO, DELE, MKD, RMD, MDTM, STAT, MFMT" server_class = MProcessTestFTPd client_class = ftplib.FTP def setUp(self): self.server = self.server_class() self.server.start() self.client = self.client_class(timeout=TIMEOUT) self.client.connect(self.server.host, self.server.port) self.client.lo...
bool: """A faster implementation of sympy's is_zero_matrix Avoids repeated indexer type checks and double iteration to distinguish False/None. Found to be about 100x faster for large matrices. :param x: Matrix to check """ if isinstance(x, sp.MutableDenseMatrix): nonzero = any(xx.is_zero is not True for xx in...
import pickle as pickle from scipy.special import erf import glob import os import matplotlib.pyplot as plt from matplotlib import animation import numpy as np from skimage.feature import register_translation import matplotlib.pyplot as plt import scipy.stats import numpy as np from scipy.fftpack import ff...
<reponame>CITlabRostock/citlab-article-separation-new # -*- coding: utf-8 -*- import jpype import numpy as np import os from argparse import ArgumentParser from python_util.basic.flags import str2bool from python_util.parser.xml.page.page import Page from python_util.math.measure import f_measure from article_separat...
"""Defines the database models for file information and workspaces""" from __future__ import unicode_literals import hashlib import logging import os import re from collections import namedtuple import django.contrib.gis.db.models as models import django.contrib.gis.geos as geos import django.utils.timezone as timezo...
import pylru from .radix import RadixNode, RadixPrefix class Aggradix(object): '''Radix Tree for IPv6 address with aggregation. Represents Radix Tree with LRU cache. It automatically aggregates itself. Attributes: max_nodes (int): maximum number of nodes in Radix Tree. free_nodes (int): number of nodes which i...
# summary up to now is sum of array-averaged weather for each inverter summary /= weather_count # type: ignore # summary is now average over inverters # average zenith daytime = summary.pop("zenith") < 87.0 # type: ignore daytime.name = "daytime_flag" # type: ignore # index of data actually uploaded - any leap da...
if key_resp_2.status == STARTED: # is it time to stop? (based on global clock, using actual start) if tThisFlipGlobal > key_resp_2.tStartRefresh + 10.0-frameTolerance: # keep track of stop time/frame for later key_resp_2.tStop = t # not accounting for scr refresh key_resp_2.frameNStop = frameN # exact frame i...
26 OFF_THRESHOLDING_MEASUREMENT_V9 = 31 OFF_ADAPTIVE_WINDOW_METHOD_V9 = 32 OFF_ADAPTIVE_WINDOW_SIZE_V9 = 33 OFF_FILL_HOLES_V10 = 12 OFF_N_SETTINGS = 16 """The number of settings, exclusive of threshold settings""" N_SETTINGS = 18 UN_INTENSITY = "Intensity" UN_SHAPE = "Shape" UN_LOG = "Laplacian of Gaussian" UN_NONE =...
prev_accepted_ans = Answer.objects.filter(questionans=que, accepted=True) if request.GET.get('submit') == 'mark': if post.accepted: post.accepted = False post.save() if Reputation.objects.filter( answer_O=post, question_rep_C=15, awarded_to=post.answer_owner, reputation_on_what='ANSWER_ACCEPT').exists(): Rep...
<reponame>ctrlcctrlv/fonttools<gh_stars>1-10 """Module to build FeatureVariation tables: https://docs.microsoft.com/en-us/typography/opentype/spec/chapter2#featurevariations-table NOTE: The API is experimental and subject to change. """ from fontTools.misc.dictTools import hashdict from fontTools.misc.intTools import ...
# Copyright 2018 The TensorFlow Authors 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 applicable l...
'K Ego3_Head_roll', 'K Ego3_Head_roll_1st_der', 'L Ego3_Head_pitch', 'L Ego3_Head_pitch_1st_der', 'M Ego3_Head_azimuth', 'M Ego3_Head_azimuth_1st_der', 'N Back_pitch', 'N Back_pitch_1st_der', 'O Back_azimuth', 'O Back_azimuth_1st_der', 'P Ego2_head_roll', 'P Ego2_head_roll_1st_der', 'Q Ego2_head_pitch', 'Q Ego2_he...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import matplotlib.pyplot as plt import numpy as np from pathos.pools import ProcessPool from sklearn import gaussian_process as gp import config from spaces import GRF, GRF_KL from utils import eig, make_tripl...
<reponame>adelejjeh/hypermapper<gh_stars>0 """ Plots design space exploration results. """ import json from collections import OrderedDict, defaultdict import matplotlib from jsonschema import Draft4Validator from pkg_resources import resource_stream matplotlib.use("agg") # noqa import matplotlib.pyplot as plt from m...
from collections import defaultdict from functools import partial import inspect import logging from os import makedirs from os.path import join, abspath, exists from appdirs import user_data_dir from coala_utils.decorators import (enforce_signature, classproperty, get_public_members) import requests from coalib.r...
a bank statement of two lines of 1.00 USD (30.30 EUR) # will lead to an exchange loss, that should be handled correctly within the journal items. env = api.Environment(self.cr, self.uid, {}) # We update the currency rate of the currency USD in order to force the gain/loss exchanges in next steps rateUSDbis = env.re...
metadata has an entry at index 1 " + 'where the required svalue field is not a mapping') ) _create_sample_params_source_metadata_fail( {'a': {'b': 'c'}}, [{'key': 'a', 'skey': 'a', 'svalue': {8: 'c'}}, {'key': 'b', 'skey': 'b', 'svalue': {'b': 'c'}}], IllegalParameterError("Node at index 1's source metadata has ...
the darkness", "Left or Right? You could toss a coin if you only had a coin..." ), (True, True, True):('You came to a junction', 'You came to a junction', 'You came to a junction', 'You came to a junction', 'You came to a complex corridor, simple is better than complex.', 'You came to a complex corridor, comple...
<filename>nnuncert/models/pbp/_pbp.py # Copyright (c) 2015, <NAME> # License: copied from https://github.com/HIPS/Probabilistic-Backpropagation # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of s...
import random from tkinter import Tk, Frame, Listbox, Button, Label, Scrollbar, VERTICAL, END, SINGLE, NONE, \ StringVar, Radiobutton, Toplevel, N, S, E, W from tkinter.ttk import Notebook from project.contact import Contact import pickle from project.WheelSpinner.WheelSpinner import WheelSpinner from project.PhoneNum...
import turtle from random import randint,randrange,random import time #___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________# def Target...
= QtGui.QBrush(QtGui.QColor(235, 0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush) brush = QtGui.QBrush(QtGui.QColor(0, 0, 0)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Shadow, brush) brush...
def is_thread_operation(self) -> bool: return True def simulate(self, iaddr: str, simstate: "SimulationState") -> str: simstate.set_register(iaddr, 'v0', SV.simOne) return self.add_logmsg(iaddr, simstate, '') class MIPStub_putenv(MIPSimStub): def __init__(self) -> None: MIPSimStub.__init__(self, "putenv") d...
result)) self._uses += 1 return self._currentResource def isDirty(self): """Return True if this managers cached resource is dirty. Calling when the resource is not currently held has undefined behaviour. """ if self._dirty: return True for name, mgr in self.resources: if mgr.isDirty(): return True res = ...
from ..broker import Broker class AdvSettingDefBroker(Broker): controller = "adv_setting_defs" def show(self, **kwargs): """Shows the details for the specified adv setting def. **Inputs** | ``api version min:`` None | ``api version max:`` None | ``required:`` True | ``default:`` None :param id: The i...
<filename>app/productdb/tests/test_productdb_models.py """ Test suite for the productdb.models module """ import pytest import os import tempfile import datetime as _datetime from hashlib import sha512 from django.contrib.auth.models import User from django.core.exceptions import ValidationError from django.core.files ...
""" File: pylinex/nonlinear/loglikelihood/GaussianLoglikelihood.py Author: <NAME> Date: 25 Feb 2018 Description: File containing a class which evaluates a likelihood which is Gaussian in the data. """ import numpy as np import numpy.linalg as la from distpy import SparseSquareBlockDiagonalMatrix, TransformList,\ Win...
does not exist exception handle = "/foo/bar" self.assertRaises(NameError, check_for_index, handle) #Test if file is not bam, but exists expected #result is to throw improper file error handle = clipper.test_file("test_peakfinder.py") self.assertRaises(NameError, check_for_index, handle) #Test if file is bam...
# -*- coding: utf-8 -*- # File: data.py import copy import platform import numpy as np import bisect import cv2 import glob import random import os import PIL from tabulate import tabulate from termcolor import colored import xmltodict from tensorpack.dataflow import ( DataFromList, MapDataComponent, MultiProcessMap...
* n_node, n_core_total) request_cputime = request_walltime * n_core_total request_walltime_minute = _div_round_up(request_walltime, 60) request_cputime_minute = _div_round_up(request_cputime, 60) # decide prodSourceLabel pilot_opt_tuple = _get_prodsourcelabel_pilotypeopt_piloturlstr(workspec.pilotType, pilot_versi...
#-------------------------------------------------------------------------------------------------------------------- # Example python script that runs a few functional tests on NVMe drives. Goal is to demonstrate how to use nvmecmd # and fio to define custom NVMe tests. This is an example only and is not a comprehens...
import os import random import string from collections import OrderedDict from abc import abstractmethod import nuke from openpype.api import get_current_project_settings from openpype.pipeline import ( LegacyCreator, LoaderPlugin, ) from .lib import ( Knobby, check_subsetname_exists, reset_selection, maintaine...
on same material when right click if event.type == 'RIGHTMOUSE' and event.value == 'PRESS': bpy.ops.sprytile.grid_cycle() self.label_counter = VIEW3D_OP_SprytileGui.label_frames return ret_val # ================== # Actual GUI drawing # ================== @staticmethod def setup_offscreen(self, context): VI...
eclipsed star to normalize the weights //fclose(pfile); """ n_vertices_b = vertices_b.shape[0] n_vertices_f = vertices_f.shape[0] n_faces_b = faces_b.shape[0] weight = np.zeros(n_faces_b, dtype=np.float) #extra_compile_args = extra_link_args = ['-O3 -fopenmp'] extra_compile_args = extra_link_args = [''] tmp...
# Copyright (c) 2015 Ericsson AB. # 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 applicable law o...
}, { "id": "d27b3b69-c3c3-11e7-8d29-d15d28ee5381", "canonicalQuestion": "Reprehenderit eu consequat voluptate laboris exercitation esse sit quis est irure.", "documentId": "d27b6283-c3c3-11e7-8d29-d15d28ee5381", "page": 5, "position": { "boundingBoxes": [{ "x1": 432, "y1": 145, "x2": 587, "y2": 354 }] }, ...
""" COCOPanda :: Trash Panda COCO Data Manipulation The goal of this package is to convert the COCO dataset into the Trash Panda YOLO format (nested class directories). The code in this file is based on: - The official COCO Python API: pycocotools - https://github.com/cocodataset/cocoapi/blob/master/PythonAPI/pycoco...
## Copyright 2015 The TensorFlow Authors. 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 applicable...
problems with inheritance. :rtype: Plugin :return: The plugin instance associated with the current model class. """ return cls._system_instance.plugin def _class_get_controller_g(cls, request): """ Retrieves the controller instance that is currently set in the current environment (request) fallin...
<reponame>ameen-a/Stock-Predictor-9000 # # Created by <NAME> # *** author cannot guarantee effectiveness of this stock prediction program *** # * however if a profit is made, the author requests 80% * # # ================================ IMPORTS ====================================# # GUI from tkinter import * from tki...
be missing some timesteps. Must already have a clean utc_datetime column and timezone column. Returns: pandas.DataFrame: A dataframe containing the same demand data as the input, but with no missing and no duplicate timesteps. """ logger.info("Ensuring that Planning Area demand time series are complete.") # Re...
def are_circuit_id_fields_valid(fields, event_desc, is_mandatory=False, prefix=None): ''' Check if the circuit id fields are valid. If prefix is not none, use it as the field name prefix. Returns True if they are all valid, False if one or more are not. Logs a warning using event_desc for the first field that i...
# encoding: utf-8 # module System.Text.RegularExpressions calls itself RegularExpressions # from System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 # by generator 1.145 # no doc # no imports # no functions # classes class Capture(object): """ Represents the results from a single suc...
<filename>tests/unit/orchestrate.py # Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
<gh_stars>1-10 # Copyright (C) 2017 <NAME> import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from phonopy import Phonopy from phonopy.interface.vasp import read_vasp from phonopy.file_IO import parse_FORCE_SETS, parse_BORN, parse_FORCE_CONSTANTS from phonopy.units import VaspToCm, VaspToTHz, ...
SchemeLinkage(LinkageTag.NEXT) if contents_count == 0: return compile_const(UndefVal(), target, linkage) else: seq_list = [compile_recursive(contents[i], target, lkg_next) for i in range(contents_count-1)] + \ [compile_recursive(contents[-1], target, linkage)] seq_front = preserve_instructions(set(['env']), *seq_...
import re import json class SourceData: def __init__(self, source_file): self.source_file = source_file self.length_of_year = 0 self.year_data = [] self.year_data_lines = [] self.day_verse_list = [] self.last_three_lines = [] self.ending_info = [] self.total_entries_ok = True self.day_of_the_week_list = ['Mo...
from ... import fix_message from . import fields from . import field_types BEGINSTRING = 'FIX.4.1' MESSAGE_TYPES = {} class Header(fix_message.MessageBase): def __init__(self): super().__init__() register_StandardHeader_component(self) class Trailer(fix_message.MessageBase): def __init__(self): super().__in...