input
stringlengths
2.65k
237k
output
stringclasses
1 value
def _deserialize(self, params): if params.get("RegionZones") is not None: self.RegionZones = [] for item in params.get("RegionZones"): obj = AvailableRegion() obj._deserialize(item) self.RegionZones.append(obj) self.RequestId = params.get("RequestId") class DescribeCfsFileSystemClientsRequest(AbstractModel): ...
import json import os import argparse import torch import pickle from torch.utils.data import TensorDataset, DataLoader, RandomSampler, SequentialSampler from knowledge_bert.tokenization import BertTokenizer from knowledge_bert.modeling import BertForFeatureEmbs from knowledge_bert.file_utils import PYTORCH_PRETRAINED...
import ctypes import enum import errno from dataclasses import dataclass from functools import partial from signal import Signals import socket from typing import List IOC_REQUEST_PARAMS = { 0x20000000: 'IOC_VOID', 0x40000000: 'IOC_OUT', 0x80000000: 'IOC_IN', 0xc0000000: 'IOC_IN | IOC_OUT', 0xe0000000: 'IOC_DIRMA...
<gh_stars>100-1000 #!/usr/bin/env python3 # -*- coding:utf-8 -*- ############################################################################# # Copyright (c): 2012-2021, Huawei Tech. Co., Ltd. # FileName : common_tools.py # Version : V1.0.0 # Date : 2021-03-01 # Description : Common tools #####################...
ast.ExtSlice): sym[(xslice)] = val elif node.__class__ in (ast.Tuple, ast.List): if len(val) == len(node.elts): for telem, tval in zip(node.elts, val): self.node_assign(telem, tval) else: raise ValueError('too many values to unpack') def on_attribute(self, node): # ('value', 'attr', 'ctx') "extract attribute"...
<gh_stars>1-10 # Copyright 2020 - 2021 MONAI Consortium # 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 agree...
return out @property def adjoint(self): """Adjoint of the operator. If ``self.domain == self.range`` the zero operator is self-adjoint, otherwise it is the `ZeroOperator` from `range` to `domain`. """ return ZeroOperator(domain=self.range, range=self.domain) def __repr__(self): """Return ``repr(self)``.""" ...
image=img) em.set_image(url=f"https://cdn.discordapp.com/emojis/{e.id}") await ctx.send(embed=em) except discord.Forbidden: return await ctx.send("The bot does not have Manage Emojis permission.") @commands.command() @commands.guild_only() @commands.has_permissions(manage_emojis = True) async def de...
# The model produced by the flowobjspace # this is to be used by the translator mainly. # # the below object/attribute model evolved from # a discussion in Berlin, 4th of october 2003 import types import py from rpython.tool.uid import uid, Hashable from rpython.tool.sourcetools import PY_IDENTIFIER, nice_repr_for_fun...
# The Open BSV license. # # Copyright © 2020 Bitcoin Association # # 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,...
``resegmentRange``. Either 1 or 2 thresholds can be defined. In case of 1 threshold, all values equal to or higher than that threshold are included. If there are 2 thresholds, all voxels with a value inside the closed-range defined by these thresholds is included (i.e. a voxels is included if :math:`T_{lower} \leq X...
constants.FEATURE_STORE.TF_RECORD_SCHEMA_FEATURE_FIXED, constants.FEATURE_STORE.TF_RECORD_SCHEMA_TYPE: constants.FEATURE_STORE.TF_RECORD_FLOAT_TYPE}, 'sum_player_age': {constants.FEATURE_STORE.TF_RECORD_SCHEMA_FEATURE: constants.FEATURE_STORE.TF_RECORD_SCHEMA_FEATURE_FIXED, constants.FEATURE_STORE.TF_RECORD_SCHEMA...
else: weight2 = self.path2 return F.linear(input1, weight1, self.bias) + F.linear(input2, weight2, None) def extra_repr(self): return 'in1_features={}, in2_features={}, out_features={}, in1_norm={}, in2_norm={}'.format( self.in1_features, self.in2_features, self.out_features, self.in1_norm, self.in2_norm ) clas...
this elif request.POST['type'] == 'Go': drForm = DateRangeForm(request.POST) # print 'Date Range Submitted' if drForm.is_valid(): # All validation rules pass # get date from POST str_date_from = request.POST['date_from'] str_date_to = request.POST['date_to'] # convert date from string to...
# -*- coding: utf-8 -*- dicti={'Cash Equivalents':['Cash','Cash Equivalents','Cash & Equivalents','Cash and cash equivalents', 'Cash and equivalents','Cash & Cash Equivalents','Money Market','Money Market Securities', 'Marketable securities'], 'Shareholders Equity': ['Shareholders’ Equity','Stockholders’ Equity','Owne...
<reponame>tenoto/hoppy # -*- coding: utf-8 -*- import os import sys import glob import yaml import pandas as pd import inspect import numpy as np from time import sleep import matplotlib.pyplot as plt from astropy.io import fits from astropy.time import Time from astropy.stats import bayesian_blocks # ulimit -n 4...
# -*- coding: utf-8 -*- #***************************************************************************** # Copyright (C) 2003-2006 <NAME>. # Copyright (C) 2006 <NAME>. <<EMAIL>> # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, distributed as part of this software. #**********...
#!/usr/bin/env python # coding: utf-8 from __future__ import print_function import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from torch.autograd import Variable from torchvision.utils import save_image from torch...
# coding: utf-8 """ OpenSilex API No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501 OpenAPI spec version: INSTANCE-SNAPSHOT Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import re #...
import math from typing import Any, Dict, Optional, Tuple import torch from torch import nn, Tensor from torch.distributions import Distribution, Categorical, Independent from layer_utils.distributions import independent_continuous_bernoullis from layer_utils.modes import mode from layers import ConvLSTMCell, Residua...
"""TestCases for multi-threaded access to a DB. """ import os import sys import time import errno import shutil import tempfile from pprint import pprint from random import random try: True, False except NameError: True = 1 False = 0 DASH = '-' try: from threading import Thread, currentThread have_threads = Tr...
# -*- coding: utf-8 -*- ''' .. _module_mc_firewalld: mc_firewalld / firewalld functions ============================================ ''' # Import python libs import logging import copy import mc_states.api from salt.utils.odict import OrderedDict __name = 'firewalld' six = mc_states.api.six PREFIX = 'makina-sta...
or ``StreamingPull`` is not called. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.pubsub_v1.types.PushConfig` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will not be retried. timeout (O...
# given circRNA coordinates file and exon annotation gtf file, print out the adjacent exon coordinates and exon_id import os import re import HTSeq from IntervalTree import IntervalTree class CircNonCircExon(object): def __init__(self, tmp_dir): self.tmp_dir = tmp_dir def print_start_end_file(self, circcoordin...
1.570796326794897e+00 7.853981633974483e-01 0.000000000000000e+00 0.000000000000000e+00 Node: 220 3.652519661611411e-01 1.969933873376818e-01 3.946773085364008e-04 0.000000000000000e+00 -9.712492119861867e-03 -3.444200000000000e-01 -5.601000000000000e-02 0.000000000000000e+00 4.837483971733160e-01 -1.03220544578178...
<gh_stars>0 import argparse import io import logging import os import re import sre_constants import sys import warnings from configparser import (RawConfigParser, NoOptionError) from datetime import datetime from bumpsemver import __version__, __title__ from bumpsemver.exceptions import ( IncompleteVersionRepresenta...
# Copyright (c) 2011 - 2017, Intel Corporation. # # 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 ...
<reponame>felixYyu/iceberg # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # ...
orig_score, '\t', noise, '\t', new_score) print('\n FP Boxes: \t box \t\t\t orig_score \t noise \t\t new_score') print(' ','-'*80) for i, (box, orig_score, noise, new_score) in enumerate(zip(fp_bboxes, orig_fp_scores, fp_noise, fp_scores)): print(' ',i,' \t', box, '\t\t', orig_score, '\t', noise, '\t', new_score) ...
## package manager class redRPackageManager. Contains a dlg for the package manager which reads xml from the red-r.org website and compares it with a local package system on the computer import os, sys, redREnviron, urllib2, zipfile, traceback, redRLog from datetime import date from PyQt4.QtCore import * from...
<reponame>LudoLogical/ManyPass import sys import time import random import string from datetime import datetime, tzinfo, timedelta import requests.exceptions from bs4 import BeautifulSoup import urllib.request generators = [] l337_dict = { 'a': '4', 'e': '3', 'i': '1', 's': '5', 'z': '2', 'o': '0', 't': '7', ...
<reponame>sfurlow/ezcv<gh_stars>1-10 """The module containing all primary functionality of ezcv including: - Content parsing - HTML generation - Site exporting Functions --------- generate_site(): The primary entrypoint to generating a site get_site_config() -> defaultdict: Gets the site config from provided file ...
<reponame>hajicj/muscima<filename>muscima/cropobject.py # -*- coding: utf-8 -*- """This module implements a Python representation of the CropObject, the basic unit of annotation. See the :class:`CropObject` documentation.""" from __future__ import print_function, unicode_literals, division from builtins import zip fro...
<reponame>nyamashi/BigDL # # Copyright 2016 The BigDL Authors. # # 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...
a secret. :attr str id: (optional) The v4 UUID that uniquely identifies the secret. :attr str name: A human-readable alias to assign to your secret. To protect your privacy, do not use personal data, such as your name or location, as an alias for your secret. :attr str description: (optional) An extended descript...
== 0) m.c51 = Constraint(expr= m.x51 - 1.2*m.x156 == 0) m.c52 = Constraint(expr= m.x52 - 1.2*m.x157 == 0) m.c53 = Constraint(expr= m.x53 - 0.3*m.x158 == 0) m.c54 = Constraint(expr= m.x54 - 0.3*m.x159 == 0) m.c55 = Constraint(expr= m.x55 - 0.3*m.x160 == 0) m.c56 = Constraint(expr= m.x56 - 0.9*m.x161 == 0) m.c57 =...
hypohyal joint', 'Preopercle': 'preopercle', 'Forebrain': 'forebrain', 'Head mesenchyme': 'head mesenchyme', 'Preopercle vertical limb-hyomandibula joint': 'preopercle vertical limb-hyomandibula joint', 'Midbrain': 'midbrain', 'Frontonasal prominence': 'frontonasal prominence', 'Ceratohyal-dorsal hypohyal joint'...
' ').replace('\n', ' ').replace('\r', ' ') r10c2 = request.POST.get('r10c2').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ') r11c1 = request.POST.get('r11c1').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ') r11c2 = request.POST.get('r11c2').replace('\t', ' ').replace('\n', ' ').replace('\r', ' ') ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import getpass import json import requests import sys import six import re class API: """ Defines REST API endpoints for Valispace. """ _writable_vali_fields = [ 'reference', 'margin_plus', 'margin_minus', 'unit', 'formula', 'description', 'parent', 'tags', 'shor...
list = [], ) -> str: """ Create a single image task. project is slug of your project. (Required) name is an unique identifier of task in your project. (Required) file_path is a path to data. Supported extensions are png, jpg, jpeg. (Required) status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent...
= index.isin(other) tm.assert_numpy_array_equal(result, expected) result = index.isin(other.tolist()) tm.assert_numpy_array_equal(result, expected) for other_closed in {'right', 'left', 'both', 'neither'}: other = self.create_index(closed=other_closed) expected = np.repeat(closed == other_closed, len(index)) r...
<filename>src/commercetools/platform/models/order.py<gh_stars>1-10 # Generated file, please do not change!!! import datetime import enum import typing from ._abstract import _BaseType from .cart import ( CartOrigin, InventoryMode, RoundingMode, ShippingMethodState, TaxCalculationMode, TaxMode, ) from .common im...
setOkButtonText(*args, **kwargs): pass def setOption(*args, **kwargs): pass def setTextEchoMode(*args, **kwargs): pass def setTextValue(*args, **kwargs): pass def setVisible(*args, **kwargs): pass def sizeHint(*args, **kwargs): pass def testOption(*args, **kwargs): pass def tex...
/ N.sqrt(a) * N.ones(probs.shape,N.float_) c = 0.0 mask = N.zeros(probs.shape) a_notbig_frozen = -1 *N.ones(probs.shape,N.float_) while asum(mask) != totalelements: e = e * (a/z.astype(N.float_)) c = c + e z = z + 1.0 # print '#2', z, e, c, s, c*y+s2 newmask = N.greater(z,chisq) a_notbig_frozen = N.where(newma...
import numpy as np from glob import glob import time import os from pathlib import Path import types import contextlib from scipy import stats, signal, interpolate, special, integrate from darklim import constants from darklim.limit import _upper import mendeleev __all__ = [ "upper", "helmfactor", "drde", "drde_...
import keras from keras import backend as K from keras import optimizers, regularizers from keras.datasets import cifar10, cifar100 from keras.models import Sequential,Model,load_model from keras.layers import Conv2D, Dense, Flatten, MaxPooling2D,GlobalAveragePooling2D, Input, Activation,Dropout from keras.layers.norma...
from __future__ import print_function import errno import itertools import math import numbers import os import platform import signal import subprocess import sys import threading def is_string(value): try: # Python 2 and Python 3 are different here. return isinstance(value, basestring) except NameError: retur...
1 assert response.status_code == 200 #-------------------------------------------------------- # test_delete_zone_rate_limit_value_error() #-------------------------------------------------------- @responses.activate def test_delete_zone_rate_limit_value_error(self): # Set up mock url = self.preprocess_url(ba...
to the collection using eXist-db query syntax ``collection('/db/foo')//node``. :param fulltext_options: optional dictionary of fulltext options that should be used for any full-text queries. See http://demo.exist-db.org/lucene.xml#N1047C for available options. """ xpath = '/node()' # default generic xpath xq_var...
lon0 = mm.cg['xpc'] lat0 = mm.cg['ypc'] lon1 = mm.cg['xpc'] + mm.cg['xlenc'] lat1 = mm.cg['ypc'] + mm.cg['ylenc'] cg_lon = np.linspace(lon0, lon1, mxc) cg_lat = np.linspace(lat0, lat1, myc) mg_lon, mg_lat = np.meshgrid(cg_lon, cg_lat) # wind output holder hld_W = np.zeros((len(cg_lat), len(cg_lon), len(stor...
<reponame>poppyschmo/znc-signal # This file is part of ZNC-Signal <https://github.com/poppyschmo/znc-signal>, # licensed under Apache 2.0 <http://www.apache.org/licenses/LICENSE-2.0>. import configparser from collections import OrderedDict from .configgers import default_config class expression_(dict): pass # noqa E...
<filename>dataset_loaders/data_augmentation.py # Based on # https://github.com/fchollet/keras/blob/master/keras/preprocessing/image.py import os import numpy as np from scipy import interpolate import scipy.misc import scipy.ndimage as ndi from skimage.color import rgb2gray, gray2rgb from skimage import img_as_float ...
<reponame>DentonW/Ps-H-Scattering<gh_stars>1-10 #!/usr/bin/python #TODO: Add checks for whether files are good #TODO: Make relative difference function import sys, scipy, pylab import numpy as np from math import * import matplotlib.pyplot as plt from xml.dom.minidom import parse, parseString from xml.dom import min...
= response2.json['id'] response3 = self.client.put( "/api/v1/jobtypes/TestJobType", content_type="application/json", data=dumps({ "name": "TestJobType", "description": "Jobtype for testing (updated)", "max_batch": 1, "code": code })) self.assert_created(response3) response4 = self.client.get("/api/v1/jobty...
import warnings from collections import OrderedDict, Sequence from functools import partial from datetime import datetime import numpy as np import xarray from datacube.model import Measurement from datacube_stats.utils.dates import datetime64_to_inttime from datacube_stats.utils import da_nodata from datacube_stats...
<filename>clair3/utils.py import sys import gc import shlex import os import tables import numpy as np from random import random from clair3.task.main import * from shared.interval_tree import bed_tree_from, is_region_in from shared.utils import subprocess_popen, IUPAC_base_to_ACGT_base_dict as BASE2BASE, IUPAC_base_t...
self.case_names = [] self.case_count = 0 ## @brief Set up values used to generate all test cases for this spec. def _prepare(self): # Get the path for this spec in the run directory. self.test_dir = runs_dir.join(self.path.purebasename, self.name) # Extract a dict of output file names and test patterns. self.t...
Int8ul, "TaskCompletionApplied" / Int8ul, "InForeground" / Int8ul ) @declare(guid=guid("eb65a492-86c0-406a-bace-9912d595bd69"), event_id=2020, version=0) class Microsoft_Windows_AppModel_Exec_2020_0(Etw): pattern = Struct( "WorkItemId" / Guid, "PsmKey" / WString, "HRESULT" / Int32ul ) @declare(guid=guid("eb...
<gh_stars>0 # coding: utf-8 from __future__ import division from math import sqrt, atan2, pi as PI import itertools from warnings import warn import numpy as np from scipy import ndimage as ndi from ._label import label from . import _moments from functools import wraps __all__ = ['regionprops', 'perimeter'] XY_T...
<reponame>youth4ever/bittrex # Created by <NAME> on 21-01-2018 , 1:02 PM. from conf.sensitive import * from includes.API_functions import * import pymysql import numpy as np from math import floor, ceil from pathlib import Path from os import remove, path import logging.config import json ############ VARIABLES #...
# vim: tabstop=4 shiftwidth=4 softtabstop=4 import inspect import webob from nova.api.openstack import wsgi from nova import exception from nova.openstack.common import gettextutils from nova import test from nova.tests.api.openstack import fakes from nova.tests import utils class RequestTest(test.NoDBTestCase): d...
#!/usr/bin/env python3 # encoding: UTF-8 from collections import OrderedDict import datetime import re import uuid try: from functools import singledispatch except ImportError: from singledispatch import singledispatch from pyramid.httpexceptions import HTTPForbidden import cloudhands.common from cloudhands.commo...
so get them here else: model_fluxes = self.responses.interp(redshifts) lnProb = -np.inf for template_combo in itr.product(*itr.repeat(range(self.num_templates), num_components)): tmp = 0. blend_flux = np.zeros(self.num_measurements) for nb in range(num_components): T = template_combo[nb] type_ind = self.tmp_i...
else: allele_state[ancestral_state] -= state[mutation.node] mutation_index += 1 if polarised: del allele_state[ancestral_state] pos = sites.position[site_index] while windows[window_index + 1] <= pos: window_index += 1 assert windows[window_index] <= pos < windows[window_index + 1] site_result = result[window...
an LFun with the right type.) If so, there must be exactly one argument of the correct type. * May be a term name, treating this case as either a 0-ary operator or an unsaturated term. Note that right now, this _only_ occurs in subclasses. (TypedTerm) originally based on logic.Expr (from aima python), now long di...
def enterAcmd(self, ctx:HaskellParser.AcmdContext): pass # Exit a parse tree produced by HaskellParser#acmd. def exitAcmd(self, ctx:HaskellParser.AcmdContext): pass # Enter a parse tree produced by HaskellParser#cvtopbody. def enterCvtopbody(self, ctx:HaskellParser.CvtopbodyContext): pass # Exit a parse tre...
format='png', dpi=350, bbox_inches='tight', transparent=True) plt.show() def get_solar_min_and_max(noaa_data): """ Get the dates of solar max and solar min for cycle 23 & 24 Parameters ---------- noaa_data Returns ------- """ solar_cycle = {'Cycle 23': None, 'Cycle 24':None} min_1996 = noaa_data['199...
''' Module to analise psf images (e.g. results from ray tracing simulations). Main functionalities are: computing centroids, psf containers etc. Author: <NAME> ''' import logging from math import sqrt, fabs, pi import matplotlib.pyplot as plt import numpy as np from simtools.util.general import collectKwargs, setD...
scoping watcher to a block.""" self.stop() # pylint: disable=R0902 class Etcd3Transaction(): """A series of queries and updates to be executed atomically. Note that this uses an optimistic STM-style implementation, which cannot guarantee that a transaction runs through successfully. If it fails, the application...
############################################################################ # # Filename: rib_service.py # # Author: <NAME> # Created: Fri Feb 8 16:09:22 CET 2019 # # Description: . # # ############################################################################ # # Copyright (c) 2019 Nokia # #########################...
were able to bypass the issue of arguments having to be hashable by catching the empty list ``[]`` during preprocessing in the ``__classcall_private__`` method. Similarly, unhashable arguments can be made hashable -- e. g., lists normalized to tuples -- in the ``__classcall_private__`` method before they are further de...
# -*- coding: utf8 -*- # Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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/LI...
""" n_days = len(self.time) days = np.zeros((n_days,), dtype = np.int) months = np.zeros((n_days,), dtype = np.int) years = np.zeros((n_days,), dtype = np.int) for i,d in zip(range(n_days), self.time): dt = date.fromordinal(int(d)) days[i] = dt.day months[i] = dt.month years[i] = dt.year return days, month...
user-specified wait period). The resulting function's `last_called` attribute stores the value of perf_counter when it was last executed. Parameters ---------- seconds: int or float Minimum wait period. If you try to execute the function < `wait` seconds after its last execution, it will return None. """ if s...
<b>" + str(emailZendesk) + "</b> tickets from Zendesk by " + str(ReqAssCC) + " <b>" + str(firstName) + " " + str(lastName) + "</b>, rendering the result now, please wait.") else: messageDetail.ReplyToChatV2("Pulling <b>" + str(emailZendesk) + "</b> tickets from Zendesk by " + str(ReqAssCC) + " <b>" + str(firstName) +...
<gh_stars>1-10 """ Seismic Crop Batch.""" import string import random from copy import copy import numpy as np import segyio import cv2 from scipy.signal import butter, lfilter, hilbert from ..batchflow import FilesIndex, Batch, action, inbatch_parallel from ..batchflow.batch_image import transform_actions # pylint: ...
<gh_stars>0 """New B parser.""" import sys, collections from rpn import RPN from error import Error class Parser(): def __init__(self, inp, linp, options): self.inp = inp self.linp = linp # Save the compiler options and flags. self.options = options # The output code buffer. self.outp = ["bits 32", ""] ...
<reponame>leezu/gluon-nlp # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "...
the analysis type. Possible values are STEADY_STATE and TRANSIENT. The default value is TRANSIENT. timePeriod A Float specifying the total time period for the step. The default value is 1.0. timeIncrementationMethod A SymbolicConstant specifying the time incrementation method to be used. Possible values are FIXED...
#!/home/lunpin/conda/bin/python import argparse, datetime, gc, gzip, json, matplotlib, numpy, os, re, sys, time matplotlib.use ('Agg') import matplotlib.pyplot import util.util as util ############################################################### ## Main ## ########################################################...
<filename>bfd/datastore/logic.py """ Defines the logical operations that make use of the data layer. Copyright (C) 2020 <NAME>. "Commons Clause" License Condition v1.0: The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition. Without limiting other con...
mu. amostra_sigma = stats.uniform(0, 50).rvs(10000) # Amostra da Uniforme(0, 50) estimativa para sigma. amostra_h_priori = stats.norm(amostra_mu, amostra_sigma).rvs() # Amostrando da Normal(mu, sigma) # Plot plt.rcParams['axes.facecolor'] = 'lightgray' plt.figure(figsize=(17, 7)) plt.hist(amostra_h_priori, bins=171...
import Doberman import datetime from socket import getfqdn import time import requests __all__ = 'Database'.split() dtnow = Doberman.utils.dtnow class Database(object): """ Class to handle interfacing with the Doberman database """ def __init__(self, mongo_client, experiment_name=None): self.client = mongo_cl...
""" Contains methods for making choices. """ import numpy as np import pandas as pd from patsy import dmatrix from .wrangling import broadcast, explode from .sampling import get_probs, get_segmented_probs, randomize_probs, sample2d def binary_choice(p, t=None): """ Performs a binary choice from a series of proba...
polysurface, [0, 2], 0) side2 = self.CreateRect([(xb, yb, y0), (xb, yb, y2), (-xb, yb, y2), (-xb, yb, y0)]) side2s = self.SplitAndKeep(side2, polysurface, [0, 2], 0) cut1 = rs.JoinSurfaces([cut1, side1s[1], side2s[1]], True) cut2 = rs.JoinSurfaces([cut2, side1s[0], side2s[0]], True) polysurface = self.SplitAndKeep...
with the base class but is not used by this method. chk_version (:obj:`bool`, optional): If True, raise an error if the datamodel version or type check failed. If False, throw a warning only. """ # Run the default parser to get most of the data. This correctly parses # everything except for the Telluric.model da...
property is 94""" return self.num == 94 def is_95(self): """Verify whether num property is 95""" return self.num == 95 def is_96(self): """Verify whether num property is 96""" return self.num == 96 def is_97(self): """Verify whether num property is 97""" return self.num == 97 def is_98(self): ""...
<filename>lib/python2.7/site-packages/leginon/gui/wx/ImagePanel.py #!/usr/bin/env python -O # The Leginon software is Copyright 2004 # The Scripps Research Institute, La Jolla, CA # For terms of the license agreement # see http://ami.scripps.edu/software/leginon-license # # $Source: /ami/sw/cvsroot/pyleginon/leginon.gu...
<reponame>mesosphere/cloudkeeper import asyncio import json import logging import os import re import shutil import string import tempfile import uuid from argparse import Namespace from dataclasses import replace from datetime import timedelta from random import SystemRandom from typing import AsyncGenerator, Any, Opt...
self.sig_zeros + 100. self.sig_slope = np.linspace(-10., 90., n) self.sig_slope_mean = x - x.mean() sig_rand = np.random.standard_normal(n) sig_sin = np.sin(x*2*np.pi/(n/100)) sig_rand -= sig_rand.mean() sig_sin -= sig_sin.mean() self.sig_base = sig_rand + sig_sin self.atol = 1e-08 def tes...
<filename>oauth/provider.py<gh_stars>1000+ # Ported to Python 3 # Originally from https://github.com/DeprecatedCode/oauth2lib/blob/d161b010f8a596826050a09e5e94d59443cc12d9/oauth2lib/provider.py import json import logging from requests import Response from io import StringIO try: from werkzeug.exceptions import Unaut...
item in holder_gene if '[KO' in item] list_names = [item for item in holder_gene if item not in (list_enzyme_code+list_kegg_orthology)] if len(list_names) == 2: gene_abb = list_names[0] gene_name = list_names[1] else: gene_abb = None gene_name = list_names[0] ### Enzyme ### if enzyme_code: for enzyme in enzym...
<reponame>zig-for/ALttPDoorRandomizer import aioconsole import argparse import asyncio import colorama import json import logging import shlex import urllib.parse import websockets import Items import Regions class ReceivedItem: def __init__(self, item, location, player): self.item = item self.location = location...
and whose return values must be the colors for that point Returns ------- np.array The pixel array which can then be passed to set_background. """ logger.info( "Starting set_background; for reference, the current time is ", time.strftime("%H:%M:%S"), ) coords = self.get_coords_of_all_pixels() new_backgroun...
<reponame>oaxiom/human<gh_stars>1-10 import itertools from collections import defaultdict, Counter from glbase3 import glload import glbase3 from extended import bad_samples, unpublished sample_description = { "Embryo2C E1 C1": "Embryo 2C", 'Embryo4C E1 C1': 'Embryo 4C', 'Embryo8C E1 C1': 'Embryo 8C', 'B cells C...
<reponame>gwdgithubnom/gjgr #!/usr/bin/env python3 """ Alignments file functions for reading, writing and manipulating a serialized alignments file """ import logging import os from datetime import datetime import cv2 from lib import Serializer from lib.utils import rotate_landmarks logger = logging.getLogger(__na...
[ c * cos(beta), c * (cos(alpha) - cos(beta) * cos(gamma)) / sin(gamma), c * math.sqrt( sin(gamma) ** 2 - cos(alpha) ** 2 - cos(beta) ** 2 + 2 * cos(alpha) * cos(beta) * cos(gamma) ) / sin(gamma), ], ] def is_all_acute_or_obtuse(m): recp_angles = np.array(Lattice(m).reciprocal_lattice.angles) return np.all...
<reponame>Chromico/bk-base<filename>src/datamgr/metadata/metadata/backend/dgraph/backend.py # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under...
<reponame>nuhame/ml-pug from enum import Enum import math from mlpug.trainers.callbacks.callback import Callback from mlpug.mlpug_exceptions import CallbackInvalidException from mlpug.utils import has_key, get_key_paths, SlidingWindow from mlpug.evaluation import MetricEvaluatorBase import basics.base_utils as _ f...
example with lower bounds (at zero) and handling infeasible solutions: >>> import numpy as np >>> es = cma.CMAEvolutionStrategy(10 * [0.2], 0.5, ... {'bounds': [0, np.inf]}) #doctest: +ELLIPSIS (5_w,... >>> while not es.stop(): ... fit, X = [], [] ... while len(X) < es.popsize: ... curr_fit = None ... while ...