input
stringlengths
2.65k
237k
output
stringclasses
1 value
right handle', rgt) #self.build_pickwalking( rootNode ) # TODO: Evaluate if this should rather be in Rig or Transform def switch_fkik(self, **kwargs): am = AniMeta() char = None limb = None side = None newMode = 0 if 'Character' in kwargs: char = kwargs['Character'] if 'Limb' in kwar...
returning from shgrid with ier = ', ier if ier != 0: msg = 'Error in return from shgetnp call with -- ' + Shgrid.errorTable(self)[ier] raise ValueError, msg iflag = 1 for i in range(1, numberPoints): np[i], ier = shgridmodule.shgetnp(self.xo, self.yo, self.zo, self.xi, self.yi, self.zi, iflag, iwk, rwk) if ...
import contextlib import gc import re import sys import threading import types from contextlib import ExitStack, contextmanager from functools import partial from typing import List, Callable, Any, cast import attr import pytest from .. import FrameInfo, Traceback, customize, register_get_target def remove_address_...
3) >>> v = torch.randn(150, 1) >>> out = k.mmv(X1, X2, v, out=None) >>> out.shape torch.Size([100, 1]) """ X1, X2, v, out = self._check_mmv_dimensions(X1, X2, v, out) self._check_device_properties(X1, X2, v, out, fn_name="mmv", opt=opt) params = self.params if opt is not None: params = dataclasses.replace(se...
v] + h4_accelerated[j, v] + h5_accelerated[j, v] + h6_accelerated[j, v] + h7_accelerated[j, v] == j.levels() + 1, name="constrK13") # model.addConstr(h0_accelerated[j, v] + h1_accelerated[j, v] + h2_accelerated[j, v] + h3_accelerated[j, v] + h4_accelerated[j, v] + h5_accelerated[j, v] == 4, name="constrK7") model...
<gh_stars>1-10 from pyqtgraph.Qt import QtGui, QtCore import numpy as np from pyqtgraph.Point import Point import pyqtgraph.debug as debug import weakref import pyqtgraph.functions as fn from GraphicsWidget import GraphicsWidget __all__ = ['AxisItem'] class AxisItem(GraphicsWidget): def __init__(self, orientation, pe...
<reponame>GT-RAIL/isolation_cyoa<filename>dining_room/models/website.py import os from django.conf import settings from django.core.validators import MinValueValidator from django.db import models from django.contrib import auth from django.contrib.auth.models import (AbstractBaseUser, PermissionsMixin, BaseUserManag...
from __future__ import annotations from ..typecheck import * from enum import IntEnum from ..import core from .import dap from ..watch import Watch from .debugger import Debugger from .error import Error from ..breakpoints import ( Breakpoints, SourceBreakpoint, ) from .variable import ( Variable, SourceLocati...
addTypeEqualityFunc(self, typeobj, function): """Add a type specific assertEqual style function to compare a type. This method jest dla use by TestCase subclasses that need to register their own type equality functions to provide nicer error messages. Args: typeobj: The data type to call this function on when bo...
= args[0] address = args[1] maker_fee = args[2] taker_fee = args[3] return register_marketplace(marketplace, address, maker_fee, taker_fee) if operation == "set_contract_state": contract_state = args[0] set_contract_state(contract_state) return True # State of the contract. if operation == "get_state": ret...
<filename>test/test_3gpp_channel_lsp.py # # SPDX-FileCopyrightText: Copyright (c) 2021-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # try: import sionna except ImportError as e: import sys sys.path.append("../") import tensorflow as tf gpus = tf.config.list_physica...
# script to make graph of connected components in a volume import argparse import logging import pickle from collections import defaultdict from typing import Dict, Set, Tuple, Union import cupy as cp import cupyx.scipy.ndimage as cpnd import h5py import numpy as np VolumeFile = Tuple[str, str] ArrayTypes = Union[np....
#!/usr/bin/env python # -*- coding: utf-8 -*- """Python implementation of Poincaré Embeddings [1]_, an embedding that is better at capturing latent hierarchical information than traditional Euclidean embeddings. The method is described in more detail in [1]. The main use-case is to automatically learn hierarchical re...
# coding=utf-8 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------------------------...
mask = None else: # todo create faster fill func without masking mask = com.mask_missing(transf(values), missing) if method == 'pad': com.pad_2d(transf(values), limit=limit, mask=mask) else: com.backfill_2d(transf(values), limit=limit, mask=mask) return make_block(values, self.items, self.ref_items) def take...
<filename>inferelator_prior/motifs/_motif.py<gh_stars>1-10 import numpy as np import pandas as pd import warnings import os import shutil import tempfile import itertools import pathos from collections import Counter from inferelator_prior.processor.bedtools import (extract_bed_sequence, intersect_bed, load_bed_to_bed...
# -*- coding: utf-8 -*- """ Javelin Web2Py Admin Controller """ # metadata __author__ = "<NAME>" __copyright__ = "(c) 2013, Jacobson and Varni, LLC" __date__ = "7/12/2013" __email__ = "<EMAIL>" __data__ = {'name' : 'jadmin', 'label' : 'Admin', 'description' : 'Only accessible to admins', 'icon' : 'briefcase', 'u-ic...
<gh_stars>10-100 from http.server import HTTPServer, CGIHTTPRequestHandler from socketserver import TCPServer import os import webbrowser import multiprocessing import sqlite3 import urllib.parse import json import sys import argparse import imp import yaml import re from cravat import ConfigLoader from cravat import a...
from scrapy import Spider, Request from scrapy.selector import Selector from webmd.items import WebmdItem import urllib import re headers = {'User-Agent': 'Chrome/56.0.2924.87', 'enc_data': 'OXYIMo2UzzqFUzYszFv4lWP6aDP0r+h4AOC2fYVQIl8=', 'timestamp': 'Thu, 09 Feb 2017 02:11:34 GMT', 'client_id': '3454df96-c7a5-47bb-a7...
from io import TextIOWrapper from django.contrib.auth import authenticate, login, logout from django.contrib.auth.decorators import login_required, user_passes_test from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin from django.core.urlresolvers import reverse, reverse_lazy from django.http...
at the | first point through which | the conic hybConic passes to the inverse of the one of the direction | used for | the tangent. | | | passingPtIdx = 1 | passingPtTgtOrient = -1 | hybConic.SetIntermediateTangentDirectionFlag passingPtIdx, | passingPtTgtOrient :param int i_index_point: :param int i_ori...
# # _/_/ _/_/_/ _/_/_/_/_/ _/_/ _/_/_/ _/ _/ _/_/_/ # _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ # _/ _/ _/ _/ _/ _/ _/_/_/ _/ _/ _/_/ # _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ # _/_/ _/_/_/ _/ _/_/ _/ _/_/ _/_/_/ # # # __ _____ __ _____ __ _ __ # / / __ __ / ___/__ _______ / / ___ ___ / ___/__ / /__ (_) /_____ ____ # / _ \/ // / / (_ / -...
dict((x.residue_number, x.residue_class) for x in self.shx.residues.all_residues) class RESI(): def __init__(self, shx, spline: list): """ RESI class[ ] number[0] alias """ self.shx = shx self.residue_class = '' self.residue_number = 0 self.alias = None self.chain_id = None self.textline = ' '.join(spline)...
'Ↄ', '&conbase;': 'ↄ', '&denl;': '\ueee3', '&dscap;': 'ᴅ', '&dstrok;': 'đ', '&Dstrok;': 'Đ', '&dovlmed;': '\ue491', '&dtailstrok;': 'ꝱ', '&dtail;': 'ɖ', '&dscapdot;': '\uebd2', '&ddotbl;': 'ḍ', '&Ddotbl;': 'Ḍ', '&dscapdotbl;': '\uef26', '&ddot;': 'ḋ', '&Ddot;': 'Ḋ', '&dacute;': '\ue477', '&Dacute;': '\ue077', '&et...
corrections then in the code below, calls to `pix2foc` will # have to be replaced with # wcs_world2pix(all_pix2world(pix_list, origin), origin) # # ############################################################ # # INITIALIZE ITERATIVE PROCESS: ## # ############################################################ # ...
#!/usr/bin/env python2 # -*- coding:utf8 -*- """ A simple Python 2.7+ / 3.4+ script to send a text message to a Free Mobile phone. - Warning: it only works in France to a French number, using the mobile operator Free Mobile. - Warning: some initial configuration is required before running this script (see the error me...
<reponame>OOAmusat/idaes-pse ################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (...
from typing import Union, List, Tuple, Sequence, Dict, Any, Optional, Collection from copy import copy from pathlib import Path import pickle as pkl import logging import random import lmdb import numpy as np import torch import torch.nn.functional as F from torch.utils.data import Dataset from scipy.spatial.distance ...
10: return 10 else: return u def __get_current_coords(self,): return np.array([self.x_history[-1], self.y_history[-1], self.tetta_history[-1]]) def __get_terminal_coords(self,): return np.array([self.xf, self.yf, self.tettaf]) def estimate(self,): v0 = self.__get_current_coords() vf = self.__get_terminal_...
IOError as e: val = value.Str('<I/O error: %s>' % pyutil.strerror_IO(e)) except KeyboardInterrupt: val = value.Str('<Ctrl-C>') finally: self.mem.PopStatusFrame() return val def EvalRhsWord(self, UP_w): # type: (word_t) -> value_t """Used for RHS of assignment. There is no splitting. """ if UP_w.tag_() == w...
""" ECCO v4 Python: read_bin_llc This module includes utility routines for loading binary files in the llc 13-tile native flat binary layout. This layout is the default for MITgcm input and output for global setups using lat-lon-cap (llc) layout. The llc layout is used for ECCO v4. .. _ecco_v4_py Documentation : ...
<reponame>luduvigo/app-blog-code #!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
<gh_stars>1-10 #! /usr/bin/env python3 import os import sys import argparse import signal import time from datetime import datetime, timedelta import xml.etree.ElementTree as etree import xml.dom.minidom as minidom import json import random import re #--import the base mapper library and variants try: import base_m...
#!/usr/bin/python # # Compares vmstate information stored in JSON format, obtained from # the -dump-vmstate QEMU command. # # Copyright 2014 <NAME> <<EMAIL>> # Copyright 2014 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
""" Test homebase. Since some of the homebase functionality is OS specific, this module can only get 100% coverage if it is run on all three operating systems: Windows, Linux, and macOS. Thus, coverage tools will need to merge reports from different runs. From a functional perspective, the only thing that changes acr...
current month,, *overall: 0. :param stats_fields: Additional fields to add to statistics """ method_parameters = {k: v for k, v in locals().items() if k not in {'self', 'raw_response'}} param_aliases = [] method_name = 'ads.getStatistics' response_type = responses.AdsGetStatistics return self._call(method_name...
""" Module for eigenvalue analysis. """ import logging from math import ceil, pi import numpy as np import scipy.io from scipy.linalg import solve from andes.io.txt import dump_data from andes.plot import set_latex, set_style from andes.routines.base import BaseRoutine from andes.shared import div, matrix, plt, spar...
listener: ParseTreeListener): if hasattr(listener, "enterInclude_"): listener.enterInclude_(self) def exitRule(self, listener: ParseTreeListener): if hasattr(listener, "exitInclude_"): listener.exitInclude_(self) def accept(self, visitor: ParseTreeVisitor): if hasattr(visitor, "visitInclude_"): return visitor...
lootbox and obtained:\n" "".format(ctx.message.author.name, lootbox.title())) for pkmn in pokemon_obtained.items(): self._move_pokemon_to_inventory(trainer_profile, pkmn[0], pkmn[1]) if pkmn[1]: msg += "**{}(Shiny)**\n".format(pkmn[0].title()) self._post_pokemon_catch(ctx, random_pkmn, pkmn_img_path, random_pkm...
from argparse import ArgumentParser import numpy as np from .calculations import main_print_point_bidim_dpa from .graphics import main_graph from .save_output import save_output_jpg, save_output_txt def init_parser(): ''' Initialization of the argument parser. Version as optional argument. Returns -------------...
in hparams:{}'.format(PREFIX, hparams['act_func_list'])) self.act_func_list = hparams['act_func_list'] if self.act_func_list is None: self.act_func_list = np.repeat(NNModel.DEFAULT_ACT_FUNC_KEY, [self.n_layer - 1]) print('{}Use act_func_list with default value:{}'.format(PREFIX, self.act_func_list)) self.act_func_...
<filename>src/Products/CMFCore/tests/test_CachingPolicyManager.py ############################################################################## # # Copyright (c) 2002 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL shou...
temp_output = [] for i in range(self.num_inputs): if isinstance(normalized_variables[i][record], list): for num in normalized_variables[i][record]: temp_input.append(float(num)) else: temp_input.append(normalized_variables[i][record]) for i in range(self.num_outputs): if isinstance(normalized_variables[...
import math, torch import numpy as np from numpy.random import normal as normrnd from scipy.stats import multivariate_normal, norm from scipy.linalg import sqrtm, expm from pdb import set_trace as bp from include.DNN import DNN import matplotlib.pyplot as plt import matplotlib.animation as animation from include.dataSt...
W = int(line[0]) Ln = int(line[1]) Un = int(line[2]) G = int(line[3]) L = [] for i in range(Ln): line = input.readline().split() x = int(line[0]) y = int(line[1]) L.append((x, y)) return Ln def func_274c29e3e1244da3b1b5d8eb82909935(input): line = input.readline().split() W = int(line[0]) Ln = int(line[1]...
are read from image file elif isinstance(Data_for_localMaxima, str) or Data_for_localMaxima is None: Data, framedim, fliprot = IOimage.readCCDimage(filename, stackimageindex=stackimageindex, CCDLabel=CCDLabel, dirname=None, verbose=verbose) # if verbose: print("image from filename {} read!".format(filename)) ...
and corresponding Cell instances as values. The Cell instance associated with a given key is used as a template for the other cells of its type in the population. gid_ranges : dict A dictionary of unique identifiers of each real and artificial cell in the network. Every cell type is represented by a key read from ...
<filename>old/montecarlo/cfr.py #!/usr/bin/env python3 import asyncio import collections import copy import math import numpy as np import random import sys from game import Game import model import moves #MCCFR with either External Sampling or Average Sampling #TODO deal with purging data between searches in a nic...
import pickle import os import sys import colorsys import math import copy import tkinter as tk from collections import namedtuple from tkinter import filedialog, messagebox, simpledialog from tkinter import * from GAEV import * cur_dir = os.getcwd() sets_to_highlight = {} # {"blue": [gene1, gene,2 gene...
import pandas import os import math import numpy from scipy import stats pandas.set_option('display.max_rows', 200, 'display.max_columns', 200) # change it to see more or less rows and/or columns # Ask inputs to read the TSV file dirPath = input('Enter path to TSV file: ') inputName = input('Enter TSV name (input fil...
pyuvdata. """ pol_labels = ['NS','EW'] plt.subplots_adjust(wspace=0.25) uv = UVData() uv.read_uvh5(file) baseline_groups = get_baseline_groups(uv,use_ants="auto") freqs = uv.freq_array[0]/1000000 loc = EarthLocation.from_geocentric(*uv.telescope_location, unit='m') obstime_start = Time(uv.time_array[0],forma...
# # # Copyright (C) University of Melbourne 2012 # # # #Permission is hereby granted, free of charge, to any person obtaining a copy #of this software and associated documentation files (the "Software"), to deal #in the Software without restriction, including without limitation the rights #to use, copy, modify...
## values = numpy.copy(value_array) # we do not wish to change the original value_array in case it needs to be reused in user code ## for cell, val in zip(self, values): ## cell.set_parameters(**{parametername: val}) ## elif len(value_array.shape) == len(self.dim[0:self.actual_ndim])+1: # the values are themselves 1...
'<NAME>', 'zh': u('\u6c5f\u82cf\u7701\u5357\u4eac\u5e02')}, '861811481':{'en': '<NAME>', 'zh': u('\u6c5f\u82cf\u7701\u9547\u6c5f\u5e02')}, '861811482':{'en': '<NAME>', 'zh': u('\u6c5f\u82cf\u7701\u5f90\u5dde\u5e02')}, '861818218':{'en': '<NAME>', 'zh': u('\u6e56\u5357\u7701\u5e38\u5fb7\u5e02')}, '861811483':{'en': ...
<gh_stars>0 #!/usr/bin/python3 # PiPhone - A DIY Cellphone based on Raspberry Pi # This must run as root (sudo python lapse.py) due to framebuffer, etc. # # http://www.adafruit.com/products/998 (Raspberry Pi Model B) # http://www.adafruit.com/products/1601 (PiTFT Mini Kit) # # Prerequisite tutorials: aside from the bas...
self.announce_to(self.channel, text, now) def announce_to(self, dest, text, now=False): "Announce to a specific destination (nick or channel)." new_text = "%s%s%s:%s %s" % (LBLUE, self.__class__.__name__, WHITE, LGRAY, text) self.send_to(dest, new_text, now) def send(self, text, now=False): """ Send a message ...
metadata in metadata_gen: wrs_polygon = metadata.get_wrs_polygon() wrs_shape = shapely.wkb.loads(wrs_polygon) unioned_beast = unioned_beast.union(wrs_shape) self.assertTrue(unioned_beast.contains(area_shape)) class TestMetadata(unittest.TestCase): def test_bounds(self): row = ('LC80330352017072LGN00', '', 'LAND...
#! /usr/bin/env python # -*- coding:utf8 -*- # # pw_classes.py # # This file is part of pyplanes, a software distributed under the MIT license. # For any question, please contact one of the authors cited below. # # Copyright (c) 2020 # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # <NAME> <<EMAIL>> # # Permission is hereby g...
for ind in range(num_outputs): t1, t5 = accuracy(outputs[ind].detach().cpu(), cls_targets[ind].detach().cpu(), topk=(1, 5)) top1_meters[ind].update(t1.item(), batch_size) top5_meters[ind].update(t5.item(), batch_size) loss_meters[ind].update(losses_per_task[ind].item(), batch_size) if use_gaze: loss_gaze.update(...
function: The callback function for asynchronous request. (optional) :param str id: ProductSize id (required) :param str filter: :return: list[Product] If the method is called asynchronously, returns the request thread. """ all_params = ['id', 'filter'] all_params.append('callback') all_params.append('_retu...
+ 1)] = [ estimator.score(metric, pos_label=pos_label, cutoff=cutoff) ] if training_score: estimator.test_relation = estimator.input_relation result_train["{}-fold".format(i + 1)] = [ estimator.score(metric, pos_label=pos_label, cutoff=cutoff) ] else: result["{}-fold".format(i + 1)] = [ estimator.score(m, pos...
> 10" ] alarm_def = { u'name': '<NAME>', u'expression': 'test.metric > 10' } for expression in bad_expressions: alarm_def[u'expression'] = expression response = self.simulate_request( path="/v2.0/alarm-definitions/", headers={'X-Roles': CONF.security.default_authorized_roles[0], 'X-Tenant-Id': TENANT_ID}, ...
<filename>trezor_crypto/trezor_ctypes_gen.py<gh_stars>0 # -*- coding: utf-8 -*- # # TARGET arch is: ["'--std=c99", '-fPIC', '-DUSE_MONERO=1', '-DUSE_KECCAK=1', '-DUSE_LIBSODIUM', '-DSODIUM_STATIC=1', '-DRAND_PLATFORM_INDEPENDENT=1', "-Isrc/'"] # WORD_SIZE is: 8 # POINTER_SIZE is: 8 # LONGDOUBLE_SIZE is: 16 # import cty...
if pdb not in pdct[uni]: pdct[uni].append(pdb) except KeyError: pdct[uni] = [pdb] pdct_rev[pdb] = uni targets = [] with open(prots, 'r') as unisf: for lp in unisf: prot = lp.strip() targets.append(prot) #pdct_rev[prot] = lp.strip().upper() try: targets += pdct[lp.strip().upper()] except KeyError: pass re...
<gh_stars>1-10 # -*- coding: utf-8 -*- # Licensed under a MIT style license - see LICENSE.rst """ Access spectroscopic data for a single BOSS target. """ from __future__ import division, print_function from six import binary_type import re import numpy as np import numpy.ma import fitsio import astropy.table im...
<filename>openpnm/io/Statoil.py import os import numpy as np from openpnm.topotools import trim, extend from openpnm.utils import logging from openpnm.io import GenericIO from openpnm.network import GenericNetwork from openpnm.geometry import GenericGeometry import openpnm.models as mods from pathlib import Path from p...
self.type = None self.info = None class ErrorDetail(msrest.serialization.Model): """The error detail. Variables are only populated by the server, and will be ignored when sending a request. :ivar code: The error code. :vartype code: str :ivar message: The error message. :vartype message: str :ivar target: T...
str, Enum)): ID = "id" BASE_UNIT_OF_MEASURE_ID = "baseUnitOfMeasureId" BLOCKED = "blocked" DISPLAY_NAME = "displayName" GTIN = "gtin" INVENTORY = "inventory" ITEM_CATEGORY_CODE = "itemCategoryCode" ITEM_CATEGORY_ID = "itemCategoryId" LAST_MODIFIED_DATE_TIME = "lastModifiedDateTime" NUMBER = "number" PRICE_I...
<reponame>honzajavorek/oci-cli<filename>services/autoscaling/src/oci_cli_auto_scaling/generated/autoscaling_cli.py # coding: utf-8 # Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. from __future__ import print_function import click import oci # noqa: F401 import six # noqa: F401 import sys...
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxtpro.base.exchange import Exchange import ccxt.async_support as ccxt from ccxtpro.base.cache import ArrayCache, ArrayCacheBySymbolB...
#!/usr/bin/env python from __future__ import division import sys import os import re gen_dir = os.path.dirname(os.path.abspath(__file__)) csv_dir = os.path.join(gen_dir, "csv") tmpl_dir = os.path.join(gen_dir, "templates") dest_dir = os.path.abspath(os.path.join(gen_dir, "..", "src", "generated")) class Template(ob...
""" This module converts to/from a nested structure (e.g. list of lists of lists of ... of values) and a (nest pattern, flat list) tuple The nest pattern is a string consisting solely of square brackets and digits. A number represents the number of consecutive values at the current level of the nested structure. An op...
<reponame>amitkg29/contrail-controller #!/usr/bin/env python # # Copyright (c) 2013 Juniper Networks, Inc. All rights reserved. # # # analytics_systest.py # # System tests for analytics # import sys builddir = sys.path[0] + '/../..' import threading threading._DummyThread._Thread__stop = lambda x: 42 import signal i...
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- """Contains functionality for managing conda environment dependencies. Use the :class:`azureml.core.conda_dependencies.CondaDependen...
import shlex import unittest import mock import pytest import requests from vt.utils import VittlifyError from vt.vt import ( Status, add, categories, complete, display_all_shopping_lists, display_item, display_shopping_list, display_shopping_list_categories, help, modify, move, run, show, term, ) cla...
= A.diagonalize() return P, D def jordan(self, Am, calc=True): A = sp.Matrix(Am) if calc is True: Pa, Ja = A.jordan_form(calc_transform=calc) return Pa, Ja if calc is False: Jb = A.jordan_form(calc_transform=calc) return Jb def char(self, Am): A = sp.Matrix(Am) M, N = np.array(Am).shape ...
<gh_stars>1-10 import numpy import SLIX from SLIX.CPU._toolbox import _direction, _prominence, _peakwidth, \ _peakdistance, _centroid, _centroid_correction_bases, _peaks __all__ = ['TARGET_PROMINENCE', 'peaks', 'peak_width', 'peak_prominence', 'peak_distance', 'mean_peak_distance', 'background_mask', 'mean_peak_w...
<reponame>levilucio/SyVOLT """ __property2_complete_MDL.py_____________________________________________________ Automatically generated AToM3 Model File (Do not modify directly) Author: levi Modified: Wed May 6 15:39:12 2015 ________________________________________________________________________________ """ from stic...
9 floats (so3 element)`) t (:obj:`list of 3 floats`) """ return _robotsim.RobotModelLink_setTransform(self, R, t) def getVelocity(self): """ Returns the velocity of the link's origin given the robot's current joint velocities. """ return _robotsim.RobotModelLink_getVelocity(self) def getAngularVelocity(...
<reponame>yrafalin/7thGrade<gh_stars>0 import math import random import time keepgoin = 'yes' xwin = 0 owin = 0 currentplay = '' def printboard(): print(' ') print(' | |') print(' {spot1} | {spot2} | {spot3}'.format(spot1 = spots[0], spot2 = spots[1], spot3 = spots[2])) print(' | |') print(' TTTTTTTTTTTTTTTTT')...
<filename>python/lsst/eotask_gen3/eoCalibTable.py """ Base classes for Electrical Optical (EO) calibration data These classes define the interface between the transient data classes used in EO test code, and the `astropy.table.Table` classes used for persistent storage. Specifically they provide ways to define table ...
= Fp(e*c) assert C_final == sx.n*G + sr.n*H return True def pedersen_vector_test(): x_arr, r_arr, C_arr = [], [], [] for _ in range(10): x_elem = uint256_from_str(os.urandom(32)) C_elem, r_elem = make_pedersen_commitment(x_elem) x_arr.append(x_elem) C_arr.append(C_elem) r_arr.append(r_elem) getChallenge, ...
== 4.0 * 10 ** 3 assert m["tr(r:p4udt27-p4udt27lv)"].windings[1].nominal_voltage == 0.48 * 10 ** 3 assert m["tr(r:p4udt27-p4udt27lv)"].feeder_name == "sourcebus_src" assert m["tr(r:p4udt27-p4udt27lv)"].noload_loss == 0.6 assert m["tr(r:p4udt27-p4udt27lv)"].loadloss == 1.74408 assert m["tr(r:p4udt27-p4udt27lv)"].p...
to bits, include antipodal level shift to [-1,1] >>> yn_soft = dc.cpx_awgn(2*y-1,EbN0-3,1) # Channel SNR is 3 dB less for rate 1/2 >>> yn_hard = ((np.sign(yn_soft.real)+1)/2).astype(int) >>> z = cc1.viterbi_decoder(yn_hard,'hard') >>> # Count bit errors >>> bit_count, bit_errors = dc.bit_errors(x,z) >>> tot...
activity: %s' % task) return False except models.ValidationError as e: errors.append(str(e)) return False except Exception as e: errors.append('Unable to convert: %s, Error: %s' % (task, e)) return False return True def copy_to_lesson_13( src_unit, src_lesson, dst_unit, dst_lesson, now_available, errors): ...
<gh_stars>100-1000 #!/usr/bin/env python """ Blue Gecko BGAPI/BGLib implementation Changelog: 2020-08-03 - Ported to Blue Gecko (Kris Young) 2017-06-26 - Moved to python3 2013-05-04 - Fixed single-item struct.unpack returns (@zwasson on Github) 2013-04-28 - Fixed numerous uint8array/bd_addr command arg errors - ...
"""Rotations in three dimensions - SO(3). See :doc:`rotations` for more information. """ import warnings import math import numpy as np from numpy.testing import assert_array_almost_equal unitx = np.array([1.0, 0.0, 0.0]) unity = np.array([0.0, 1.0, 0.0]) unitz = np.array([0.0, 0.0, 1.0]) R_id = np.eye(3) a_id = np....
<reponame>qmaster0803/telegram_gallery_bot import config_module import storage_module import sqlite3 import json import os import glob from datetime import datetime def open_connection(db_path=config_module.main_db_path): try: db_conn = sqlite3.connect(db_path) except: print("Error connecting to database!") retur...
import requests import time import sqlalchemy import yaml import os import pandas as pd import numpy as np import logging from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry from concurrent.futures import ThreadPoolExecutor, as_completed from sqlalchemy.types import VARCHAR from sqlalchemy.ty...
""" A sas7bdat reader. File format taken from https://github.com/BioStatMatt/sas7bdat/blob/master/inst/doc/sas7bdat.rst """ import os import sys import struct import locale import logging import platform from cStringIO import StringIO from datetime import datetime, timedelta from collections import namedtuple from pan...
''' Created on 15 de sep de 2016 Last Modified on 26 de set de 2019 @author: romuere, <NAME> ''' # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'pycbir.ui' # # Created by: PyQt5 UI code generator 5.7 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGu...
self.face_halfedges(fkey): self.halfedge[u][v] = None del self.face[fkey] if fkey in self.facedata: del self.facedata[fkey] for nbr in nbrs: del self.halfedge[nbr][key] edge = "-".join(map(str, sorted([nbr, key]))) if edge in self.edgedata: del self.edgedata[edge] for nbr in nbrs: for n in self.vertex_neighb...
import numpy as np import scipy.stats from ..base_parameters import ( ParamHelper, PriorHelper, PrecondHelper, get_value_func, get_hyperparam_func, get_dim_func, set_value_func, set_hyperparam_func, ) from .._utils import ( normal_logpdf, matrix_normal_logpdf, pos_def_mat_inv, varp_stability_projection, tril_v...
size of the paddings added to the input on both sides of its spatial dimensions. Only zero-padding is supported. Default: 0 dilation: dilation of the 2D convolution operation. Default: 1 groups: number of groups into which the input and output channels are divided, so as to perform a ``grouped convolution``. When `...
<reponame>johnhany/MegEngine # -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Feb 2 12:11:07 2017 @author: leo Take table data and infer values that represent missing data to replace by standard values for missing data. Examples of missing data that can be found: - 'XXX' - 'NO_ADDR' - '999999' - 'NONE' - '-' TODO: - F...
# Copyright (c) 2016,2017 MetPy Developers. # Distributed under the terms of the BSD 3-Clause License. # SPDX-License-Identifier: BSD-3-Clause """Contains a collection of generally useful calculation tools.""" import functools import warnings import numpy as np import numpy.ma as ma from scipy.spatial import cKDTree ...
max(len(x[0]) for x in s)+1 # Output for an entry in ``s`` of ("Year", "2016") with a ``max_len`` of 10 # would be: '= Year .....: 2016' def line(k, v): return f"{k.ljust(max_len, '.')}: {v}" s = [line(*x) for x in s.items()] # Now we can reuse ``max_len`` to mean the longest fully formatted line # We want to ...
# -*- coding: utf-8; -*- """Axially moving solid, Eulerian view, small-displacement regime (on top of uniform axial motion). Three alternative formulations are provided, both in dynamic and in steady-state cases: - `EulerianSolid`, `SteadyStateEulerianSolid`: Straightforward Eulerian description. Variables are `u(...
""" Reserve(TNEGraph self, int const & Nodes, int const & Edges) Parameters: Nodes: int const & Edges: int const & """ return _snap.TNEGraph_Reserve(self, *args) def Defrag(self, OnlyNodeLinks=False): """ Defrag(TNEGraph self, bool const & OnlyNodeLinks=False) Parameters: OnlyNodeLinks: bool const & De...