input
stringlengths
2.65k
237k
output
stringclasses
1 value
times = Sound.in_samples(times, samplerate) t = numpy.arange(0, times[-1]) frequencies = numpy.interp(t, times, frequencies) x = numpy.sin(phase + 2 * numpy.pi * numpy.cumsum(frequencies) / samplerate) out = Sound(x, samplerate) out.level = level return out @staticmethod def harmoniccomplex(f0=500, duration=1....
<filename>nlp_annotator_api/annotators/entities/common/utils.py import os from unicodedata import unidata_version from chemdataextractor import Document import re import json from inflector import Inflector resources_dir = os.path.abspath( os.path.join( os.path.dirname(__file__), "../../../resources" ) ) def RegP...
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import unittest import warnings import json import numpy as np import numpy.testing as np_test import networkx as nx from pgmpy.readwrite import ProbModelXMLReader, ProbModelXMLWriter, get_probmodel_data from pgmpy.models import BayesianModel from pgmpy.factors...
} ], 'returns': 'ViStatus' }, 'ExportSignal': { 'parameters': [ { 'direction': 'in', 'name': 'vi', 'type': 'ViSession' }, { 'direction': 'in', 'enum': 'Signal', 'name': 'signal', 'type': 'ViInt32' }, { 'direction': 'in', 'name': 'signalIdentifier', 'type': 'ViConstString' }, { 'direction': 'in', ...
<gh_stars>0 import os import cv2 import copy import numpy as np import imgaug as ia from imgaug import augmenters as iaa from keras.utils import Sequence import xml.etree.ElementTree as ET from utils import BoundBox, bbox_iou import random def parse_annotation(ann_dir, img_dir, labels=[]): all_imgs = [] seen_labels...
["2007-07-07", 80], ["2007-07-08", 75], ["2007-07-09", 115], ["2007-07-10", 58], ["2007-07-11", 65], ["2007-07-12", 78], ["2007-07-13", 74], ["2007-07-14", 83], ["2007-07-15", 93], ["2007-07-16", 96], ["2007-07-17", 169], ["2007-07-18", 98], ["2007-07-19", 47], ["2007-07-20", 76], ["2007-07-21", 98], ["2...
lons = [sta.longitude for sta in self.stations] colors = [] for station in self.stations: if station.needs_correction: colors.append("C0") else: colors.append("C1") ax.scatter( lons, lats, c=colors, zorder=999, edgecolor="k", s=no_station_connections, alpha=0.7, ) ax.scatter([], [], label="OBS station",...
them", "Storm Brand deals 40% increased Damage", "Herald of Ice has 30% reduced Mana Reservation", "40% increased Shock Nova Damage", "Split Arrow fires 3 additional Projectiles", "Lightning Spire Trap strikes an additional area", "Charged Dash has +6 to Radius of each Wave's last damage Area", "Heavy Strike has...
import os import requests from bouncer import Bouncer from flask import Flask, url_for, redirect, \ render_template, session, request, Response, \ flash, get_flashed_messages, jsonify from flask_login import LoginManager, login_required, login_user, \ logout_user, current_user, UserMixin from oauthlib.oauth2 import...
<gh_stars>1-10 # Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 import datetime import unittest from operator import attrgetter from typing import ( Any, Callable, Dict, Hashable, Iterable, Mapping, Optional, Tuple, TypeVar, Union ) from unittest import mock import pytest from...
:param base_path: Path to the CoNLL-03 corpus (i.e. 'conll_03_german' folder) on your machine :param tag_to_bioes: NER by default, need not be changed, but you could also select 'lemma', 'pos' or 'np' to predict word lemmas, POS tags or chunks respectively :param in_memory: If True, keeps dataset in memory giving sp...
<gh_stars>1-10 from libavg_charts.aid_lines.helper.intersection_method_holder import IntersectionMethodHolder from libavg_charts.aid_lines.orthogonal_aid_line import OrthogonalAidLine from libavg_charts.axis.chart_axis_enums import Orientation from libavg_charts.axis.interactive_div_node import InteractiveDivNode from ...
# -*- coding: utf-8 -*- import sys import torch from torch._C import _add_docstr, _linalg # type: ignore[attr-defined] Tensor = torch.Tensor common_notes = { "sync_note": """When inputs are on a CUDA device, this function synchronizes that device with the CPU.""" } # Note: This not only adds doc strings for funct...
<filename>extract_coding_seqs.py import argparse import os import glob import anydbm import string import subprocess import sys import tempfile from Bio.Seq import Seq from Bio.Alphabet import generic_dna import cStringIO import pickle import itertools import collections CHAIN_ID_DIR = 'chain_ids/' CHAIN_HELPERS_DIR =...
""" high-level NSQ reader class built on top of a Tornado IOLoop supporting both sync and async modes of operation. supports various hooks to modify behavior when heartbeats are received, temporarily disable the reader, and pre-process/validate messages. when supplied a list of nsqlookupd addresses, a reader instance...
<reponame>infinex/PyLighter import os import threading import pandas as pd import spacy from pylighter import config from pylighter import display as display_helper from pylighter import utils from pylighter.chunk_models import Chunk, Chunks from pylighter.shortcut_helper import shortcut_helper from pylighter.tokeniz...
'b'], ['improvvisare', 'verb', 'b'], ['improvviso', 'adjective', 'a'], ['improvviso', 'noun', 'a'], ['imprudente', 'adjective', 'c'], ['imprudente', 'noun', 'c'], ['impulsivo', 'adjective', 'c'], ['impulsivo', 'noun', 'c'], ['impulso', 'noun', 'b'], ['imputata', 'noun', 'b'], ['imputato', 'past_part', 'a'], ['imputato'...
#!/usr/bin/env python3 """Performs functions such as argument parsing, login verification, logging, and command execution that are common to all utilities in this package. """ import argparse import base64 import copy import csv import getpass import gzip import os import platform import pprint import re import random...
trues = [i for i, x in enumerate(rr) if x == True] n_trues = len( trues) if set_addition and any( rr): id_addition = "\t".join( ["TRUE" if x == True else "FALSE" for x in rr]) # Find first True index in rr first_true = next(i for i,v in enumerate(rr) if v) file_data[ first_true].insert( 0, id_addition) Outp...
<filename>dev/Gems/CloudGemMetric/v1/AWS/python/windows/Lib/numba/hsa/hsadrv/drvapi.py from __future__ import print_function, absolute_import, division import ctypes import warnings from ... import utils from . import enums from .error import HsaApiError, HsaWarning _PTR = ctypes.POINTER # HSA types ##############...
# 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 ...
%s", cached_features_file) features_and_dataset = torch.load(cached_features_file) features, dataset, examples = ( features_and_dataset["features"], features_and_dataset["dataset"], features_and_dataset["examples"], ) else: logger.info("Creating features from dataset file at %s", input_dir) if not args.data_d...
# Copyright 2018 <NAME> <<EMAIL>> # # 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,...
edge_color=edge_colors, width=weights, arrows=False) for p in pos: # change text positions x = list(pos[p]) if x[1] == 0: x[1] -= 2 else: x[1] += 2 pos[p] = tuple(x) nx.draw_networkx_labels(G, pos, font_size=4) plt.show() return ###### transitionGraph for method 5 def transitionGraphMeth...
multi import decleration is optional # We skip over the only module name parsed and the semi-colon # This is what enables ';' to be optional in single-module definitions if self.peek().type == _TokenType.SEMICOLON: # If the current token after # ... the ')' is a semi-colon (;) # ... we skip the semicolon itself ...
(eq, ":reason", tpe_point_won_the_round), (str_store_string, s3, "str_tpe_award_point_winning_team"), (else_try), (eq, ":reason", tpe_point_best_scoring_team), (str_store_string, s3, "str_tpe_award_point_highest_scoring_team"), (else_try), (str_store_string, s3, "@because I said so"), # This should hopefully ...
<reponame>lauramurgatroyd/CILViewer<gh_stars>0 import sys from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5.QtWidgets import * import vtk #from ccpi.viewer.QVTKCILViewer import QVTKCILViewer from ccpi.viewer.QVTKWidget import QVTKWidget from vtk.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor from c...
<gh_stars>0 #!/usr/bin/python3 from pynput.keyboard import Key, KeyCode, Listener, Controller, GlobalHotKeys import pyperclip import tkinter as tk from time import sleep, time from datetime import datetime, timedelta import logging import requests import api import window_name from PIL import Image import pystray impor...
''' Based on https://www.mattkeeter.com/projects/contours/ and http://www.iquilezles.org/ ''' import numpy as np from util import * import matplotlib.pyplot as plt import matplotlib.patches as patches fig1 = plt.figure() ax1 = fig1.add_subplot(111, aspect='equal') ax1.set_xlim([0, 1]) ax1.set_ylim([0, 1]) class Implic...
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ **Project Name:** MakeHuman **Product Home Page:** http://www.makehumancommunity.org/ **Github Code Home Page:** https://github.com/makehumancommunity/ **Authors:** <NAME>, <NAME> **Copyright(c):** MakeHuman Team 2001-2019 **Licensing:** AGPL3 Th...
pinfo["step"] = "post-merge" job = yield from job_manager.defer_to_thread(pinfo,partial(self.post_merge, source_names, batch_size, job_manager)) job = asyncio.ensure_future(job) def postmerged(f): try: self.logger.info("Post-merge completed [%s]" % f.result()) self.register_status("success",job={"step":"post-merg...
sticky = W + E) num = 0 bkwd_button = Button(right_frame, text = "<<", width = 5, borderwidth = 5, command = lambda: backward_button(num)) bkwd_button.grid(row = 4, column = 0) exit_button = Button(right_frame, text = "Exit Program", width = 10, borderwidth = 5, command = home_submit) exit_button.grid(row = 4...
1.00 15.01 ? 242 GLY B C 1 ATOM 3539 O O . GLY B 1 240 ? 59.211 -28.896 -2.635 1.00 13.90 ? 242 GLY B O 1 ATOM 3540 N N . THR B 1 241 ? 60.601 -30.426 -1.689 1.00 13.97 ? 243 THR B N 1 ATOM 3541 C CA . THR B 1 241 ? 59.564 -31.270 -1.128 1.00 13.98 ? 243 THR B CA 1 ATOM 3542 C C . THR B 1 241 ? 58.834 -30.358 -0.09...
<reponame>GiantTreeLP/porth-jvm from jawa.assemble import Label from jawa.attributes.bootstrap import BootstrapMethod, BootstrapMethodsAttribute from jawa.constants import MethodHandleKind from extensions.DeduplicatingClassFile import DeduplicatingClassFile from jvm.intrinsics import OperandType from jvm.intrinsics.st...
"""The schema.org Person model. For reference see schema.org: https://schema.org/Person """ from dataclasses import dataclass from . import Thing @dataclass class Person(Thing): """ The schema.org Person model Attributes ---------- additionalName Text An additional name for a Person, can be used for a middle...
stakeholder_id = conversation.stakeholder.id stakeholder = Stakeholders.objects.get(id=stakeholder_id) scenario = Scenarios.objects.get(scenario_id=scenario_id) # Check if response is already in db try: responseObj = Responses.objects.get(response=0, student=student_id, scenario=scenario_id, page=page_id, course=...
0): (-1, 1), (6, 27, 2, 1): (-1, 1), (6, 27, 2, 2): (-1, 1), (6, 27, 2, 3): (-1, 1), (6, 27, 2, 4): (-1, 1), (6, 27, 2, 5): (-1, 1), (6, 27, 3, -5): (1, 1), (6, 27, 3, -4): (1, 1), (6, 27, 3, -3): (1, 1), (6, 27, 3, -2): (1, 1), (6, 27, 3, -1): (1, 1), (6, 27, 3, 0): (1, 1), (6, 27, 3, 1): (1, 1), (6, 27, ...
import torch from saliency.saliency import Saliency import numpy as np from scipy.ndimage import label import torchvision from torch.autograd import Variable from torch.autograd import Variable import torch.nn as nn import torch.nn.functional as F import torchvision import torchvision.transforms as transforms import to...
Avoid entering confidential information. """ return pulumi.get(self, "content") @property @pulumi.getter def format(self) -> str: """ Readme format. Supported formats are text/plain and text/markdown. """ return pulumi.get(self, "format") @pulumi.output_type class GetContainerRepositoriesFilterResult(dict):...
16) mem_end = long(mem.group(2), 16) mem_size = mem_end-mem_start memory_buff = readMem(mem_start, mem_size); offset = 0 if memory_buff: while True: mem_location = memory_buff.find(to_search) if not mem_location==-1: offset+=mem_location value = memory_buff[mem_location:mem_location+len(to_search)+16] prin...
for step in cyc_steps.keys(): if len(cyc_steps[step][1]) == 0: continue step_type, data = cyc_steps[step] start_time = min([d[3] for d in data]) second_accuracy = all([d[4] for d in data]) steps.append( Step( cycle = cyc, step_number = step, step_type = cyc_steps[step][0], start_time = halifax_timezone.loc...
<filename>aa/tests.py import os from nose.tools import with_setup from webtest import TestApp from oauth_provider.models import Resource, Consumer, Token, Nonce from oauth_provider.oauth_request import application from oauth_provider.oauth import OAuthRequest, OAuthSignatureMethod_HMAC_SHA1, OAuthToken, OAuthConsume...
def GetPropertyByNameA(*args, **kwargs): """GetPropertyByNameA(self, String name) -> PGProperty""" return _propgrid.PropertyGridInterface_GetPropertyByNameA(*args, **kwargs) def GetEditorByName(*args, **kwargs): """GetEditorByName(String editorName) -> PGEditor""" return _propgrid.PropertyGridInterface_GetEditorB...
from nltk.corpus import wordnet as wn import nltk import numpy as np import pm4py from pm4py.objects.log.log import EventLog from nlp_label_quality.analysis import matrix_eval from typing import Dict, List, Tuple, Union, Any from nlp_label_quality.analysis.attribute_value import Attribute, AttributeValue import tim...
import torch import torch.nn as nn import numpy as np from ...layers import * __all__ = ['parse_cfg', 'create_modules', 'get_IoUs', 'rewrite_results', 'rewrite_bboxes', 'YOLOv3'] class NoNetBlock(Exception): def __init__(self, blocks): self.blocks = blocks def __str__(self): return repr("There is no 'net' blo...
HDFS if Hive metastore created the directory for the table first. if isinstance(cluster, ClouderaManagerCluster) and cluster.version.startswith('cdh7'): hadoop_fs.impersonation_user = "root" hive_metastore = pipeline_builder.add_stage('Hive Metastore', type='destination') dev_raw_data_source >> expression_evaluat...
<filename>mopidy/backend.py<gh_stars>1000+ from __future__ import annotations import logging from typing import TYPE_CHECKING import pykka from mopidy import listener if TYPE_CHECKING: from typing import Any, Dict, List, Optional, Set, TypeVar, Union from typing_extensions import Literal from mopidy.models imp...
v] elif k == 'rustc-link-search': #dbg("adding link search path: %s" % v) cmd += ['-L', v] elif k == 'rustc-cfg': cmd += ['--cfg', v] env['CARGO_FEATURE_%s' % v.upper().replace('-', '_')] = 1 else: #dbg("env[%s] = %s" % (k, v)); denv[k] = v return (cmd, env, denv) class Crate(object): def __init__(self, cr...
(self.dataObject.equation.ci[i][0], self.dataObject.equation.ci[i][1]) + '<br>') self.stringList.append('\n' + '<br>') self.stringList.append("Coefficient Covariance Matrix" + '<br>') for i in self.dataObject.equation.cov_beta: self.stringList.append(str(i) + '<br>') self.stringList.append('</td></tr></table>\n')...
<reponame>hecmec/fs-crawler-elasticsearch-py #!/usr/bin/env python2.7 # encoding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses thi...
prediction = tf.argmax(logits, axis=1) return prediction def loss(self, logits, labels, regularization): """Adds to the inference model the layers required to generate loss.""" with tf.name_scope('loss'): with tf.name_scope('cross_entropy'): labels = tf.to_int64(labels) cross_entropy = tf.nn.sparse_softmax_cros...
<reponame>kerkness/pyro-simconnect<filename>SimConnect/EventList.py from SimConnect import * class Event(object): def __call__(self, value=0): if self.event is None: self.event = self.sm.map_to_sim_event(self.deff) self.sm.send_event(self.event, DWORD(value)) def __init__(self, _deff, _sm, _dec=''): self...
# Copyright 2017 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 ...
<filename>contrib/devtools/github-merge.py #!/usr/bin/env python3 # Copyright (c) 2016-2017 The Cruro Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # This script will locally construct a merge commit for a pull r...
<gh_stars>1-10 import os from itertools import product import numpy as np import pandas as pd from pandas._testing import assert_series_equal ROOT_DIR = os.path.abspath(os.curdir) def calculate_third_degree_coefficients(x, y): c = [0, 0, 0] x10 = x[1] - x[0] xq01 = x[0] ** 2 - x[1] ** 2 x20 = x[2] - x[0] xq02 ...
info[0] return info def system_info(**kwargs): """ Return system information for grains of the minion. .. code-block:: bash salt '*' nxos.system_info """ warn_until("Argon", "'nxos.system_info' is deprecated in favor of 'nxos.grains'") return salt.utils.nxos.system_info(show_ver(**kwargs))["nxos"] # -----...
#!/usr/bin/env python3 """Artistools - spectra related functions.""" import argparse import json import math import multiprocessing from collections import namedtuple from functools import lru_cache, partial from pathlib import Path import matplotlib as mpl import matplotlib.pyplot as plt import matplotlib.ticker as t...
# -*- coding: utf-8 -*- import csv import datetime import logging import requests import tempfile import zipfile from collections import OrderedDict from datetime import date from decimal import Decimal from django.core.management.base import BaseCommand from django.db import connection from requests_oauthlib import O...
<reponame>FredHutch/quantify-view-cells<gh_stars>0 #!/usr/bin/env python3 import argparse from collections import defaultdict import dash import dash_bootstrap_components as dbc import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, MATCH, ALL import logging...
from os import path, getcwd import tkinter as tk class Settings(object): def __init__(self, master): self.master = master self.functions = master.functions self.points = 100 self.start = 10 self.end = 60 self.baseline_order = 1 self.background_window = 1 self.noban_start = 0.25 self.slicepoints = 5 self.p...
'2019-09-01': from ..v2019_09_01.aio.operations_async import IpGroupsOperations as OperationClass elif api_version == '2019-11-01': from ..v2019_11_01.aio.operations_async import IpGroupsOperations as OperationClass elif api_version == '2019-12-01': from ..v2019_12_01.aio.operations_async import IpGroupsOperations...
0 contour = segment[i] cnt = len(contour) c = np.zeros((int(cnt / 2), 1, 2), dtype=np.int32) for j in range(0, cnt, 2): c[id, 0, 0] = contour[j] c[id, 0, 1] = contour[j + 1] id = id + 1 contours.append(c) cv2.drawContours(image, contours, -1, color_cat[label], -1) x1, y1 = box[:2] cv2.putText(image, cat_dict...
'spirit-install-instmgr-oper' _revision = '2015-11-09' def __init__(self): self.parent = None self.file_name = None self.brief = SoftwareInstall.Files.File.Brief() self.brief.parent = self self.detail = SoftwareInstall.Files.File.Detail() self.detail.parent = self class Brief(object): """ Show information...
<filename>docs/code/WhenToStopFuzzing.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- # "When To Stop Fuzzing" - a chapter of "The Fuzzing Book" # Web site: https://www.fuzzingbook.org/html/WhenToStopFuzzing.html # Last change: 2022-02-09 08:45:44+01:00 # # Copyright (c) 2021 CISPA Helmholtz Center for Information S...
accu_bottom_gap += items_sorted[i].bottom - items_sorted[i - 1].bottom return not accu_bottom_gap > 0.5 * group_height def find_reference(self, reference_candidate=None, other_group_in_same_big_category=None): ## if more than 6 items, no need to describe each single item if self.category == 'house' and len(self.i...
= '\n' else: eol_ = '' showIndent(write, level, pretty_print) write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', )) already_processed = set() self.exportAttributes(write, level, already_processed, namespace_, name_='MalwareExceptionType') if self.hasContent_(): write('>%s' % (eol...
<reponame>GoogleCloudPlatform/automl-translation-tools<gh_stars>1-10 # 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 # # http://www.apache.org/licenses/LICENSE-2.0...
'share/Pythia8/xmldoc'), rundir) #link the hwpp exe in the rundir if shower == 'HERWIGPP': try: if os.path.exists(pjoin(self.options['hwpp_path'], 'bin', 'Herwig++')): files.ln(pjoin(self.options['hwpp_path'], 'bin', 'Herwig++'), rundir) if os.path.exists(pjoin(self.options['hwpp_path'], 'bin', 'Herwig')): files...
<gh_stars>1-10 from datetime import datetime from decimal import Decimal import logging import os import re from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.core.management import call_command from django.core.management.base import BaseCommand...
#!/usr/bin/python3 import phue import json import random as rng import time, datetime from Repeater import repeater, time_delta # Timed effects import argparse #Accept cli arguments import sys #Accept cli arguments from copy import deepcopy # Copy dicts BRIDGES = { 'Bridge1' : {'ip': '<ip>', 'uname': '<username>'}, ...
<gh_stars>0 #!/usr/bin/env python # -*- coding: utf-8 -*- import gzip import os from Bio import SeqIO, pairwise2, motifs from Bio.Seq import Seq from datetime import datetime from scipy import stats import pandas as pd import matplotlib.pyplot as plt import json from random import randint import math i...
a max). The vast majority of characters in regular expressions occur without a specific multiplier, which is implicitly equivalent to a min of 1 and a max of 1, but many more have explicit multipliers like "*" (min = 0, max = inf) and so on. e.g. a, b{2}, c?, d*, [efg]{2,5}, f{2,}, (anysubpattern)+, .*, and so...
## Functions used with the Marc Mentat units # Imports import numpy import time from py_mentat import py_send from evolve_soft_2d import classes, utility from evolve_soft_2d.evolve import cppns, gen_alg, lsystems from evolve_soft_2d.unit import inspect, modify, rep_grid from evolve_soft_2d.result import analyse, obt...
II111iiii / i1IIi for Ii11 in range ( OOoO000o00000 . record_count ) : iI1iii1IIIIi = lisp_eid_record ( ) packet = iI1iii1IIIIi . decode ( packet ) if ( packet == None ) : lprint ( "Could not decode EID-record in Map-Referral packet" ) return if 77 - 77: oO0o . IiII + I1ii11iIi11i . i1IIi iI1iii1IIIIi . print_r...
inp = tf.linalg.matmul( tf_layers_dict[get_tf_edges_from(tf_edges, layer_id, 0)], tf_layers_dict[get_tf_edges_from(tf_edges, layer_id, 1)], transpose_a, transpose_b ) tf_layers_dict[layer_id] = extrapolation_of_layers( wr_config[layer_id], inp ) else: tf_layers_dict[layer_id] = tf.linalg.matmul( tf_layers_d...
# -*- coding=utf-8 -*- # 1. 裁剪(需改变bbox) # 2. 平移(需改变bbox) # 3. 改变亮度 # 4. 加噪声 # 5. 旋转角度(需要改变bbox) # 6. 镜像(需要改变bbox) # 7. cutout import time import random import cv2 import os import math import numpy as np from skimage.util import random_noise from skimage import exposure def show_pic(img, label, bbox...
<reponame>todorcevicM/simplex<filename>simplex_text.py """ max z = 6x_1 + 14x_2 + 13x_3 0.5x_1 + 2x_2 + 1x_3 <= 24 1x_1 + 2x_2 + 4x_3 <= 60 x_1, x_2, x_3 >= 0 1. ukoliko su neke od jednakosti >= mora da se pomnozi ta jednakost sa -1 2. pretvaramo <= u < tako sto dodajemo nove promenljive: 0.5x_1 + 2x_2 + 1x_3 + x_4...
- 1) + 2/3*(2*cos(1/2*sqrt(3)*(t - 2))*e^(1/2*t - 1) + e^(-t + 2))*heaviside(t - 2) sage: inverse_laplace(1/(s - 1), s, x) e^x The inverse Laplace transform of a constant is a delta distribution:: sage: inverse_laplace(1, s, t) dirac_delta(t) sage: inverse_laplace(1, s, t, algorithm='sympy') dirac_delta(t) ...
<reponame>torchbox/django-importo<filename>importo/commands.py import argparse import json import logging import uuid import warnings from collections import defaultdict from copy import copy from operator import attrgetter from typing import Any, Dict, List, Mapping, Optional, Sequence, Tuple, Union from urllib.parse ...
<filename>isso/mysql/comments.py # -*- encoding: utf-8 -*- import time import pickle import logging from isso.utils import Bloomfilter from isso.compat import buffer logger = logging.getLogger("isso") class Comments: """Hopefully DB-independend SQL to store, modify and retrieve all comment-related actions. Here's...
a pan, zoom or change of data, in order to autoscale X or Y axes, autopan the X axis and update the non-plot accessories (axes tick labels, etc). """ if self._adjusting: return self._adjusting = True try: limits = self.get_limits('data') with self.viewer.suppress_redraw: # set limits to combined data limits ...
import gym import numpy as np from copy import deepcopy from gym_fabrikatioRL.envs.core import Core from gym_fabrikatioRL.envs.core_state import State from gym_fabrikatioRL.envs.interface_input import Input from gym_fabrikatioRL.envs.env_utils import UndefinedOptimizerConfiguration from gym_fabrikatioRL.envs.env_utils...
Constraint(expr= -10 * m.b139 + m.x816 <= 0) m.e965 = Constraint(expr= -10 * m.b140 + m.x820 <= 0) m.e966 = Constraint(expr= -10 * m.b141 + m.x824 <= 0) m.e967 = Constraint(expr= -10 * m.b142 + m.x828 <= 0) m.e968 = Constraint(expr= -10 * m.b143 + m.x832 <= 0) m.e969 = Constraint(expr= -10 * m.b144 + m.x836 <= 0) m.e97...
"add", prefixtoroute, "via", lo, "dev", "sit1", "metric", "1"] commands.append(' '.join(command_list)) del_commands = [command.replace("add", "del").replace("up", "down") for command in commands] self.route_list.extend(del_commands) for command in commands: self.exec_cmd(command) else: raise Exception("Unknown...
<reponame>neon-cyan/quantpy import mathutils import numpy as np import sys import os import json if len(sys.argv) < 5: print(f"""Not enough arguemnts!\n Use : {sys.argv[0]} [/path/manifest.json] => [BL=1-2,2-3] => [PBL=1-2,2-3] => [NM=1,2,3] => [CIs=A|1,2,3] => [CSFs=A|1,2,3] => [CSFv=label:1,1,0,0_label:0,0,...
input for fight with the alien # def fight(stamina): # stamina # while stamina > 0: # # won't enter this loop ever. The function will always return False. # response = raw_input(" Enter a move 1.Hit 2.attack 3.fight 4.run") # # chose a response from ( hit, attack, fight and run) # # fight scene # if "hit" in response o...
# -*- coding: utf-8 -*- import pygame import random import os import numpy as np WHITE = (0xff, 0xff, 0xff) BLACK = (0, 0, 0) GREEN = (0, 0xff, 0) RED = (0xff, 0, 0) BLUE = (0, 0, 0xff) LINE_COLOR = (0x00, 0x00, 0x00) FPS = 30 HARD_LEVEL = list(range(4, FPS // 2, 2)) hardness = HARD_LEVEL[0] D_LEFT, D_RIGHT, D_UP,...
{'империеи': 1}, {'имущественный': 2}, {'имущество': 1}, {'имя': 6}, {'индонезииские': 1}, {'инсаидерскои': 1}, {'инстанция': 1}, {'интимнои': 1}, {'иоркское': 1}, {'иранскои': 1}, {'ирландский': 1}, {'испанский': 1}, {'исправить': 1}, {'истечение': 1}, {'каимановы': 2}, {'капитализм': 1}, {'качественны...
from event_signal import MethodObserver def test_method_observer(): class Point(MethodObserver): def __init__(self, x=0, y=0): self._x = x self._y = y def get_x(self): return self._x def set_x(self, x): self._x = x def get_y(self): return self._y def set_y(self, y): self._y = y def move(self, x, y):...
<filename>fuzzy_file_nav.py """ Fuzzy File Navigation. Licensed under MIT Copyright (c) 2012 - 2015 <NAME> <<EMAIL>> """ import sublime import sublime_plugin import os import os.path as path import re import shutil import glob from FuzzyFileNav.multiconf import get as qualify_settings from FuzzyFileNav.notify import e...
r'$\frac{1}{\sigma} \frac{d\sigma}{d' + variables_latex[variable] + '} \left[\mathrm{GeV}^{-1}\\right]$', CMS.y_axis_title ) plt.tick_params( **CMS.axis_label_major ) plt.tick_params( **CMS.axis_label_minor ) hist_data.visible = True if category == 'central': hist_data_with_systematics.visible = True rplt.errorb...
There is a small chance we have neither fg nor bg samples. if keep.shape[0] == 0: # Pick bg regions with easier IoU threshold bg_ids = np.where(rpn_roi_iou_max < 0.5)[0] assert bg_ids.shape[0] >= remaining keep_bg_ids = np.random.choice(bg_ids, remaining, replace=False) assert keep_bg_ids.shape[0] == remaining k...
if k == 0 else -1 # s=+1 for left spectrum, s=-1 for right one vel, sig = vsyst + s*pars[0 + p], pars[1 + p] a, b = [vel, sigma_diff]/sig w = np.linspace(0, np.pi*factor*sig, nl) losvd_rfft[:, j, k] = np.exp(1j*a*w - 0.5*(1 + b**2)*w**2) if mom > 2: n = np.arange(3, mom + 1) nrm = np.sqrt(special.factorial(n)*2...
= 'auto', width = _width_b)) self.b_reload.on_click(self.reload) #Output widgets for HTML content self.out_html = widgets.Output() #Layout _down_b = widgets.HBox([self.db_zip], layout = widgets.Layout(**_layout_around)) _down_out = widgets.HBox([self.out_html], layout = widgets.Layout(**_layout_around)) ...
*/ {\n" + " 'Value2': '2'\n" + "});", # expected "test( /*Argument 1*/\n" + " {\n" + " 'Value1': '1'\n" + " },\n" + " /*Argument 2\n" + " */\n" + " {\n" + " 'Value2': '2'\n" + " });"); bt( "test(\n" + "/*Argument 1*/ {\n" + " 'Value1': '1'\n" + "},\n" + "/*Argument 2\n" + " */ {\n" + " 'Value2': '2'\...
in %s is not a scalar.'%(self,) assert isscalar(self[0]) or isoperator(self[0]) or issuperoperator(self[0]),\ 'The base in %s is not square.'%(self,) def _shapetype(self): ''' >>> shape(Scalar('x')**Scalar('y')) () >>> shape(Operator('O', 10)**Scalar('x')) (10, 10) ''' return shapetype(self[0]) def _dims(s...
the location of the expression for error reporting, e.g. a file name and a position in the file. """ return pulumi.get(self, "location") @property @pulumi.getter def title(self) -> str: """ An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow...
<gh_stars>1-10 # -*- coding: utf-8 -*- import numpy as np COPPER = np.array([ [0, 0, 0, 255], [0, 0, 1, 255], [0, 1, 2, 255], [1, 2, 3, 255], [1, 3, 4, 255], [2, 3, 6, 255], [2, 4, 7, 255], [3, 5, 8, 255], [3, 6, 9, 255], [4, 7, 11, 255], [4, 7, 12, 255], [5, 8, 13, 255], [5, 9, 14, 255], [6, 10, 16, 2...
import unittest from prestans import exception from prestans.parser import AttributeFilter from prestans import types class ModelUnitTest(unittest.TestCase): def test_required(self): class MyModel(types.Model): pass required_default = MyModel() self.assertTrue(required_default._required) required_true = MyM...
2 2 6 1 4 9 1 4 4 2 2 6 1 4\ 9 1 4 4 2 2 6 1 4 9 1 5 1 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2\ 3 2 3 2 3 2 3 2 3 2 3 2 3 4 4 3 8 9 4 3 3 4 9 1 3 4 4 3\ 8 2 4 3 3 4 3 3 3 4 4 3 8 9 4 3 3 4 9 3 3 2 3 4 4 3 8 7\ 4 3 3 4 8 3 1 2 1 1 1 5 1 1 6 1 tegar_ID 1 1 tegar_ID 9 3 2 \ 6 8 1 1 1 1 1 9 1 1 tegar_ID 3 2 3 4 4 3 8 9 4 3 3 ...