input
stringlengths
2.65k
237k
output
stringclasses
1 value
0: title = title + self.telescope_entry.get()+", " if len(self.accessory_entry.get()) > 0: title = title + self.accessory_entry.get()+", " if len(self.ccd_entry.get()) > 0: title = title + self.ccd_entry.get() ax.set_title(title) ax.title.set_fontsize('x-large') ax.errorbar(light_curve["JulianDate"]-2400000.5, ...
'../sql/sql.gyp:test_support_sql', '../sync/sync.gyp:sync', '../sync/sync.gyp:test_support_sync_api', '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', '../third_party/cld_2/cld_2.gyp:cld2_static', '../third_party/icu/icu.gyp:icui18n', '../third_party/leveldatabase/leveldatabase.gyp:leveldatabase', '....
E501 collection_formats = {} path_params = {} query_params = [] if 'execution_id' in params: query_params.append(('executionId', params['execution_id'])) # noqa: E501 if 'requisite_stage_ref_ids' in params: query_params.append(('requisiteStageRefIds', params['requisite_stage_ref_ids'])) # noqa: E501 if 'spel...
storm objects. """ if min_size_pixels == 0: return local_max_dict num_grid_cells_by_polygon = numpy.array( [len(r) for r in local_max_dict[temporal_tracking.GRID_POINT_ROWS_KEY]], dtype=int ) indices_to_keep = numpy.where( num_grid_cells_by_polygon >= min_size_pixels )[0] for this_key in local_max_dict: ...
tile (i.e. tile_index==0) should be centered offset_from_center_for_tile_index_0 = -(tile_width//2) self.__tiles_x = [ cols//2 + offset_from_center_for_tile_index_0 + (tile_width+tiles_gap_x) * tile_index for tile_index in range(-(self.__game_core.WORD_LENGTH//2), math.ceil(self.__game_core.WORD_LENGTH/2))] bre...
data only :param bool _preload_content: load received data in models :param bool _request_timeout: maximum wait time for response :return: Attachments """ # verify the required parameter 'xero_tenant_id' is set if xero_tenant_id is None: raise ValueError( "Missing the required parameter `xero_tenant_id` " "wh...
transform. If passed in this function will return both the data and the corresponding labels for the rows that have been selected. Default is None. sample_weight : list or numpy.ndarray or None, shape=(n,), optional The sample weights to transform. If passed in this function will return the selected lab...
"help": await ctx.send("Gives an overview of your character's current special actions. \n \tUsage: `!actionoverview [character name]`") return #get all special actions associated with this character self.cursor.execute("""SELECT * FROM special_actions WHERE name = :chrnm AND member = :member""", { 'chrnm': chrnm,...
""" 我上一次分享在群里发了ana.py和train_50.csv ana.py这个程序是用来生成最初的50个特征的train_50.csv训练集文件, 写得非常乱,我自己都看不下去了,这哪个zz写的? train_50.csv用lightgbm做22分类的log_loss是2.801 我想把这个log_loss降低,所以要做一些新的特征,再合并到train_50.csv里面来 做新特征的程序文件是step2.py""" import pandas as pd import numpy as np import itertools import pprint start_close = pd.re...
Liaoning', 'zh': u('\u8fbd\u5b81\u7701\u6c88\u9633\u5e02')}, '86138676':{'en': 'Taizhou, Zhejiang', 'zh': u('\u6d59\u6c5f\u7701\u53f0\u5dde\u5e02')}, '86138679':{'en': 'Jinhua, Zhejiang', 'zh': u('\u6d59\u6c5f\u7701\u91d1\u534e\u5e02')}, '86138678':{'en': 'Ningbo, Zhejiang', 'zh': u('\u6d59\u6c5f\u7701\u5b81\u6ce2\u...
#!/usr/bin/env python """ sire: create a new python3.7 project using all the extra stuff i like. """ import argparse import getpass import os import re import shutil import stat import subprocess import sys from typing import Any, Mapping import requests from .string_matches import BADLINES GIT_URLS = dict( github...
<filename>bibliotheque.py #!/usr/bin/python3 """ Exemples de structures issues de Wikipedia Titre : Le jeu de la Vie Auteur : <NAME> Création : 29/04/2020 Version : 1.1 (16/05/2020) Version 1.1 : - PRESENTATION : Amélioration conformité PEP8 """ bibliotheque = \ { "Vaisseau : Planeur" : \ [ [0, 1, 0], [0, 0, 1], ...
# None of this is django-specific. Don't import from django. import os import sys import contextlib import subprocess import getpass import logging from os.path import commonprefix # try both the python 2 and 3 import to avoid six dependency or django import try: from urllib import quote except ImportError: from u...
<filename>inventarios/business.py # coding: utf-8 from .models import MovimientoCabecera from .models import MovimientoDetalle from .models import Stock # from trabajos.models import OrdenTrabajo from trabajos.models import Material class EntradaAlmacenBusiness(object): def __init__(self): self.tipo = "ENT" def...
# schema support is there success_response = responses['200'] # Check that the API renderers aren't included, but custom renderers are assert set(success_response['content']) == {'application/json', 'text/plain'} def test_openapi_yaml_rendering_without_aliases(self): renderer = OpenAPIRenderer() reused_object ...
<gh_stars>0 # -*- coding: utf-8 -*- # Copyright (c) 2020, Frappe and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document import json class PchManufacturingRecord(Document): pass @frappe.whitelist() def get_...
resume(self, inter: disnake.ApplicationCommandInteraction): player: Union[LavalinkPlayer, YTDLPlayer] = inter.player embed = disnake.Embed(color=disnake.Colour.red()) if not player.paused: embed.description = "A música não está pausada." await send_message(inter, embed=embed) return await player.set_pause(Fa...
m = M() g = globals() self.assertEqual(eval('a', g, m), 12) self.assertRaises(NameError, eval, 'b', g, m) self.assertEqual(eval('dir()', g, m), list('xyz')) self.assertEqual(eval('globals()', g, m), g) self.assertEqual(eval('locals()', g, m), m) self.assertRaises(TypeError, eval, 'a', m) class A: "Non-mapping"...
<gh_stars>10-100 # -*- coding: utf-8 -*- import numpy as np import pyny3d.geoms as pyny class ShadowsManager(object): """ Class in charge of the management for the shadows simulations. It can be initialize as standalone object or associated to a ``pyny.Space`` through the ``.shadow`` method. The o...
we want to convert path_to_pet = os.path.join(path_to_pet_3, image_ID[y]) # sub_ID.append(i) ses_ID.append(session_ID) path_pet.append(path_to_pet) data = pandas.DataFrame({'Subjects_ID': sub_ID, 'Session_ID': ses_ID, 'Path_to_pet': path_pet}) # data=final dataframe return data def find_path_to_T1_ADNI(fil...
<filename>fst2/processers.py import copy import os import csv import json import torch import logging from transformers.file_utils import is_tf_available, is_torch_available from functools import wraps from .utils import CACHE_PARAMS logger = logging.getLogger(__name__) class InputExample(object): """ A single tr...
random columns belonging to samples we misclassify # # Pred=0, Actual=1 # badguy = { # 'TransactionAmt': 175.132982, # 'C1': 26.855532, # 'C2': 31.275574, # 'D1': 30.312290, # 'D2': 91.129977, # 'V100': 0.107696, # 'V310': 36.764886, # } # for key,val in badguy.items(): # data['BGuy_'+key] = data[key] - val # Interac...
= comment self.is_string = is_string frame = tk.Frame(self.root) var = tk.Label(frame, text=variable ,width=20,background='light gray') var.config(relief=tk.GROOVE) var.grid(column=0, row=0, padx=5, sticky='WE') val = tk.Entry(frame,textvariable=self.v_value) val.grid(column=1, row=0, sticky='E') CreateT...
_string) # /STACK _Same(_link, 'TypeLibraryFile', _file_name) # /TLBOUT _Same(_link, 'TypeLibraryResourceID', _integer) # /TLBID _Same(_link, 'Version', _string) # /VERSION _Same(_link, 'AssemblyDebug', _Enumeration(['', 'true', # /ASSEMBLYDEBUG 'false'])) # /ASSEMBLYDEBUG:DISABLE _Same(_link, 'CLRImageType',...
calling this method. """ callback_value = run_callback(USER_CB, "user_current_voucher_level", ctx=self.ctx, user=self) if callback_value != self.current_voucher_level: self.current_voucher_level = callback_value with db.conn(self.ctx) as ctx: self.send_chips(ctx, self) def modify_struct(self, struct, is_full_st...
<gh_stars>0 #!/usr/bin/env python # -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals from __future__ import division from __future__ import print_function from typing import Optional, Iterable, Tuple, Set, Type, List, Dict, Callable, Union from collections import defa...
<reponame>elcarrion06/mcedit2<filename>src/mceditlib/multi_block.py<gh_stars>100-1000 import numpy from mceditlib import relight from mceditlib.blocktypes import BlockType from mceditlib.fakechunklevel import GetBlocksResult import logging log = logging.getLogger(__name__) def chunkPosArray(x, z): """ Construct a...
<filename>experiment.py import json import numpy as np class RealVectorDPMechanism: def execute(self, query_output: np.ndarray, epsilon: float) -> np.ndarray: raise NotImplementedError() @staticmethod def infer_sensitivity_from_data(input_data_points: np.ndarray) -> float: """ We will compute sensitivity fro...
= '\n [\n' + '\n'.join(aList) + '\n ]' # The following doesn't work well. # val = g.objToString(aList, indent=' '*4) else: val = '<%s non-comment lines>' % len(aList) elif isinstance(val, str) and val.startswith('<?xml'): val = '<xml>' key2 = '@%-6s %s' % (gs.kind, key) yield key2, val, c, letter #@+node:ekr.2...
x_, ), cons59, cons60, cons61, cons62, cons4, cons5, cons57, cons149, ) rule753 = ReplacementRule(pattern753, replacement753) pattern754 = Pattern( Integral( (x_ * WC("c", S(1))) ** WC("m", S(1)) * (a1_ + x_ ** n_ * WC("b1", S(1))) ** p_ * (a2_ + x_ ** n_ * WC("b2", S(1))) ** p_, x_, ), cons59, con...
<filename>src/blc.py #!/usr/bin/env python3 """ A BLC parser/interpreter in python :created: 2019-12-14 12:35:36 -0800 :copyright: (c) 2019, <NAME> :license: MIT """ import sys import os import argparse import tqdm import numpy as np import anytree import numpy from matplotlib import pyplot as plt import multiproc...
This is defined as 0xffff, the largest number e_phnum can have, specifying where the actual number of program headers is assigned. uint16_t e_shentsize; This member holds a sections header's size in bytes. A section header is one entry in the section header table; all entries are the same size. uint16_t e_s...
0x19, 0xf6, 0x4a, 0x92, 0x55, 0xf8, 0x4a, 0x91, 0x43, 0xb2, 0x4a, 0x79, 0x24, 0xf8, 0x42, 0x92, 0x47, 0x82, 0xa9, 0xf9, 0x24, 0x48, 0x8f, 0x44, 0xf9, 0x24, 0x4a, 0x46, 0x0b, 0x2c, 0xd4, 0xc1, 0x56, 0x28, 0x19, 0x36, 0x48, 0x15, 0x34, 0x4a, 0x4c, 0x32, 0x4a, 0x1d, 0x24, 0xaf, 0x44, 0x18, 0xf1, 0x48, 0xa4, 0x41, 0...
# -*- coding: utf-8 -*- # Copyright (c) 2012-2020, <NAME> # # This module is part of anima and is released under the MIT # License: http://www.opensource.org/licenses/MIT import re from anima import logger from anima.ui.base import AnimaDialogBase, ui_caller from anima.ui.lib import QtCore, QtWidgets def UI(app_in=N...
# # This source file is part of appleseed. # Visit https://appleseedhq.net/ for additional information and resources. # # This software is released under the MIT license. # # Copyright (c) 2016-2019 <NAME>, The appleseedhq Organization # # Permission is hereby granted, free of charge, to any person obtaining a copy # ...
{k: val for k, val in self.hyperparams.items() if k in self.hyperparam_keys - self.nn_specific_keys - self.rf_specific_keys} subcombo['model_type'] = [model_type] subcombo['featurizer'] = [featurizer] self.param_combos.extend(self.generate_combos(subcombo)) def generate_combos(self, params_dict): """ Calls sub-...
import random import time from datetime import date from colorama import * import math def pasirinkimas(): print('|------------------------------------------|') print(Fore.RED + '\t|- Ką nori mokytis? ' + Fore.LIGHTBLUE_EX + '(pasirink raidę)' + Fore.RED + ' -|') koks_veiksmas = input(Fore.GREEN + '\tDaugybą (' + ...
2, 3], 'b': [4, 5, 6] }) transformed_data1 = pd.DataFrame({ 'a.out1': ['1', '2', '3'], 'b': [4, 5, 6] }) transformer1 = Mock() transformer2 = Mock() transformer1.get_output_types.return_value = { 'a.out1': 'categorical' } transformer1.get_next_transformers.return_value = None transformer1.transform.return_...
ts_sorted.index[0], ts_sorted.index[0], 0, ts_sorted.iloc[0] params = {'t0': t0, 't1': t1, 'integral': 0, 'threshold': thresh} while i < len(ts_sorted) and integral <= capacity and (ts_sorted.iloc[0] - ts_sorted.iloc[i]) < rate_limit: params = {'t0': pd.Timestamp(t0), 't1': pd.Timestamp(t1), 'threshold': thresh, 'in...
import os import json import time import logging import functools from typing import List, Any, Optional, Callable, Union, Tuple, Dict from web3 import Web3 from web3.eth import Contract from web3.contract import ContractFunction from web3.types import ( TxParams, Wei, Address, ChecksumAddress, ENS, Nonce, HexB...
<filename>InitProb.py from __future__ import division from copy import deepcopy import random as r import math as m import numpy as np import matplotlib.pyplot as plt import copy import sys ######################################## # General ######################################## class PolyNodeData: def __init__(...
<reponame>ihmpdcc/hmp-qc-humann2 #!/usr/bin/env python3 ''' Description: This script is used to execute the HUMAnN2 docker pipeline Author: <NAME> Input: - An SRR ID or a set of fastq files - Mode: run qc only, humann2 only, both (qc & humann), or metaphlan only - S3_path if - AWS credentials Output: - Statisti...
<reponame>dstansby/EISpy # -*- coding: utf-8 -*- # Author: <NAME> <<EMAIL>> # pylint: disable=E1101, C0330 """ Utilities used in EIS calculations, corrections and fits. """ import os import datetime as dt import warnings import urllib import pathlib from scipy.io import readsav from scipy.interpolate import interp1d i...
/ (len(importances) * min_ch_rate * bandwidth + bandwidth**2) lambd = BisectionSearchMonotoneDecr(PolicyValueLagr_NoObs, (importances, ch_rates, bandwidth), lambda_lb, lambda_ub, epsilon) crawl_rates = np.zeros_like(importances, dtype=float) for i in range(len(crawl_rates)): crawl_rates[i] = (-ch_rates[i] + math.s...
<filename>featured_code/blockudoku code/main.py<gh_stars>0 import numpy as np from tkinter import Tk, Canvas, messagebox, Label, Button import random from time import sleep import subprocess root = Tk() width = 470 height = 700 offset1 = int(-width / 2 + root.winfo_screenwidth() / 2) offset2 = int(-height / ...
#!/usr/bin/python #Author: <NAME> # CREATE DATE: 2014 # DESCRIPTION: extracts text from sqlite3 database tables and creates html or text outputs. Creates all output pages. import sys,os from optparse import OptionParser import sqlite3 as lite parser = OptionParser() parser.add_option('-i', '--output_dir', dest='output_...
#!/usr/bin/python # -*- coding: utf-8 -*- #add the path of the twitter egg import sys egg_path = '/home/users/web/........./cgi-bin/PyPkg/twitter-1.14.3-py2.7.egg' sys.path.append(egg_path) # Import the CGI, string, sys, and md5crypt modules import json, urllib2, re, time, datetime, sys, cgi, os import sq...
# Copyright (c) 2015-2019 The Switch Authors. All rights reserved. # Licensed under the Apache License, Version 2.0, which is in the LICENSE file. """ Defines load zone parameters for the Switch model. INPUT FILE INFORMATION Import load zone data. The following tab-separated files are expected in the input director...
update_fid_err_log(self, fid_err): """add an entry to the fid_err log""" self.fid_err_log.append(fid_err) if self.write_to_file: if len(self.fid_err_log) == 1: mode = 'w' else: mode = 'a' f = open(self.fid_err_file, mode) f.write("{}\n".format(fid_err)) f.close() @property def grad_norm_file(self): if sel...
self.returnAST) while True: if (self.LA(1)==NEWLINE): pass self.match(NEWLINE) else: break else: break _cnt135 += 1 if _cnt135 < 1: raise antlr.NoViableAltException(self.LT(1), self.getFilename()) else: raise antlr.NoViableAltException(self.LT(1), self.getFilename()) self.suiteEnd() self.addASTChil...
***************************************************** rcof=rt.get('run_correctness_output_files',[]) if len(rcof)==0: rcof=meta.get('run_correctness_output_files',[]) rcvars=rt.get('run_correctness_vars',[]) if ccc['run_success_bool'] and len(rcof)>0 and i.get('skip_output_validation','')!='yes' and not b_min_ru...
= df.read_metadata() self.assertEqual(md['X-Timestamp'], normalize_timestamp(42)) def test_get_metadata_not_opened(self): df = self.df_mgr.get_diskfile('sda1', '0', 'a', 'c', 'o') self.assertRaises(DiskFileNotOpen, df.get_metadata) def test_not_opened(self): df = self.df_mgr.get_diskfile('sda1', '0', 'a', 'c', ...
<gh_stars>1-10 #!/usr/bin/python """ Data structure: Each task/step/ticket is an Item instance. Each item may have one parent and several children nodes. """ import os import sys import time import re import sqlite3 from datetime import datetime DATE_FORMAT = '%a %b %d %H:%M:%S %Y %Z' __version__ = '0.3.0' __aut...
def __init__(self, request_id=None, success=None): self.request_id = request_id self.success = success def validate(self): self.validate_required(self.request_id, 'request_id') self.validate_required(self.success, 'success') def to_map(self): result = {} result['RequestId'] = self.request_id result['Success'...
# "order_id": null, # "trade_id": null, # "transfer_detail": { # "method": "bitcoin", # "id": "0e3e2357e806b6cdb1f70b54c3a3a17b6714ee1f0e68bebb44a74b1efd512098", # "recipient": "mzb3NgX9Dr6jgGAu31L6jsPGB2zkaFxxyf", # "confirmations": 3 # } # } # # trade fee # # { # "id": 21311221, # "date": "2015-06-30T13...
MOL 2 7.552 8.102 1.726 1.00 0.00 H1- \n', 'ATOM 194 H5 MOL 2 8.043 6.609 1.731 1.00 0.00 H1- \n', 'ATOM 195 H6 MOL 2 6.934 7.090 3.760 1.00 0.00 H1- \n', 'ATOM 196 H7 MOL 2 5.637 7.485 2.966 1.00 0.00 H1- \n', 'ATOM 197 N1 MOL 2 19.715 19.504 24.110 1.00 0.00 N3- \n', 'ATOM 198 C1 MOL 2 21.333 19.931 21.779 1.00 ...
from ophyd import ( Component as Cpt, ADComponent, Signal, EpicsSignal, EpicsSignalRO, EpicsSignalWithRBV, ROIPlugin, StatsPlugin, ImagePlugin, SingleTrigger, PilatusDetector, Device) from ophyd.areadetector.filestore_mixins import FileStoreBase,FileStoreHDF5,FileStoreIterativeWrite from ophyd.areadetector.plugins ...
with contents to be displayed, defaults to empty DataFrame Notes ----- The reference of the original input-DataFrame is lost when edited by this Model, you need to retrieve it directly from the model after editing """ def __init__(self, data=None, **kwargs): super().__init__(data, **kwargs) def setData(self,...
f1(*(), **{}) {def} f2(one_argument): {pass} {def} f3(two, arguments): {pass} self.assertEqual(f2.__code__.co_varnames, ('one_argument',)) self.assertEqual(f3.__code__.co_varnames, ('two', 'arguments')) {def} a1(one_arg,): {pass} {def} a2(two, args,): {pass} {def} v0(*rest): {pass} {def} v1(a, *rest): {pass} {...
# -*- coding: utf-8 -*- """ Created on Wed May 25 04:20:00 CEST 2016 @authors: <NAME> @email: juancarlos.entizne01[at]estudiant.upf.edu Modified by <NAME> @email: juanluis.trincado[at].upf.edu """ import os import sys import math import logging import warnings import numpy as np import pandas as pd from functools i...
Principly FFT(Kronecker deltas) == H.\n so\n H = r * exp(2ikz_n) \n and\n FFT(H) = convolve( r , exp(2ikz_n)).\n \\\n According to Izatt, Choma p52\n r = sum( r * kd(z_S - z_Sn)) where kd(...) is the \delta for Kronecker delta.\n E_s = E_i * convolve(r , exp(2*i*k*z_Sn))\n then\n E_s = E_i * H ''' rs_kd,z_r...
#!/usr/bin/env python # -*- coding: utf-8 -*- import numpy as np from .constants import constant_atomlabel, constant_aminoacid_code, constant_aminoacid_code_reverse from .utils import sort_dict_by_key from difflib import ndiff ''' The program extracts atomic information from a truncated pdb file that is exported fro...
import numpy as np import pytest from hypothesis import given, settings, assume, example from hypothesis import strategies as st from hypothesis import HealthCheck from hypothesis.extra.numpy import arrays from ..histogram import histogram1d, histogram2d, histogramdd # NOTE: for now we don't test the full range of ...
# -*- coding: utf-8 -*- """ hdu_api.models -------------- This module contains the primary object that power hdu_api. """ from __future__ import unicode_literals import re import time from bs4 import BeautifulSoup from hdu_api.config import CARD_URLS, EXAM_URLS, HOME_URLS, COURSE_URLS, PERSON_URLS, PUBLIC_URLS fr...
__authors__ = "" __copyright__ = "(c) 2014, pymal" __license__ = "BSD License" __contact__ = "Name Of Current Guardian of this file <email@address>" from urllib import request import time import singleton_factory from pymal import consts from pymal import decorators from pymal import exceptions __all__ = ['MyAnime'...
from amuse.couple import bridge from amuse.community.bhtree.interface import BHTree from amuse.community.hermite0.interface import Hermite from amuse.community.fi.interface import Fi from amuse.community.octgrav.interface import Octgrav from amuse.community.gadget2.interface import Gadget2 from amuse.community.phiGRAP...
# coding: utf-8 """ PassHub API PassHub API documentation # noqa: E501 OpenAPI spec version: 1.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from sightseeingtech_passhub_api.models.rule import Rule # noqa: F401,E501 from sightseeingte...
where processed glyphs are saved in a layer, and processing of a glyph is skip[ped if has already been processed. """ error_doc = """ The following is list of the checkOutlines error messages, and a brief explanation of each. The error messages here may be just the first part of the actual message, with additional in...
# # Autogenerated by Thrift Compiler (0.9.2) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol try...
# standard lib imports import zipfile import os import shutil import re from xml.etree import cElementTree as ET # local lib imports from .database import index2address def xml_namespace(file): """ Takes an xml file and returns the root namespace as a dict :param str file: xml file path :return dict: dictionary...
noqa: E501 response_type = 'LabelResource' if 'response_type' in kwargs: response_type = kwargs['response_type'] return self.api_client.call_api( '/datacenters/{datacenterId}/labels', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, respon...
# encoding: UTF-8 ''' vn.xspeed的gateway接入 ''' import os import json import time from copy import copy from vnxspeedmd import MdApi from vnxspeedtd import TdApi from xspeedDataType import * from vtGateway import * # 以下为一些VT类型和XSPEED类型的映射字典 # 价格类型映射 priceTypeMap = {} priceTypeMap[PRICETYPE_LIMITPRICE] = defineDict["D...
+ 2): sqarg = bd.array(eps_array[il] * bd.square(oms) - bd.square(gk), dtype=bd.complex) chi = bd.where(bd.real(sqarg) >= 0, bd.sqrt(sqarg), 1j * bd.sqrt(-sqarg)) chis.append(chi) return bd.array(chis, dtype=bd.complex) def _get_rad(self, gkr, omr, pol, clad): """ Get all the radiative mode parameters over 'g...
win = gaussian(win_length, std=(float(win_length) * stdev)) b = win / win.sum() if np.nansum(win) == 0: raise RuntimeError('window to short for time interval') print('win_length', str(win_length)) print('stddev', str(stdev)) print('win', str(win)) filtered = filtfilt(b, a, xr_in.data, axis=timedim, padtype=None...
import math import numpy as np from ._helpers import _check_value_any, broadcast_and_tile, raise_dimension_error from .shape import check, check_value_any __all__ = [ "normalize", "perpendicular", "project", "scalar_projection", "reject", "reject_axis", "magnitude", "euclidean_distance", "angle", "signed_ang...
self.rescale_plot(fig, ax) return fig, ax def plot_surface(self, fig, ax, color='blue', alpha=0.30, colorbar=False, Nu=50, Nv=50): # Get the surface coordinates u = np.linspace(0.00, 1.00, Nu) v = np.linspace(0.00, 1.00, Nv) [uu, vv] = np.meshgrid(u, v, indexing='ij') u = uu.flatten() v = vv.flatten() if ...
_cfg_dir = os.path.dirname(_cfg) _cfg_name = os.path.basename(_cfg) _cfg_cache_dir = os.path.join(_cfg_dir, '.cache') os.makedirs(_cfg_cache_dir, exist_ok=True) cfg_cache_path = os.path.join(_cfg_cache_dir, _cfg_name + '.cache') if enable_cache and os.path.exists(cfg_cache_path): cfg_cache_mtime = os.path.getm...
line = lines[-1].strip() for field in line.split("."): if field in ("IB1","IG","TRIBL","IB2","TRIBL2"): opts += "-a " + field elif field in ("M","C","D","DC","L","J","N","I","O"): opts += " -m " + field elif field in ("nw","gr","ig","x2","sv"): opts += " -w " + field elif field in ("Z","IL") or field[0:3] == "E...
import argparse import json import logging import subprocess import yaml import re import collections import os import time import requests import urllib from distutils.spawn import find_executable import teuthology from . import misc from . import provision from .config import config from .lockstatus import get_statu...
"jolt", "reforms", "gucci", "overcoat", "bishops", "conscientious", "venetian", "evey", "calder", "logistics", "ahmet", "dieter", "rampant", "were-", "waverly", "whitehall", "hock", "chrome", "sandman", "balancing", "canals", "oxen", "superhuman", "ein", "rogues", "'don", "dossier", "pikachu"...
idxs, dnums, slice_sizes: lax.gather(op, idxs, dimension_numbers=dnums, slice_sizes=slice_sizes), [RandArg(shape, np.float32), idxs, StaticArg(dnums), StaticArg(slice_sizes)]) for shape, idxs, dnums, slice_sizes in [ ((5,), np.array([[0], [2]]), lax.GatherDimensionNumbers( offset_dims=(), collapsed_slice_dims=(0,)...
in range(len(path[:-1])): print_lines.append(f"{spaces}at state {path[i]}:") print_lines.append(f"{spaces} - navigate to '{elements[i]}'") print_lines.append( f"{spaces} - fire any one of these actions below to get to state {path[i + 1]}:") for action in actions[i]: print_lines.append(f"{spaces} - '{action}'") ...
<filename>dh.py # dh.py # # digital history module from Turkel & MacEachern, # The Programming Historian (2007-08) # # contents: # # stopwords LIST # normalizeFrenchAccents(STRING) -> STRING # stripTags(HTML_STRING) -> TEXT_STRING # stripNonAlphaNum(TEXT_STRING) -> ALPHANUMERIC_STRING # webPageToText(URL_STR...
regular key tag. This method never returns None. ''' updated_tagstring_s = None # our return value # 1. clean up whitespace and None in our tagstring parameter tagstring_s = ', '.join(tags_sl).strip() if tags_sl else '' key_tag_s = db.create_key_tag_s(issue_key) \ if issue_key != None else Co...
for ((a, b), i), cs in both.transitions.items() if i == Move.EMPTY and both.end in cs} transitions[(Start(), Move.EMPTY)] = {Middle(s) for s in midpoints} nfa = NFA(Start(), Middle(nfa1.end), transitions, captures) nfa.remove_redundant_states() return nfa def MatchSubtractInside(nfa1: NFA, nfa2: NFA, proper: bool...
# -*- coding: utf-8 -*- ''' ------------------------------------------------------------------------------------------------- This code accompanies the paper titled "Human injury-based safety decision of automated vehicles" Author: <NAME>, <NAME>, <NAME>, <NAME> Corresponding author: <NAME> (<EMAIL>) ------------------...
"""Utils to check the samplers and compatibility with scikit-learn """ # Adapted from imbalanced-learn # Adapated from scikit-learn # Authors: <NAME> <<EMAIL>> # License: MIT import sys import traceback import warnings from collections import Counter from functools import partial import pytest import numpy as np f...
<reponame>ttlg59/Stino #!/usr/bin/env python # -*- coding: utf-8 -*- """Package Docs.""" from __future__ import absolute_import from __future__ import print_function from __future__ import division from __future__ import unicode_literals import os import glob import codecs from base_utils import file from base_utils...
from decimal import Decimal import json from apps.fund.models import DonationStatuses, Donation from apps.projects.models import ProjectPlan, ProjectCampaign from django.test import TestCase, RequestFactory from django.contrib.contenttypes.models import ContentType from rest_framework import status from bluebottle.blu...
#!/usr/bin/env python3 # # Copyright (c) 2020 Intel Corporation # # SPDX-License-Identifier: Apache-2.0 """ Dictionary-based Logging Database Generator This takes the built Zephyr ELF binary and produces a JSON database file for dictionary-based logging. This database is used together with the parser to decode binary...
from __future__ import annotations import collections import os import pathlib import procrunner import pytest from cctbx import uctbx from dxtbx.model import ExperimentList from dxtbx.serialize import load from dials.array_family import flex def unit_cells_are_similar( uc1, uc2, relative_length_tolerance=0.01, ...
#!/usr/bin/env python3 import psycopg2 from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT from psycopg2.extras import NamedTupleCursor as ds_cur import requests import pymongo import re import csv from string import hexdigits from urllib.parse import unquote from html.parser import HTMLParser from datetime imp...
"""Gets the wrapped entity.""" return self.__entity def GetNext(self): """Wrap and return the next entity. The entity is retrieved from the iterator given at construction time. """ return MultiQuery.SortOrderEntity(self.__entity_iterator, self.__orderings) def CmpProperties(self, that): """Compare two entit...
IiII - O0 % Ii1I if 27 - 27: OoO0O00 + Oo0Ooo if 92 - 92: I1IiiI % iII111i if 31 - 31: OoooooooOO - oO0o / I1Ii111 if 62 - 62: i11iIiiIii - I11i if 81 - 81: I11i if 92 - 92: OOooOOo - Oo0Ooo - OoooooooOO / IiII - i1IIi if 81 - 81: i1IIi / I1Ii111 % i11iIiiIii . iIii1I11I1II1 * OoOoOO00 + OoooooooOO if ( self . ...
1 0.5 0.3 0.0 0.1 RtCylinder_10_0 Y(SI) 1 0.3 0.0 -0.2 0.1 RtCylinder_30_0 Z(AP) 3 0.7 0.5 0.3 0.1 RtCylinder_30_0 Y(SI) 3 1.1 0.3 -0.5 0.4 Cone_10_0 Z(AP) 1 0.3 0.1 -0.1 0.2 Cone_10_0 Y(SI) 1 1.0 0.3 0.2 0.2 Cone_30_0 Z(AP) 3 -0.0 -0.8 -1.4 0.4 Cone_30_0 Y(SI) 3 0.9 -1.3 -1.5 0.5 RtCone_10_0 Z(AP) 1 0.0 -1.1 -...
from neuron import h import numpy as np from .cell import Cell #from .. import synapses from ..util import nstomho from ..util import Params from .. import data __all__ = ['TStellate', 'TStellateRothman', 'TStellateNav11'] class TStellate(Cell): type = 'tstellate' @classmethod def create(cls, model='RM03', *...
#!/usr/bin/env python """Client actions related to searching files and directories.""" import functools import stat import logging from grr.client import actions from grr.client import vfs from grr.lib import utils from grr.lib.rdfvalues import client as rdf_client from grr.lib.rdfvalues import flows as rdf_flows ...
except Exception as e: msg = (_('Failed to create share %(share_name)s: %(e)s') % {'share_name': share_name, 'e': six.text_type(e)}) LOG.exception(msg) raise exception.ShareBackendException(msg) try: result = self._client.getfshare( protocol, share_name, fpg=fpg, vfs=vfs, fstore=fstore) LOG.debug("getfshare r...
import requests import time import datetime import hmac import hashlib import krakenex import csv from gemini.client import Client from poloniex import Poloniex try: from urllib import urlencode from urlparse import urljoin except ImportError: from urllib.parse import urlencode from urllib.parse import urljoin #AP...
<gh_stars>0 from __future__ import print_function import boto3 from decimal import Decimal import json import urllib import os from datetime import datetime from contextlib import closing from boto3.dynamodb.conditions import Key, Attr from botocore.exceptions import ClientError print('Loading function') rekogniti...