input
stringlengths
2.65k
237k
output
stringclasses
1 value
proxy = True verbose_name = "22 Kontrak ATL DLH" verbose_name_plural = "22 Kontrak ATL DLH" def __unicode__(self): return self.nomor_sp2d class HargaATLDLH(HargaATL): class Meta: proxy = True verbose_name = "22 Harga ATL DLH" verbose_name_plural = "22 Harga ATL DLH" def __unicode__(self): return "%s" % (s...
<reponame>carbonblack/cbapi #!/usr/bin/python import os import sys import time import json import random import pprint import socket import struct import syslog import requests import optparse sys.path.insert(0, "lib/") from eventHelpers import * sensorid_to_details_map = {} cbapi = {} g_output = None class EventO...
<gh_stars>1-10 from helpers import Project2Box, ProjOperator, squaredNorm, clearFile import logging import random import math import sys from topologyGenerator import Problem import numpy as np import argparse from SparseVector import SparseVector import time import pickle class boxOptimizer(): def __init__(self): ...
#print np.size(self.m_RES_peff_approx), (weight_enb), (resTraffic_enb),enb_idx self.o_powRes_enb[enb_idx] = np.dot(weight_enb, resTraffic_enb) # 1xN * 1xN^T: 1x1 self.o_powSum_norm = np.dot(self.m_WeightPow, self.o_powRes_enb) # inner product def f_update_sgw_results(self): # get SGW load,load ratio and stat...
= op_mat_just_corners[2, self._topleft_mask] op_mat_cnr3 = op_mat_just_corners[3, self._topright_mask] op_mat_just_active_cnrs = np.vstack( (op_mat_cnr0, op_mat_cnr1, op_mat_cnr2, op_mat_cnr3) ) self._operating_matrix_corner_int_IDs = self._realIDtointerior( op_mat_just_active_cnrs ) # ^(4corners,4nodesactivepe...
+ " alredy staked on chain " + str(c.on_chain) + " in AddLiquidity (NOP)") readyQueue.put(c) else: Start(ctx, c, "AL") LP = None token = None if (c.on_chain==1): LP = ctx.contracts['LP_1'] token = '0x0000000000000000000000000000000000000000' else: LP = ctx.contracts['LP_2'] token = '0x4200000000000000000000...
""" A collection of useful functions and data structures for working with data captured by Heimann HTPA32x32d and other thermopile sensor arrays. Data types: * txt - Heimann HTPA recordings in *.TXT, * np - NumPy array of thermopile sensor array data, shaped [frames, height, width], * csv - thermopile sensor array ...
1 ATOM 552 N N . ALA A 1 99 ? 26.253 -16.456 25.181 1.00 18.00 ? 100 ALA A N 1 ATOM 553 C CA . ALA A 1 99 ? 26.103 -15.041 24.775 1.00 19.23 ? 100 ALA A CA 1 ATOM 554 C C . ALA A 1 99 ? 27.438 -14.338 24.535 1.00 18.66 ? 100 ALA A C 1 ATOM 555 O O . ALA A 1 99 ? 27.509 -13.373 23.800 1.00 20.15 ? 100 ALA A O 1 ATO...
self.element_type == "hex": self.GetFaces() self.GetBoundaryFaces() self.GetBoundaryEdges() return def ReadFRO(self, filename, element_type): """Read fro mesh""" if self.elements is not None and self.points is not None: self.__reset__() if element_type == "tri": el = 5 else: raise NotImplementedError("...
for i in equip_list: if i['imei'] == i0: equip_list.remove(i) exist.remove(i0) break ret = json.dumps(equip_list, ensure_ascii=True, indent=4) return ret def equip_tower_mapping(querydict): ret = {} if querydict.has_key('imei'): l = db_util.mongo_find( gConfig['webgis']['mongodb']['database'], 'features', ...
| (forever + stmt) | (repeat + LPAR + expr + RPAR + stmt) | (while_ + LPAR + expr + RPAR + stmt) | ( for_ + LPAR + assgnmt + SEMI + Group(expr) + SEMI + assgnmt + RPAR + stmt ) | (fork + ZeroOrMore(stmt) + join) | ( fork + COLON + identifier + ZeroOrMore(blockDecl) + ZeroOrMore(stmt) + end ) | (w...
assert 'OUTPUT: hello' in res.output assert res.exit_code == ExitCode.FAILED def test_cli_stop_on_fail(cli, cp): """Verify the --stop option works correctly.""" res = cli.invoke(build_magic, ['--verbose', '--stop', '-c', 'execute', f'{cp}', '-c', 'execute', 'echo hello']) if sys.platform == 'linux': assert 'cp: ...
<filename>{{cookiecutter.project_slug}}/config/settings.py """Base settings to build other settings files upon.""" {% if cookiecutter.use_sentry == 'y' -%} import logging {%- endif %} import pathlib from typing import Any, Dict, List, Tuple import environs {%- if cookiecutter.use_sentry == 'y' %} import sentry_sdk {%-...
'test_course', 'test_run', TEST_USER_ID, BRANCH_NAME_DRAFT ) new_locator = new_course.location # check index entry index_info = modulestore().get_course_index_info(new_locator.course_key) assert index_info['org'] == 'test_org' assert index_info['edited_by'] == TEST_USER_ID # check structure info structure_info ...
<reponame>floodlight-sports/floodlight import os.path import warnings from typing import Dict, Tuple, Union from pathlib import Path import numpy as np import pandas as pd from lxml import etree from floodlight.io.utils import download_from_url, get_and_convert from floodlight.core.code import Code from floodlight.co...
<gh_stars>1-10 import numpy as np import copy from models.get_model import get_model from util.collect_stat import CollectStatistics from util.utils import get_indices_each_node_case from util.sampling import MinibatchSampling from data_reader.dataset import get_data from control_algorithm.gtop_k import GTopK from con...
# # Copyright (c) 2016 Nutanix Inc. All rights reserved. # # Thread-safety: this class is not thread-safe. # import glob import logging import os import random import time from collections import namedtuple import gflags from curie.acropolis_node import AcropolisNode from curie.acropolis_types import AcropolisTaskIn...
from chiscore import davies_pvalue, optimal_davies_pvalue class StructLMM: r""" Structured linear mixed model that accounts for genotype-environment interactions. Let n be the number of samples. StructLMM [1] extends the conventional linear mixed model by including an additional per-individual effect term that ...
<filename>pylink/model.py #!/usr/bin/python import inspect import math import os import pprint import re import sys import tempfile import traceback import pylink.utils as utils from pylink.tagged_attribute import TaggedAttribute class LoopException(Exception): pass class DAGModel(object): """DAG Solver Afte...
= "Lat_N" cdf['Latitude'].attrs['SCALETYP'] = "linear" cdf['Latitude'].attrs['VALIDMAX'] = 90.0 cdf['Latitude'].attrs['VALIDMIN'] = -90.0 cdf['Latitude'].attrs['VAR_NOTES'] = "Latitude of virtual magnetic observatories" cdf['Latitude'].attrs['VAR_TYPE'] = "support_data" cdf.new('Longitude', data=Longitude, type=...
user: if driver['races_done'] < 5: if 'rank_pos' in driver: driverItem = { 'Name':user['username'], 'Races':driver['races_done'], 'Points': 0, 'First':driver['top10']['1'], 'Second':driver['top10']['2'], 'Third':driver['top10']['3'], 'Fourth':driver['top10']['4'], 'Fifth':driver['top10']['5'], 'id':user['_i...
from contextlib import contextmanager from rust import RustHelperBackend from stone import ir from stone.backends.helpers import split_words def fmt_shouting_snake(name): return '_'.join([word.upper() for word in split_words(name)]) class RustBackend(RustHelperBackend): def __init__(self, target_folder_path, arg...
time.strftime("{0} {1}".format(self.date_format, self.time_format ), alert_expires_time.timetuple() ) alerts_states_list.append({'key': u"{0}{1}".format('alertExpires', alert_counter), 'value': u"{0}".format(alert_expires)}) # ================================ Alert Info ================================= alert...
# -*- coding: utf-8 -*- import re from csv import writer from datetime import datetime from flask import Blueprint from flask import flash, redirect, render_template, request, url_for, abort, \ session from flask_babel import _ from flask_login import current_user, login_user, logout_user, login_required from io impor...
#!/usr/bin/env python # -*- coding: utf-8 -*- '''astrokep.py - <NAME> (<EMAIL>) - 05/2016 Contains various useful tools for analyzing Kepler light curves. ''' ############# ## LOGGING ## ############# import logging from datetime import datetime from traceback import format_exc # setup a logger LOGGER = None LOGM...
<gh_stars>0 import sys, os, warnings, datetime, tempfile, glob from natsort import natsorted from tqdm import tqdm from PyQt5 import QtGui, QtCore, Qt, QtWidgets import pyqtgraph as pg from pyqtgraph import GraphicsScene import matplotlib.pyplot as plt import numpy as np import cv2 from scipy.ndimage import gaussian_...
<filename>mopidy_jellyfin/remote.py from __future__ import unicode_literals from mopidy import httpclient, models from mopidy_jellyfin.utils import cache import mopidy_jellyfin from .http import JellyfinHttpClient from unidecode import unidecode import os import logging from collections import OrderedDict, defaultdict...
<reponame>ccoutant/celebrationclassic #!/usr/bin/env python import os import re import quopri import cgi import logging import webapp2 import datetime import hashlib import json from google.appengine.ext import ndb from google.appengine.api import users, memcache, images, mail from django.template.loaders.filesystem i...
default = True Whether to keep tight layout or not linewidth: float/int, default = 0.1 The linewidth to use for heatmap fontsize: int, default = 10 The font size for the X and Y tick labels cmap: str, default = 'Blues' The colormap to be used for heatmap Returns: None ''' self.data = data se...
__author__ = 'aarongary' import json import ijson import requests import base64 import sys import math import numpy as np if sys.version_info.major == 3: from urllib.request import urlopen, Request, HTTPBasicAuthHandler, HTTPPasswordMgrWithDefaultRealm, \ build_opener, install_opener, HTTPError, URLError else: fro...
<filename>format_gis_data.py<gh_stars>1-10 #!/usr/bin/python import json import re import sys def Feature(name2, id2, **kwargs): kwargs.update({'name2': name2, 'id2': id2}) return {'type': 'Feature', 'properties': kwargs, 'geometry': {'type': 'MultiPolygon', 'coordinates': []}} FeatureFlag_SetBounds = 0x0001 # ...
= (F1[i][j] + cs) / 2 # if F1[i][j] > one: # F1[i][j] = one # stdout.write("{0:.5f}".format(F1[i][j]) + "\t") for child in children: # if (F1[i][child] / cs) * F1[i][j] == zero and F1[i][child] != zero: # print(i, j, child, F1[i][j], F1[i][child]) F1[i][child] = (F1[i][child] / cs) * F1[i][j] # for i in range(1...
from archive.groups import Group from archive.teams import Team from logging import Logging from itertools import cycle import datetime from copy import deepcopy from sys import exit import collections from os import path, getcwd class Tournament: """ Store (and initialise) dictionary and storage structures Contai...
<gh_stars>0 # # Copyright 2020 Nebulon, Inc. # All Rights Reserved. # # DISCLAIMER: THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO # EVENT SHALL THE AUTHOR...
robot_pos - self.x[:3]) # Calculate jacobian for the back hight torso_jac = np.array([[0], [0], [1]]) # Calculate object jacobian # obj_jac = -1*np.array([np.cross(axis, obj_pos - gp - obj_trans[:3,3].flatten()) for axis in axises]).T obj_jac = ( -1 * np.array( [ np.cross(axis, obj_pos - obj_trans[:3, 3].flatt...
import enum import itertools import solaredge_setapp.information import solaredge_setapp.maintenance import solaredge_setapp.status TARGET_VERSION = "1.4.10" _COUNTRIES = { -1: ["Not Set", "COUNTRY_NONE"], 0: ["General", "COUNTRY_GENERAL"], 1: ["Australia", "COUNTRY_AUSTRALIA"], 2: ["France", "COUNTRY_FRANCE"]...
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from . import ...
#!/usr/bin/env python import rospy import roslib import sys import numpy as np from geometry_msgs.msg import Point # from pahap.srv import image_cmd from pahap.srv import pcl_segment, pcl_segmentResponse from pahap.msg import cluster # from pahap.srv import display2Ddata, display2DdataResponse from numpy import expand...
#!/usr/bin/env python # vim: set fileencoding=utf-8 ts=4 sts=4 sw=4 et tw=80 : # # Second cut at astrometry fitting for UCD project. # # <NAME> # Created: 2021-08-30 # Last modified: 2021-08-30 #-------------------------------------------------------------------------- #*************************************************...
tuple or list, optional :param bd: Parent block diagram, defaults to None :type bd: BlockDiagram, optional :param nin: Number of inputs, defaults to None :type nin: int, optional :param nout: Number of outputs, defaults to None :type nout: int, optional :param ``*inputs``: Optional incoming connections :type ``...
import random import numpy as np import pynmmso as nmmso class Swarm: """ Represents a swarm in the NMMSO algorithm. Arguments --------- id : int Id used to refer to the swarm swarm_size : int Maximum number of particles in the swarm problem : Instance of the problem class. Must implement get_bounds and f...
<filename>ledcontrol/animationpatterns.py # led-control WS2812B LED Controller Server # Copyright 2021 jackw01. Released under the MIT License (see LICENSE for details). from random import random from enum import Enum import ledcontrol.driver as driver import ledcontrol.utils as utils ColorMode = Enum('ColorMode', [...
<gh_stars>0 import getpass import hashlib import json import os import pkgutil import re import sys import time import typing as t import uuid from io import BytesIO from itertools import chain from os.path import basename from os.path import join from zlib import adler32 from .._internal import _log from ..exceptions...
from __future__ import absolute_import, division, print_function from nfldb.db import _upsert class Entity (object): """ This is an abstract base class that handles most of the SQL plumbing for entities in `nfldb`. Its interface is meant to be declarative: specify the schema and let the methods defined here do ...
settings for switch devices:") _LOGGER.info("- Devices (%s):", dev_id) switch_change = False for new_state in [False, True, False]: _LOGGER.info("- Switching %s", new_state) try: switch_change = await smile.set_switch_state( dev_id, members, model, new_state ) except ( pw_exceptions.ErrorSendingCommandError, ...
data scaler.fit(train_data[di+smoothing_window_size:,:]) train_data[di+smoothing_window_size:,:] = scaler.transform(train_data[di+smoothing_window_size:,:]) # Reshape both train and test data train_data = train_data.reshape(-1) # Normalize test data test_data = scaler.transform(test_data).reshape(-1) print (t...
''' (c) Copyright 2021 All rights reserved Programs written by <NAME> Department of Computer Science New Jersey Institute of Technology University Heights, Newark, NJ 07102, USA Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby grante...
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
<filename>parser.py<gh_stars>0 import lexer import ast class Parser: block_end_tokens = [lexer.TokenKind.KW_RETURN, lexer.TokenKind.EOF, lexer.TokenKind.KW_END, lexer.TokenKind.KW_ELSE, lexer.TokenKind.KW_ELSEIF, lexer.TokenKind.KW_UNTIL] priority_table = { lexer.TokenKind.OP_ADD: {'left': 10, 'right': 10}, # + ...
SoftwarePlanVersion( plan=self.plan, role=role ) self.new_product_rate.save() new_version.product_rate = self.new_product_rate new_version.save() for feature_rate in self.new_feature_rates: feature_rate.save() new_version.feature_rates.add(feature_rate) new_version.save() messages.success( request, 'The...
self._support_selection_criteria() class BinningProcess(Base, BaseEstimator, BaseBinningProcess): """Binning process to compute optimal binning of variables in a dataset, given a binary, continuous or multiclass target dtype. Parameters ---------- variable_names : array-like List of variable names. max_n_pre...
<filename>google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/api/yaml_builder.py<gh_stars>1-10 # # Copyright 2007 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the ...
== other.__dict__ def __ne__(self, other): return not (self == other) class similarModels_args(object): """ Attributes: - modelId - compMetrics - numModels """ thrift_spec = ( None, # 0 (1, TType.I32, 'modelId', None, None, ), # 1 (2, TType.LIST, 'compMetrics', (TType.I32, None, False), None, ), # 2 (3...
of the full circuit to be cut auto_cutter (Union[bool, Callable]): Toggle for enabling automatic cutting with the default :func:`~.kahypar_cut` partition method. Can also pass a graph partitioning function that takes an input graph and returns a list of edges to be cut based on a given set of constraints and object...
<filename>run_model.py import argparse import math import os import time import dill import logger import numpy as np import scipy.stats as stats import tensorflow as tf import tensorflow.contrib.seq2seq as seq2seq from tensorflow.contrib.seq2seq.python.ops import beam_search_decoder from tensorflow.python.layers.core...
<filename>test/python/quantum_info/test_synthesis.py # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/l...
skyval = self.mean_clip else: raise ValueError('method must be one of "sigclip" or "median" ') self.data -= skyval if verbose: if self.infile is not None: descript = self.infile else: descript = 'the data' print(' Subtracted value of %f from %s' % (skyval, descript)) return skyval # -----------------------...
new_prof_ids = endpoint_data.profile_ids new_tags = set() for profile_id in new_prof_ids: for tag in self.tags_by_prof_id.get(profile_id, []): new_tags.add((profile_id, tag)) if new_prof_ids != old_prof_ids: # Profile ID changed, or an add/delete. the _xxx_profile_index # methods ignore profile_id == None so we...
# Copyright 2020 Toyota Research Institute. All rights reserved. import argparse import numpy as np import os import torch from glob import glob import sys from packnet_sfm.models.model_wrapper import ModelWrapper from packnet_sfm.datasets.augmentations import resize_image, to_tensor from packnet_sfm.utils.horovod i...
<reponame>shiningsunnyday/ssd_keras<gh_stars>0 # -*- coding: iso-8859-1 -*- from shutil import copy2 import shutil import os import xml.etree.ElementTree import cv2 import argparse ext = '.jpg' dstext = '.jpg' postfix = '' fl32_intersection = ["adidas-text", "adidas1", "adidas2", "adidas3", "aldi", "aldi-text", "ald...
rowSums( countsTable[groups == '%s'] ) ''' % g1) r('''b = rowSums( countsTable[groups == '%s'] ) ''' % g2) if first: r('''plot(cumsum(sort(a - b)), type = 'l') ''') first = False else: r('''lines(cumsum(sort(a - b))) ''') r['dev.off']() r('''suppressMessages(library('ggplot2'))''') r('''suppressMessages(libr...
<gh_stars>1-10 from time import sleep from gtts import gTTS from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.common.exceptions import TimeoutException from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditi...
<reponame>jon85p/pyENL #!/usr/bin/env python3 ''' Traducciones para pyENL ''' def translations(lang='en'): ''' Devuelve un diccionario con las traducciones de cada string. ''' dicc_gen = {} # Por cada opción de texto a mostrar al usuario agregar una entrada al # diccionario general; cada valor de diccionario...
<gh_stars>1-10 ############################################################################### # Copyright (c) 2018-2021 Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory # # Written by <NAME>, <NAME>, <NAME>, <NAME>, <NAME>. # <EMAIL>. # # LLNL-CODE-819515 # # All righ...
#!/usr/bin/env python # coding: utf-8 # # Mask R-CNN Demo # # A quick intro to using the pre-trained model to detect and segment objects. import os import keras import os import sys import random import math import numpy as np import skimage.io import matplotlib import matplotlib.pyplot as plt # Root directory of...
<reponame>elifesciences/builder """`trop.py` is a module that uses the Troposphere library to build up an AWS CloudFormation template dynamically using values from the 'context', a dictionary of data built up in `cfngen.py` derived from the project file (`projects/elife.yaml`): projects file -> build context -> trop....
<filename>ross/disk_element.py import bokeh.palettes as bp from bokeh.models import ColumnDataSource, HoverTool import matplotlib.patches as mpatches import numpy as np import toml from ross.utils import read_table_file from ross.element import Element __all__ = ["DiskElement"] bokeh_colors = bp.RdGy[11] class Disk...
# coding: utf-8 # # Text Data # # ## Pre-introduction # # We'll be spending a lot of time today manipulating text. Make sure you remember how to split, join, and search strings. # ## Introduction # # We've spent a lot of time in python dealing with text data, and that's because text data is everywhere. It is the ...
#------------------------------------------------------------------------------ # 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. #-------------------------------------------------...
dryrun for details of the dryrun mode.''') runmode.add_argument( '-s', choices=['default', 'ignore', 'force', 'build', 'assert'], default='default', metavar='SIGMODE', dest='__sig_mode__', help='''How runtime signature would be handled, which can be "default" (save and use signature, default mode in batch mode)...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
<filename>src/data/augmentation.py<gh_stars>0 import random import math from functools import partial, wraps import numpy as np import cv2 __all__ = [ 'Compose', 'Choose', 'Scale', 'DiscreteScale', 'Flip', 'HorizontalFlip', 'VerticalFlip', 'Rotate', 'Crop', 'MSCrop', 'Shift', 'XShift', 'YShift', 'HueShift',...
# -*- coding: utf-8 -*- """ Diagnostic Record Read/Write ------------------------------ These need to be tied into a the current server context or linked to the appropriate data """ import struct from pymodbus3.constants import ModbusStatus, ModbusPlusOperation from pymodbus3.pdu import ModbusRequest from pymodbus3.p...
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. import logging import random from odoo import api, models, fields, tools, _ from odoo.http import request from odoo.exceptions import UserError, ValidationError _logger = logging.getLogger(__name__) class SaleOrder(mo...
<reponame>Proxymiity/discord-storage-bot from discord import File from os import getcwd from pathlib import Path from discord.ext import commands from utils.dataIO import dataIO from utils import checks, tools, pool, file, verify, log storage_settings = dataIO.load_json("data/storage.json") class Storage(commands.Cog...
#!/usr/bin/env python # noinspection PyUnresolvedReferences import vtkmodules.vtkInteractionStyle # noinspection PyUnresolvedReferences import vtkmodules.vtkRenderingOpenGL2 from vtkmodules.vtkCommonColor import vtkNamedColors from vtkmodules.vtkCommonCore import ( vtkFloatArray, vtkIdList, vtkPoints ) from vtkmodu...
all_products.get('products'): return next_clear for product in all_products['products']: id_product = product['id'] res = self.api('products/' + to_str(id_product) + '.json', None, 'Delete') all_products = self.api('products.json?limit=100') self.sleep_time(0.1) except Exception: self.lo...
#! /usr/bin/env python3 import sys #1 DONE!!! Passed 9/10 def translate_sequence(rna_sequence, genetic_code): pass # Read and get the RNA string rna = rna_sequence.upper() print ("\n \n RNA String: ", rna) x=len(rna) if x < 3: return '' # RNA codon table(make sure you have it) protein_string = "" # Generate p...
instance of `collections.namedtuple` with attributes `low` and `high`. standard_error : float or ndarray The bootstrap standard error, that is, the sample standard deviation of the bootstrap distribution Notes ----- Elements of the confidence interval may be NaN for ``method='BCa'`` if the bootstrap distributi...
import copy import math from functools import partial from typing import Any, Callable, List, Optional, Sequence import torch from torch import nn, Tensor from torchvision.ops import StochasticDepth from .._internally_replaced_utils import load_state_dict_from_url from ..ops.misc import ConvNormActivation, SqueezeExc...
# -*- coding: utf-8 -*- """Developer convenience functions for ibs (detections). TODO: need to split up into sub modules: consistency_checks feasibility_fixes move the export stuff to dbio then there are also convineience functions that need to be ordered at least within this file """ from __future__ import abso...
from typing import Tuple from uuid import uuid4 from freezegun import freeze_time from ee.clickhouse.materialized_columns.columns import materialize from ee.clickhouse.models.event import create_event from ee.clickhouse.queries import ClickhousePaths from ee.clickhouse.queries.paths.path_event_query import PathEventQ...
string tals = bytearray() for chan in tal_channel_data: for s in chan: i = int(s) tals.extend(np.uint8([i % 256, i // 256])) regex_tal = '([+-]\d+\.?\d*)(\x15(\d+\.?\d*))?(\x14.*?)\x14\x00' # use of latin-1 because characters are only encoded for the first 256 # code points and utf-8 can triggers an "invalid c...
assert InvoiceCollection(session, period_id=p1.id)\ .outstanding_amount == 137.5 assert InvoiceCollection(session, period_id=p2.id)\ .outstanding_amount == 33 assert InvoiceCollection(session).unpaid_count() == 2 assert InvoiceCollection(session).unpaid_count( excluded_period_ids=(p1.id, )) == 1 # pay all of t...
mass - 7 ") print("Atomic (proton) number - 3") print("Discovered in 1817") print("Solid at room temp") print("") input("Press enter to return to the main menu ->") os.system('clear') MainMenu() def Beryllium(): os.system('clear') print("Be - Beryllium - Element number 4 ") print("Relative atomic mass - 9 "...
#! /usr/bin/env python #------------------------------------------------------------------------------- # Copyright 2006-2012 UT-Battelle, LLC. See LICENSE for more information. #------------------------------------------------------------------------------- import sys import BeautifulSoup import urllib2 from math imp...
= [ tablename_new + '_' + suffix for suffix in METADATA_TABLE_COLUMN_NAMES ] id_iter = [key for key in key_old_list] val_iter = [(key,) for key in key_new_list] colnames = ('metadata_key',) self.set( METADATA_TABLE_NAME, colnames, val_iter, id_iter, id_colname='metadata_key' ) if invalidate_cache: self.invali...
To ease the presentation some names are abbreivated: .. seqdiag:: diagram { activation = none; === Schedule "block_write" === demote --> executor [ label = "schedule(block_write)" ]; demote <-- executor; === Execute "block_write" and schedule "wait_slaves" === executor -> block_write [ label = "execute(block...
<reponame>RichardScottOZ/geoapps import numpy as np from scipy.interpolate import LinearNDInterpolator import matplotlib.pyplot as plt from scipy.interpolate import griddata from scipy.spatial import cKDTree from scipy.interpolate.interpnd import _ndim_coords_from_arrays from matplotlib.colors import LightSource, Norma...
import logging import os import numpy as np import pandas as pd import sqlalchemy from cached_property import cached_property from scipy.interpolate import interp1d from aqueduct.errors import Error class RiskService(object): def __init__(self, user_selections): # DB Connection self.engine = sqlalchemy.create_en...
list of 3 ints [x, y, z] bounding box padding beyond box spanned by coordinates :param remesh_preview: bool :param return_new_lvl2_nodes: bool :param root_ids: list of uint64s :param n_tries: int :return: list of uint64s or None if no split was performed """ if source_ids is not None and sink_ids is not None: ...
# Copyright (c) 2016 SUSE. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
<reponame>crdietrich/meerkat """MPU-6050 Gyroscope/Accelerometer I2C Driver for Raspberry PI & MicroPython Made by: MrTijn/Tijndagamer Forked 01/02/2019 from https://github.com/Tijndagamer/mpu6050 and merged into meerkat by: <NAME> / crdietrich The MIT License (MIT) Copyright (c) 2015, 2016, 2017, 2018 Martijn (MrTi...
<filename>base_engine/lib/yael_v260_modif/yael/yael.py<gh_stars>10-100 # This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.10 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info as _swig_pyt...
shortcut to change CSS Styles without having to update the main framework. Those changes will only impact the current report. :tip: If you create a module CssOvr.py in the root of your environment, all the CSS Classes will be automatically loaded and if some already existing in the framework, they will be overr...
<reponame>vertica/vertica_ml_python # (c) Copyright [2018-2022] Micro Focus or one of its affiliates. # 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-...
# This file is generated automatically through: # d2lbook build lib # Don't edit it directly import sys d2l = sys.modules[__name__] # Defined in file: ./chapter_preface/preface.md from IPython import display import collections import os import sys import numpy as np import math from matplotlib import pyplot as plt fr...
""" Copyright (c) 2015 SONATA-NFV ALL RIGHTS RESERVED. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
3.125e-08, 'attempts': ' 2U', 'timeIncrement': 7.8125e-09, 'increment': 2, 'stepTime': 3.125e-08, 'step': 1, 'jobName': 'OneTaper3D', 'severe': 0, 'iterations': 4, 'phase': STANDARD_PHASE, 'equilibrium': 4}) mdb.jobs['OneTaper3D']._Message(ODB_FRAME, {'phase': STANDARD_PHASE, 'step': 0, 'frame': 2, 'jobName': '...
import numpy as np import matplotlib.pylab as plt import neuroglancer from analysis_script.utils_format_convert import read_image_vol_from_h5 from ffn.inference.storage import subvolume_path from neuroglancer_segment_visualize import neuroglancer_visualize from run_consensus import run_save_consensus import networkx im...