input
stringlengths
2.65k
237k
output
stringclasses
1 value
True self.event_manager.run_callback("IRC/CTCPQueryReceived", event) if action.upper() == "ACTION": e = general_events.ActionReceived( self, user_obj, channel_obj, data ) e.cancelled = event.cancelled self.event_manager.run_callback("ActionReceived", e) if e.printable: self.log.info(u"* %s:%s %s" % (user_o...
(float(v) for v in next(header_file).split()) if self.dimensionality > 1: ylo, yhi = (float(v) for v in next(header_file).split()) else: ylo, yhi = default_ybounds if self.dimensionality > 2: zlo, zhi = (float(v) for v in next(header_file).split()) else: zlo, zhi = default_zbounds self.grid_left_edge[grid_coun...
if self.op_types: if len(self.op_types) != len(self.generators): self.set_exception( Exception("Not all generators have op_type!")) self.complete_task() if self.buckets: if len(self.op_types) != len(self.buckets): self.set_exception( Exception("Not all generators have bucket specified!")) self.complete_task() ...
<filename>pyia/data.py<gh_stars>0 # coding: utf-8 """ Data structures. """ # Standard library import pathlib # Third-party import astropy.coordinates as coord from astropy.table import Table, Column from astropy.time import Time import astropy.units as u import numpy as np from .extinction import get_ext from .ruwet...
if voice == 0: i01.mouth.speak("loading joystick Script") elif voice == 1: i01.mouth.speak("laddar joystick Script") serial = Runtime.createAndStart("serial","Serial") serial.connect('COM7') joystick = Runtime.start("joystick","Joystick") joystick.setController(14) listener3 = MRLListener('publishJoystickInput',...
0x0000, (0x69, 0x00)) # mpu.step() # self.assertEqual(0x0002, mpu.pc) # self.assertEqual(0x76, mpu.a) # self.assertEqual(0, mpu.p & mpu.NEGATIVE) # self.assertEqual(0, mpu.p & mpu.OVERFLOW) # self.assertEqual(0, mpu.p & mpu.ZERO) # self.assertEqual(0, mpu.p & mpu.CARRY) # TODO: enable this once code supports i...
[np.array([1, 1, 2, 2]), np.array([1, 2, 1, 2])], np.array([1, 2, 1, 2]) ) # Test with aggfunc norm_counts = DataFrame( [[0.25, 0, 0.25], [0.25, 0.5, 0.75], [0.5, 0.5, 1]], index=Index([1, 2, "All"], name="a", dtype="object"), columns=Index([3, 4, "All"], name="b"), ) test_case = crosstab( df.a, df.b, df.c, a...
<reponame>oncebasun/seq2seq-theano # -*- coding: utf-8 -*- #!/usr/bin/env python from __future__ import print_function from MyAlgorithm.filter_wrong_forms_reinflection_new import Filter as Filter2 # the 'new' here is a test from MyAlgorithm.filter_wrong_forms import Filter import perceptron_c, align, codecs, sys, re,...
options={ 'verbose_name': '07 SKPD Asal ATL Disdik SMPN 1 Paringin', 'proxy': True, 'verbose_name_plural': '07 SKPD Asal ATL Disdik SMPN 1 Paringin', }, bases=('atl.skpdasalatl',), ), migrations.CreateModel( name='SKPDAsalATLDisdikSMPN2Awayan', fields=[ ], options={ 'verbose_name': '07 SKPD Asal ATL Disdik ...
formatvalue=var_repr ) call = tpl_call.format(file=func, scope=scope) except KeyError: # This happens in situations like errors inside generator # expressions, where local variables are listed in the # line, but can't be extracted from the frame. I'm not # 100% sure this isn't actually a bug in inspect itself, ...
'_-Утилизация одежды (нормо-часов)':2 / 60, '+Ткань хлопчатая, лоскуты (доступно/квадратный метр)':0.53, } metadict_detail['_Утилизация одежды, чулки (хлопок)'] = { '_-Утилизация одежды (нормо-часов)':2 / 60, '+Ткань хлопчатая, лоскуты (доступно/квадратный метр)':0.95, } metadict_detail['_Утилизация одежды, жиле...
""" flask_security.datastore ~~~~~~~~~~~~~~~~~~~~~~~~ This module contains an user datastore classes. :copyright: (c) 2012 by <NAME>. :copyright: (c) 2019-2020 by <NAME> (jwag). :license: MIT, see LICENSE for more details. """ import json import uuid from .utils import config_value class Datastore: def __in...
if key in boolean_keys: value = parser.getboolean(section_name, key) if key in not_cfn_param_keys: self.cfn_param_file_values[key] = value else: self.cfn_param_file_values[key] = value params.append( { 'ParameterKey': key, 'ParameterValue': str(value), 'UsePreviousValue': False } ) return params @stati...
<filename>google-cloud-sdk/lib/googlecloudsdk/third_party/apis/datacatalog/v1beta1/datacatalog_v1beta1_messages.py """Generated message classes for datacatalog version v1beta1. A fully managed and highly scalable data discovery and metadata management service. """ # NOTE: This file is autogenerated and should not be e...
<gh_stars>0 import numpy as np import math import copy from collections import deque import time import collections from ortools.sat.python import cp_model from algorithms import heavy_cp # Calculate the longest path of a given DAG task def longest_path_dag(adjacency) -> float: cost = np.zeros(adjacency.shape) num_n...
# Developed by Redjumpman for Redbot. # Inspired by Spriter's work on a modded economy. # Creates 1 json file, 1 log file per 10mb, and requires tabulate. # STD Library import asyncio import gettext import logging import logging.handlers import os import random from copy import deepcopy from fractions impo...
self.Last_Login def set_Last_Login(self, Last_Login): self.Last_Login = Last_Login def get_Privilege_List(self): return self.Privilege_List def set_Privilege_List(self, Privilege_List): self.Privilege_List = Privilege_List def get_Script_Path(self): return self.Script_Path def set_Script_Path(self, Script_Path): s...
If there is a `depends_init` edge from A to B in the graph, A's request will be made first if `reverse` is false, otherwise B's request will be made first. capture_block The capture block is that being transitioned """ # Create a copy of the graph containing only dependency edges. deps_graph = scheduler.subgraph...
<gh_stars>0 from cgi import print_arguments from dataclasses import dataclass import math from operator import index from pyexpat.errors import XML_ERROR_XML_DECL from re import T from typing import Tuple import matplotlib.pyplot as plt from numpy import percentile import seaborn as sns import pandas as pd import rando...
transaction quantity: The transaction quantity of the involved asset short: Whether the transaction is short or long (True is short, False is long) Returns: A boolean value indicating the validity of the transaction. Raises: ValueError: When the transaction quantity is below 0. A transaction quantity is ...
# -*- coding: utf-8 -*- # snapshottest: v1 - https://goo.gl/zC4yUc from __future__ import unicode_literals from snapshottest import Snapshot snapshots = Snapshot() snapshots['test_basic_dep_fan_out 1'] = '''{ "__class__": "PipelineSnapshot", "config_schema_snapshot": { "__class__": "ConfigSchemaSnapshot", "all_c...
"issuer") @issuer.setter def issuer(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "issuer", value) @property @pulumi.getter(name="openIdConnectDiscoveryDocument") def open_id_connect_discovery_document(self) -> Optional[pulumi.Input[str]]: """ The OpenID connect discovery document. """ return ...
<filename>draco/analysis/flagging.py """Tasks for flagging out bad or unwanted data. This includes data quality flagging on timestream data; sun excision on sidereal data; and pre-map making flagging on m-modes. Tasks ===== .. autosummary:: :toctree: DayMask MaskData MaskBaselines RadiometerWeight SmoothVisWe...
= False for i in xrange(len(self._db_actions)): if self._db_actions[i].db_id == action.db_id: self._db_actions[i] = action found = True break if not found: self._db_actions.append(action) self.db_actions_id_index[action.db_id] = action def db_delete_action(self, action): self.is_dirty = True for i in xrange(...
#self.elmcolorobjdic,'dic-color'], 'aa-residue-color':['Method',self.parent.GetButtonColors,self.colorpanelobjdic['residue'][1],'dic-color'], #self.rescolorobjdic,'dic-color'], 'aa-chain-color':['Method',self.parent.GetButtonColors,self.colorpanelobjdic['chain'][1],'dic-color'] #self.chaincolorobjdic,'dic-color'] ...
index = 0 starting_x = 20 starting_y = 100 button_dimension = 25 buttons = [False] *2*len(possible_orders) prices = [] for order in possible_orders: item_name_x = starting_x item_name_y = starting_y + index*50 lemon_price = round(pricing.get_lemon_discountedprice(timedelta(hours=order[1]), order[0]),2) prices...
from __future__ import division from libtbx.test_utils import Exception_expected from libtbx.utils import null_out, Sorry from libtbx import easy_run def exercise_main(): from mmtbx.refinement import select_best_starting_model from iotbx import file_reader from cctbx import uctbx from cctbx import sgtbx from sci...
None), TimeGroup(9, None), TimeGroup(10, None), TimeGroup(11, 21), TimeGroup(12, None), TimeGroup(13, 22), TimeGroup(14, None), TimeGroup(15, None), TimeGroup(16, None), TimeGroup(17, 23), TimeGroup(18, None), TimeGroup(19, None), TimeGroup(20, None), TimeGroup(21, None), TimeGroup(22, None), TimeGroup(2...
# Licensed under a 3-clause BSD style license - see LICENSE.rst import sys import warnings from math import sqrt, pi, exp, log, floor from abc import ABCMeta, abstractmethod import numpy as np from .. import constants as const from ..config import ConfigurationItem from ..utils.misc import isiterable from ..utils.exc...
<gh_stars>0 #!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License...
transpose(self): temp = [[0 for i in range(self.col)] for j in range(self.row)] for x in range(self.row): for y in range(self.col): temp[x][y] = self.val[y][x] self.val = temp def __repr__(self): ## DEBUG return f'matrix->{self.val}' def multiplyMatrix(m1, m2): m = Matrix(m1.row, m2.col) if...
<filename>pycatia/navigator_interfaces/group.py #! usr/bin/python3.6 """ Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445 .. warning:: The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only. They are there as a guide as to how the visua...
indices = set(patches.flat) if tuple(sorted(indices)) != tuple(range(len(indices))): raise ValueError('Patch vertices in `patches` should be numbered consecutively, starting at 0.') if len(patchverts) != len(indices): raise ValueError('Number of `patchverts` does not equal number of vertices specified in `patches`....
import math import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from sklearn.metrics import roc_auc_score from torchvision import datasets, transforms from tqdm import tqdm, trange # for CBB and MCBB DEVICE = torch.device("cuda" if torch.cuda.is_available...
are required to start with START codons, and if this # is not a START codon, then do not start a new ORF if from_start and start == None and not (codon in Alphabet.START): continue # if we are not currently in an ORF, initialize one if not start != None: start, length = i - 2, 0 # increment the length of the cur...
<filename>tests/asp/weakConstraints/6-still_live-7-1.asp.gringo.test.py<gh_stars>10-100 input = """ 1 2 0 0 1 3 0 0 1 4 0 0 1 5 0 0 1 6 0 0 1 7 0 0 1 8 0 0 1 9 0 0 1 10 0 0 1 11 0 0 1 12 0 0 1 13 0 0 1 14 0 0 1 15 0 0 1 16 0 0 1 17 0 0 1 18 0 0 1 19 0 0 1 20 0 0 2 21 3 0 3 22 23 24 1 25 1 0 21 1 1 1 0 25 2 26 3 0 3 23 ...
<reponame>OJHFire/Uni-text-game #importing all the other libraries and classes from ItemsClass import * from EnemiesClass import * from time import sleep from os import system from random import randint # defining some global variables health = 0 failed = False inventory = [] finished = False enemy_counter = 0 search_...
<reponame>sadielbartholomew/cf-python<filename>cf/abstract/constructlist.py import logging import cfdm from ..decorators import ( _deprecated_kwarg_check, _manage_log_level_via_verbosity, ) from ..functions import ( _DEPRECATION_ERROR, _DEPRECATION_ERROR_DICT, _DEPRECATION_ERROR_KWARGS, ) from ..mixin_container ...
<gh_stars>10-100 import os import sys import cocotb import logging from cocotb.result import TestFailure from cocotb.clock import Clock import time from array import array as Array from cocotb.triggers import Timer, FallingEdge from cocotb.drivers.amba import AXI4LiteMaster from cocotb.drivers.amba import AXI4StreamMa...
by pi/2 in the counterclockwise direction of the tangential vector #will result in an outward normal vector. #The last vertex,edge will be the first. This is in order to complete the loop. N = len(Element) OrientedEdges = [0]*(N+1) OrientedVertices = [0]*(N+1) for i in range(N): if Ori[i]==1: OrientedEdges[i]...
#!/usr/bin/env python3 import argparse import json import sys from subprocess import Popen, PIPE from odf.draw import Image, Frame from odf.opendocument import OpenDocumentSpreadsheet from odf.style import Style, TableColumnProperties, TableRowProperties, TextProperties from odf.table import Table, TableRow, TableCel...
lambda x, v: x.this.own(v), doc='The membership flag') __repr__ = _swig_repr def __init__(self, *args): _Extrema.Handle_Extrema_LCCacheOfLocateExtCC_swiginit(self,_Extrema.new_Handle_Extrema_LCCacheOfLocateExtCC(*args)) # register the handle in the base object if len(args) > 0: register_handle(self, args[0]) ...
of the year (esp. from 'year 1' onward), #we have to replace the positive numbers with 0 values (https://stackoverflow.com/questions/36310897/how-do-i-change-all-negative-numbers-to-zero-in-python/36310913) subs_matrix_CH4_S1_Tgr_60y = subs_matrix_CH4_S1_Tgr_60y.clip(max=0) print(subs_matrix_CH4_S1_Tgr_60y[:,:4])...
## # File: BMRBChemShiftStat.py # Date: 20-Sep-2019 # # Updates: # 26-Feb-2020 <NAME> - load csv resource files if pickle is not available # 04-Mar-2020 <NAME> - support lazy import of others (non-standard residues, DAOTHER-5498) # 16-Apr-2020 <NAME> - fix ambiguity code of atom name starts with 'Q' (e.g. LYZ:QZ) # 20-...
<reponame>dtrizna/speakeasy<gh_stars>100-1000 # Copyright (C) 2021 FireEye, Inc. All Rights Reserved. import os import sys import cmd import shlex import fnmatch import logging import binascii import argparse import traceback import hexdump import speakeasy import speakeasy.winenv.arch as e_arch from speakeasy.error...
<filename>web_version/languages/nl.py # -*- coding: utf-8 -*- { '!langcode!': 'nl', '!langname!': 'Nederlands', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete ...
signal_function = sim.convolve_hrf(stimfunction=stimfunction, tr_duration=tr_duration, ) # Convolve the HRF with the stimulus sequence signal = sim.apply_signal(signal_function=signal_function, volume_signal=volume, ) # Generate the mask of the signal mask, template = sim.mask_brain(signal, mask_self=None) ...
# -*- coding: utf-8 -*- from noval import _,GetApp from tkinter import ttk from tkinter import messagebox,filedialog import tkinter as tk import noval.ui_base as ui_base import noval.python.interpreter.interpretermanager as interpretermanager import os import subprocess import noval.outputthread as outputthrea...
position: Union[Unit, Point2], n: int) -> Units: """ Returns the n closest units in distance to position. Example:: enemy_zerglings = self.enemy_units(UnitTypeId.ZERGLING) my_marine = next((unit for unit in self.units if unit.type_id == UnitTypeId.MARINE), None) if my_marine: zerglings_filtered = enemy_zerglin...
''' Created on 09.06.2020 @author: JR ''' from pyenzyme.enzymeml.core.functionalities import TypeChecker from pyenzyme.enzymeml.models.kineticmodel import KineticModel from pyenzyme.enzymeml.core.replicate import Replicate import pandas as pd from copy import deepcopy class EnzymeReaction(object): de...
{ # "instrument_id":"btcusd", # "last":"9574.5", # "best_ask":"9575.0", # "best_bid":"9574.0", # "high_24h":"9672", # "low_24h":"9512", # "volume_24h":"567697050", # "timestamp":"1595538450096" # } # timestamp = self.safe_integer_2(ticker, 'timestamp', 'id') symbol = None marketId = self.safe_string_2(tick...
json=response_data, status=200, ) response_data = {"status": "ok", "user": TEST_USERNAME_INFO_ITEM} responses.add( responses.GET, "{api_url}users/{user_id}/info/".format( api_url=API_URL, user_id=TEST_PHOTO_ITEM["user"]["pk"] ), status=200, json=response_data, ) response_data = {"status": "ok", "user": TE...
<gh_stars>0 file_forgot_password = ["""<!DOCTYPE html> <html> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <style type="text/css"> ...
self.space(n) self.assertAllClose( group.is_tangent(gs.array(vec), base_point), gs.array(expected) ) def test_skew_to_vector_and_vector_to_skew(self, n, point_type, vec): group = self.space(n, point_type) mat = group.skew_matrix_from_vector(gs.array(vec)) result = group.vector_from_skew_matrix(mat) self.assert...
# -*- coding: utf-8 -*- #--------------------------------------------------------------------------- # Copyright 2020 VMware, Inc. All rights reserved. # AUTO GENERATED FILE -- DO NOT MODIFY! # # vAPI stub file for package com.vmware.nsx.pools. #-------------------------------------------------------------------------...
<reponame>rharish101/mnist-gan<gh_stars>1-10 """Class for training the GAN.""" from pathlib import Path from typing import Final, List, NamedTuple, Tuple import tensorflow as tf from tensorflow import Tensor, Variable from tensorflow.data import Dataset from tensorflow.distribute import ReduceOp, Strategy from tensorf...
splitting data into train/validation/test during cross-validation""" return self._crossval_index_sets @property def task_names(self) -> List[str]: """A list of names of the tasks being trained on.""" return self._task_names @task_names.setter def task_names(self, task_names: List[str]) -> None: self._task_nam...
str) else pars, start=par_no1 ): assert isinstance(text, str), \ "ERROR: text must be of 'str' type (line {})" \ .format(i) if text: pars_.append({'text': self.RE_LF2.sub( r'\g<1> \g<2>', self.RE_LF.sub(r'\g<1> ', text) ).replace('\n', '. ').replace('\r', '')}) par_no2 += 1 return (par_no1, par_no2) if par_...
# Autogenerated config.py # # NOTE: config.py is intended for advanced users who are comfortable # with manually migrating the config file on qutebrowser upgrades. If # you prefer, you can also configure qutebrowser using the # :set/:bind/:config-* commands without having to write a config.py # file. # # Documentation:...
= "" job_status = "unknown" as_json = True record = {} if as_json: record = json.loads(get_response.text) job_status = str(record["job"]["status"]).strip().lstrip().lower() # end of as_json if job_status == "requested": if last_status != job_status: lg("Job=" + str(job_id) + " is requested - Step: 0/10", 5...
<reponame>YosefLab/SingleCellLineageTracing """ This file contains several tools useful for using small-parsimony to analyze phylogenies. Amongst these tools are basic Fitch-Hartigan reconstruction, parsimony scoring, and the FitchCount algorithm described in Quinn, Jones et al, Science (2021). """ from typing import ...
from __future__ import division from warnings import warn import numpy as np from scipy.sparse import csr_matrix from pybasicbayes.util.general import objarray from pylds.lds_messages_interface import info_E_step, info_sample, kalman_info_filter, kalman_filter, E_step # TODO on instantiating, maybe gaussian states s...
actually significant, but it needs to be not None """ # Get a list of devices to use later device_list = self.libk.KLST_HANDLE() device_info = ctypes.pointer(self.libk.KLST_DEV_INFO()) ret = self.lib.LstK_Init(ctypes.byref(device_list), 0) if ret == 0: raise ctypes.WinError() # Get info for a device with tha...
from each_string(*strings) def flatten(*args: Strings) -> List[str]: """ Flatten an arbitrarily nested list of strings into a simple list for processing. """ return list(each_string(*args)) class AnnotatedStr(str): """ A wrapper containing optional annotations. """ #: Whether this was annotated by :py:func...
point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned marker value in the ``marker`` parameter and retrying the command. If the ``marker`` field is empty, all response records have been retrieved for ...
1.0/(1.0+np.exp(-a*x-2)) y2 = 1.0 + a/4*x rr = x < -2/a return rr*y1 + (1-rr)*y2 def bend(self, i_sec0: int, i_sec1: int, leader=None, kx=None, ky=None, kc=None, rot_x=False): ''' Bend surfaces by a guide curve, i.e., leader. >>> bend(i_sec0: int, i_sec1: int, leader=None, >>> kx=None, ky=None, kc=None, rot...
figure.name == Name.Pawn: if number_of_moved_squares == 2: if figure.color == Color.White and curr_position[0] != 2: return False if figure.color == Color.Black and curr_position[0] != 7: return False if move[1] != 0 and not self.is_en_passant(figure, target): if figure.color == Color.White and target not in pos...
<reponame>andypymont/adventofcode """ 2021 Day 24 https://adventofcode.com/2021/day/24 """ from collections import deque from typing import List, Set, Tuple import aocd # type: ignore # Finding the (mostly) repeated pattern in the input program: # 01 02 03 04 05 06 07 # inp w inp w inp w inp w inp w inp w inp w # mu...
#-*-coding:Utf-8-*- __author__ ="<NAME>" __version__ = "1.0.1" __license__ = "BSD" import json import re,os,string from utils import Logger,Atom from enum import Enum class SingletonTopo: """ """ OSE_LIST = {} #dictionnaire listant les oses et les substitutions avec comme cl� leur num�ro et l'objet OseModel co...
directory = os.path.join(self.model_root, 'results' + tag) try: os.makedirs(os.path.join(directory)) except OSError: pass results = {} picklename = os.path.join(directory,'binary_results.pkl') with open(picklename, 'rb') as pkl: while True: try: temp = pickle.load(pkl) key = temp[0] i = 0 while key in resu...
import abc import copy import datetime import json from enum import Enum from typing import Any, Dict, Optional, Set import qcelemental as qcel from pydantic import Field, validator from qcelemental.models.results import AtomicResultProtocols from ..outputstore import OutputStore from ..records.models import RecordSt...
expressions.OutputContextField( child_location.navigate_to_field('name'), GraphQLString), }), ] expected_location_types = { base_location: 'Animal', child_location: 'Animal', } check_test_data(self, test_data, expected_blocks, expected_location_types) def test_has_edge_degree_op_filter_with_optional(self): ...
self.main_tbShowWifi = QtWidgets.QTextBrowser(self.groupBox_16) font = QtGui.QFont() font.setPointSize(9) self.main_tbShowWifi.setFont(font) self.main_tbShowWifi.setObjectName("main_tbShowWifi") self.verticalLayout_58.addWidget(self.main_tbShowWifi) self.verticalLayout_11.addLayout(self.verticalLayout_58) self.g...
colour_panel = QW.QWidget( self._notebook ) colour_types = [] colour_types.append( CC.COLOUR_THUMB_BACKGROUND ) colour_types.append( CC.COLOUR_THUMB_BACKGROUND_SELECTED ) colour_types.append( CC.COLOUR_THUMB_BACKGROUND_REMOTE ) colour_types.append( CC.COLOUR_THUMB_BACKGROUND_REMOTE_SELECTED ) colour_types.app...
status or response.get("status") } if folder is not None: folder = f"/{folder}".replace("//", "/") self.create_folder(project_key=response["projectKey"], folder_type=TEST_CASE, folder_name=folder) request_data["folder"] = folder if folder != "/" else None # append labels and issue links to the current list or c...
# -*- python -*- #/****************************************************************************** # * Copyright (c) 2004, 2009 <NAME>. # * All rights reserved. This program and the accompanying materials # * are made available under the terms of the Eclipse Public License v1.0 # * which accompanies this distribution, a...
#! /usr/bin/env python from __future__ import division from __future__ import print_function from __future__ import absolute_import from builtins import range from past.utils import old_div import argparse from LLC_Membranes.analysis import Atom_props, Diffusivity, Poly_fit from LLC_Membranes.llclib import physical i...
self.all_keys += [(self.this_trial['autoresp'], self.this_trial['autort'])] self.post_trial() # correct timing if autorun if self.rp['autorun'] > 0: try: self.this_trial['autort'] *= self.rp['autorun'] self.this_trial['rt'] *= self.rp['autorun'] except: # maybe not all keys are present pass self.this_trial['...
<gh_stars>0 #****************************************************************************************************** # Name: River shade adjustment tool - part 1 # Created: 1/25/2021 # Updated: 2/26/2021 # Author: <NAME> # # Summary: This is the current-conditions shade adjustment tool referenced in the MS thes...
an interface """ __slots__ = ('_path_helper', '_extmethods', '__enable_interface_id','__enable_remote_id','__interface_id','__remote_id','__sent_interface_id','__sent_remote_id',) _yang_name = 'state' _yang_namespace = 'http://openconfig.net/yang/relay-agent' _pybind_generated_by = 'container' def __init__(sel...
import collections import datetime import json import os import random import re import globals from crawlers.bestdori import CardTable, EventTable, GachaTable from nonebot.adapters.cqhttp import Message, MessageSegment from utils import ImageProcesser from utils.Asset import ImageAsset class Card: def __init__(se...
<filename>sdk/formrecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/_models.py<gh_stars>1-10 # coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ # pylint: disable=protected-access, too-many-lines ...
False if self.configuration.getint( "main", "new_window_on_follow_wiki_url") != 1: # Same window self.openWiki(filePath, wikiWordsToOpen=(wikiWordToOpen,), anchorToOpen=anchorToOpen) # ? return True else: # New window try: clAction = CmdLineAction([]) clAction.inheritFrom(self.getCmdLineAction()...
import os import pandas as pd import gavia.time as gavtime from gavia.version import __version__ import sys def getlogs(dir,logtype): ''' get list of logs for camera ''' files = [] loglist = os.listdir(dir) for log in loglist: if logtype in log: files.append(log) # for gps, remove gpsfix ...
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # Redistribution and use in source and binary forms, with or without # # modification, are permitted provided that the following co...
self.args.output_dir self._move_model_to_device() if "train_document" in self.extra_args and self.extra_args["train_document"] == True: train_dataset = DocumentDataset( self.tokenizer, self.args, train_file, self.args.block_size, 2, sliding_window=self.args.sliding_window) eval_dataset = DocumentDataset( ...
pass def glColorMaterial(*argv): '''no string ''' pass def glCompileShader(*argv): '''no string ''' pass def glCopyPixels(*argv): '''no string ''' pass def glCopyTexImage2D(*argv): '''no string ''' pass def glCreateProgram(*argv): '''no string ''' pa...
<filename>tests/cupyx_tests/scipy_tests/ndimage_tests/test_interpolation.py<gh_stars>1000+ import numpy import pytest import cupy from cupy.cuda import runtime from cupy import testing import cupyx.scipy.ndimage from cupyx.scipy.ndimage import _util try: import scipy import scipy.ndimage scipy_version = numpy.lib....
failures for fail in case.config[c].get(ck.PARTIAL_FAIL, {}).keys(): if f"{c}_failures_by_type_{fail}" not in summary_data: summary_data[f"{c}_failures_by_type_{fail}"] = [None] summary_data[f"{c}_failures_by_type_{fail}"] += [comp.comps[c][f"failure_by_type_{fail}"].sum()] # if the component had no failures, set...
""" Pathfinding Visualizer Made by <NAME> """ import pygame from tkinter import messagebox, Tk from queue import PriorityQueue import os from Colours import Colours from Grid import Grid import pygame_menu import time from playsound import playsound os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (350, 50)...
<filename>src/follower.py #!/usr/bin/env python import rospy from sensor_msgs.msg import Image from sensor_msgs.msg import Joy from kobuki_msgs.msg import Led, Sound from geometry_msgs.msg import Twist import cv2, cv_bridge, numpy import smach import smach_ros global stop, donot_check_time, image_pub, err, cmd_vel_pu...
#------------------------------------------------------------------------------ # Copyright (c) 2013, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------------------------------...
self.etree.PI root = Element('root') pi = PI('TARGET', 'TEXT') pi.tail = "TAIL" self.assertEqual(_bytes('<root></root>'), self._writeElement(root)) root.addnext(pi) self.assertEqual(_bytes('<root></root>\n<?TARGET TEXT?>'), self._writeElement(root)) def test_addnext_comment(self): Element = self.etree.Eleme...
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------...
prob.run_model() of = ['con1', 'con2'] wrt = ['x', 'z'] # Make sure we don't get a size mismatch. derivs = prob.compute_totals(of=of, wrt=wrt) def test_assembled_jac_bad_key(self): # this test fails if AssembledJacobian._update sets in_start with 'output' instead of 'input' prob = Problem() prob.model = Grou...
""" update = True create = True def request(self, path, data, **kwargs): return self.client.put(path, data, format='json', **kwargs) @ddt.ddt class MultiprogramEnrollmentsTest(EnrollmentsDataMixin, APITestCase): """ Tests for the Multiple Program with same course scenario """ @classmethod def setUpClass(cls):...
<reponame>BenikaH/sportscraper<filename>sportscraper/scripts/db_connector.py<gh_stars>0 from sqlalchemy import * import click def upload_block(data, db_engine, db_tablename): data.to_sql(db_tablename, con=db_engine, if_exists='append', index=False, chunksize=10000) def initdb_statcast(db_username, db_password, db_...
# -*- coding: utf-8 -*- # python-holidays # --------------- # A fast, efficient Python library for generating country, province and state # specific sets of holidays on the fly. It aims to make determining whether a # specific date is a holiday as fast and flexible as possible. # # Authors: dr-prodigy <<EMAIL>> (c) 20...
<filename>dask_geomodeling/tests/test_geometry.py import os import unittest from datetime import datetime as Datetime from datetime import timedelta as Timedelta from numpy.testing import assert_almost_equal from osgeo import ogr from pandas.util.testing import assert_series_equal from shapely.geometry import box, Poi...
===== datasets : pandas.DataFrame or dict Dataset(s) with spectrum data. If more than one set, datasets should be a dictionary with entries <dataset_name>: dataset fields : str, list, 'all' (or None) Fieldname(s) corresponding to particular column(s) of the datasets. fields can be None if input are Series. 'al...