input
stringlengths
2.65k
237k
output
stringclasses
1 value
round(float(values['NUMBER_OF_UNIVERSES'])) NUMBER_OF_START_THINGS = round(float(values['NUMBER_OF_START_THINGS'])) CELL_RADIUS_AUGMENTATION = round(float(values['CELL_RADIUS_AUGMENTATION'])) SIDES_PER_NEIGHBORHOOD = round(float(values['SIDES_PER_NEIGHBORHOOD'])) NEIGHBORHOODS_INCLUDE_CORNERS = bool(values['NEI...
17994140 * uk_67 + 134056343 * uk_68 + 195236419 * uk_69 + 217 * uk_7 + 17094433 * uk_70 + 18941200 * uk_71 + 141111940 * uk_72 + 205512020 * uk_73 + 17994140 * uk_74 + 1051283953 * uk_75 + 1531064549 * uk_76 + 134056343 * uk_77 + 2229805417 * uk_78 + 195236419 * uk_79 + 19 * uk_8 + 17094433 * uk_80 + 2...
if x.name == 'name': currnode = x break nnnode = Node(currnode.child[0].name, -1) nnnode.father = self.expanded self.expanded.child.append(nnnode) nnnode.fatherlistID = len(self.state) self.expanded.expanded = True else: rules = ds.rrdict[rule] if rules == 'start -> unknown': self.unum += 1 #if rules.strip(...
'setting new offset' StoredPositionObject = ctypes.wintypes.WORD(8321) StoredPositionObjectSubindex = ctypes.c_uint8(0) StoredPositionNbBytesToWrite = ctypes.wintypes.DWORD(4) ObjectDataArray = (ctypes.c_uint32 * 1)(new_offset) ObjectData = ctypes.cast(ObjectDataArray, ctypes.POINTER(ctypes.c_uint32)) StoredPos...
if the episode has finished. if timestep.last(): self._calculate_episode_performance(timestep) return timestep def _get_agent_extra_observations(self): """Overwrite this method to give additional information to the agent.""" return {} def reset(self): timestep = super(SafetyEnvironment, self).reset() return ...
<gh_stars>1-10 EXPECTED_TICKET_CONTEXT = { 'Active': 'true', 'CreatedOn': '2019-09-05 00:42:29', 'Creator': 'test', 'ID': 'sys_id', 'Number': 'INC0000039', 'OpenedAt': '2019-09-05 00:41:01', 'OpenedBy': 'test', 'Priority': '4 - Low', 'State': '1', 'Summary': 'Trouble getting to Oregon mail server' } EXPECTED...
import json import logging from flask import Blueprint, render_template, request, flash, redirect, url_for, abort from flask_login import current_user, login_required from thewarden.node.utils import ( dojo_add_hd, dojo_auth, dojo_status, tor_request, dojo_get_settings, dojo_multiaddr, dojo_get_txs, ) from thewa...
""" U-TAE Implementation Author: <NAME> (github/VSainteuf) License: MIT """ import torch import torch.nn as nn from src.backbones.convlstm import ConvLSTM, BConvLSTM from src.backbones.ltae import LTAE2d class UTAE(nn.Module): def __init__( self, input_dim, encoder_widths=[64, 64, 64, 128], decoder_widths=[32, ...
partially full time and partially part time'] = df2['Males aged 15 years and over by work activity during the reference year - 25% sample data']-df2['Did not work']-df2['Worked'] df2.drop(['Did not work', 'Worked'], axis=1, inplace=True) df2 = df2[['LocalArea', 'Males aged 15 years and over by work activity during t...
# Main program - Version 1 # This is an example of how to use the library turboGen.py # and cmpspec.py # GENERATING 1D-2D-3D GAUSSIAN STOCHASTIC FIELD WITH A GIVEN POWER SPECTRUM AS INPUT """ Author: <NAME> Created: 14/05/2020 """ # ____ _ _ __ _ _ ____ __ ____ # ( __)( \/ ) / _\ ( \/ )( _ \( ) ( __) # ) _) ) ( / \...
''' bounds = np.asanyarray(bounds, dtype=np.float64) if len(bounds) != 2: raise ValueError('bounds must be (2, dimension!') count = np.asanyarray(count, dtype=np.int) if count.shape == (): count = np.tile(count, bounds.shape[1]) grid_elements = [np.linspace(*b, num=c) for b, c in zip(bounds.T, count)] grid = ...
<gh_stars>1-10 # This file was automatically generated by SWIG (http://www.swig.org). # Version 3.0.12 # # 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_python_version_info if _swig_python_version_info >= (2, 7, 0): ...
ret["changes"] = {"kubernetes.secret": {"new": "absent", "old": "present"}} ret["comment"] = "Secret deleted" return ret def secret_present( name, namespace="default", data=None, source=None, template=None, **kwargs ): """ Ensures that the named secret is present inside of the specified namespace with the given...
= _messages.StringField(12) options = _messages.MessageField('BuildOptions', 13) projectId = _messages.StringField(14) queueTtl = _messages.StringField(15) results = _messages.MessageField('Results', 16) secrets = _messages.MessageField('Secret', 17, repeated=True) serviceAccount = _messages.StringField(18) sour...
from functools import reduce, partial from operator import __rshift__ from typing import Mapping, Any, Union, Tuple, List from hbutils.collection import nested_map from hbutils.design import SingletonMark from hbutils.string import truncate from .base import BaseUnit, _to_unit, UnitProcessProxy, raw from .build impor...
""" Base class for authenticated API calls used by Entity, Content and Upload Manages the authentication token lifetime and namespace versions. author: <NAME> licence: Apache License 2.0 """ import configparser import hashlib import json import logging import os import re import sys import threading import time imp...
# File: bmcremedy_connector.py # # Copyright (c) 2017-2022 Splunk 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 required by ap...
# coding: utf-8 """ Sunshine Conversations API The version of the OpenAPI document: 9.4.5 Generated by: https://openapi-generator.tech """ from __future__ import absolute_import import re # noqa: F401 # python 2 and python 3 compatibility library import six from sunshine_conversations_client.api_client import...
for the first 5 is ``[1, 1, 5, 5, 1]`` and the window for the second 5 is ``[1, 5, 5, 1, 1]``. For both points, the other 5 in the window prevents the center 5 from being considered an outlier. For another example, make up some data and, with carefully chosen inputs, demonstrate how the routine runs by plotting o...
O ATOM 5 CB GLU 13.304 12.735 12.196 1.00 0.00 C ATOM 6 CG GLU 11.939 12.350 11.647 1.00 0.00 C ATOM 7 CD GLU 11.354 11.134 12.339 1.00 0.00 C ATOM 8 OE1 GLU 10.290 10.744 11.992 1.00 0.00 O ATOM 9 OE2 GLU 12.058 10.554 13.306 1.00 0.00 O ATOM 10 H GLU 14.917 13.526 9.882 1.00 0.00 H ATOM 11 HA GLU 13.309 14.719 11.647...
method ``to_deterministic()`` for an alternative and for details about what the "deterministic mode" actually does. Examples -------- >>> import imgaug.augmenters as iaa >>> aug = iaa.Solarize(0.5, threshold=(32, 128)) Invert the colors in ``50`` percent of all images for pixels with a value between ``32`` and...
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2016-2017 China Telecommunication Co., Ltd. # # 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/LICE...
IMAGE IOD': ['Image'], 'MULTI-FRAME GRAYSCALE WORD SC IMAGE IOD': ['Image'], 'X-RAY ANGIOGRAPHIC IMAGE IOD': ['Image'], 'CT IMAGE IOD': ['Image'], 'NM IMAGE IOD': ['Image'], 'CR IMAGE IOD': ['Image'], 'US MULTI-FRAME IMAGE IOD': ['Image'], 'VL WHOLE SLIDE MICROSCOPY IOD': ['Image'], 'RT DOSE IOD': ['Dose'], 'V...
<gh_stars>0 # Copyright 2020 The TensorFlow Authors. 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...
max_sum = 0 for i in range(num_bins): v = (edges[i] + edges[i + 1]) / 2 if histogram[i] > max_count: max_count = histogram[i] num_maxs = 1 max_sum = v elif histogram[i] == max_count: num_maxs += 1 max_sum += v return max_sum / num_maxs @njit(fastmath=True, cache=True) def _long_stretch(X_binary, val): las...
<reponame>joommf/joommfutils import keyword import numbers import numpy as np class Descriptor: """Descriptor base class from which all descriptors in ``ubermagutil.typesystem`` are derived. Before setting the attribute value of a decorated class is allowed, certain type and value checks are performed. If they ...
any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` is also available. The specifics of the default retry strategy are described `here <https://oracle-cloud-infrastructure-python-sdk....
from distutils.version import LooseVersion import numpy as np import pandas as pd import pytest import xarray as xr from . import ( assert_array_equal, assert_chunks_equal, assert_equal, assert_identical, raise_if_dask_computes, requires_cftime, requires_dask, ) class TestDatetimeAccessor: @pytest.fixture(...
# -*- coding: utf-8 -*- """ testerlib.controllers.form_params_controller This file was automatically generated for Stamplay by APIMATIC BETA v2.0 on 08/03/2016 """ from testerlib.controllers.base_controller import * from testerlib.models.server_response import ServerResponse class FormParamsController(BaseContr...
float ancho efectivo del elemento no rigidizado bajo compresion uniforme midC: diccionario, calculos intermedios. Raises ------ none Test ---- >>> b, midC = sec2_3_1(w= 50, t= 1 , f= 5, E = 200e3) >>> print('b: {:{fmt}} | esbeltez: {m[esbeltez]:{fmt}} | rho: {m[rho]:{fmt}}'.format(b, m= midC, fmt = '.2f')) b...
int('300600B2', 16) ROIPhysicalPropertyValue = int('300600B4', 16) ROIElementalCompositionSequence = int('300600B6', 16) ROIElementalCompositionAtomicNumber = int('300600B7', 16) ROIElementalCompositionAtomicMassFraction = int('300600B8', 16) AdditionalRTROIIdentificationCodeSequence = int('300600B9', 16) Frameof...
21) d_db = d.get_iterator(self.SPHERE_DATA) self.assertEqual(next(d_db), ("theta", "phi", "FILE", "FILE median blur")) regress = d.get_iterator(self.SOURCE_DATA, self.MEDIAN_BLUR_DATA) next(regress) for row, reg_row in zip(d_db, regress): left = os.path.join(self.SPHERE_DATA, a_grey[row[2]]) right = os.path....
ParamName_String.append('_'.join(('ParamName', self.Model_List[m].split()[3]))) ParamUnits_String.append('_'.join(('ParamUnits', self.Model_List[m].split()[3]))) VarName_String.append('_'.join(('VarName', self.Model_List[m].split()[3]))) y0_String.append('_'.join(('y0', self.Model_List[m].split()[3]))) Param_dict...
2.0, rect=(0.3, 0.3, 0.8, 0.8)) # not works with axes. savefig works. # save plt.savefig("refirgerator", bbox_inches='tight') plt.show() def split_train_test_video(meta, video_type='_1.mp4', test_size=0.3, random_state=42): # only get camera_1 data (_1.mp4) camera_1 = [(f, feat, y) for f, feat, y in meta['data']...
import unittest from unittest import mock from printy.exceptions import InvalidFlag, InvalidInputType from printy.core import Printy, WINDOWS from printy.flags import Flags class TestGlobalFlagsPrinty(unittest.TestCase): """ Test case for formatting with a global set of flags specified """ def setUp(self): self.s...
<reponame>EiffL/bayesfast<filename>bayesfast/core/recipe.py from .module import Surrogate from .density import Density, DensityLite from .sample import sample from ..modules.poly import PolyConfig, PolyModel from ..utils import Laplace, threadpool_limits, check_client from ..utils.random import check_state, resample, m...
#!/usr/bin/python2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Recipes for NativeClient toolchain packages. The real entry plumbing is in toolchain_main.py. """ import platform import sys...
The decim=%i parameter will result in a sampling ' 'frequency of %g Hz, which can cause aliasing artifacts.' % (lowpass, decim, new_sfreq)) # > 50% nyquist lim offset = int(offset) if not 0 <= offset < decim: raise ValueError('decim must be at least 0 and less than %s, got ' '%s' % (decim, offset)) return decim,...
+ ' ' s += '(' + '%d' % clinfo_data["GPUs"][gpu]["Max compute units"] + ' CU)' + ' ' s += '(' + clinfo_data["GPUs"][gpu]["Global memory size (h)"] + ')' + ' ' s += 'v' + clinfo_data["GPUs"][gpu]["Driver version"] print_progress(s) if int(clinfo_data["GPUs"][gpu]["Global memory size (Byte)"]) < warn_minimum_mem["GP...
<filename>tests/test_choice_calcs.py<gh_stars>1-10 """ Tests for the choice_calcs.py file. """ import unittest import warnings from collections import OrderedDict import numpy as np import numpy.testing as npt import pandas as pd from scipy.sparse import csr_matrix from scipy.sparse import diags from scipy.sparse impo...
def deflection_func( u, y, x, npow, axis_ratio, sersic_index, effective_radius, mass_to_light_gradient, sersic_constant, ): eta_u = np.sqrt(axis_ratio) * np.sqrt( (u * ((x ** 2) + (y ** 2 / (1 - (1 - axis_ratio ** 2) * u)))) ) return ( (((axis_ratio * eta_u) / effective_radius) ** -mass_...
# Copyright 2019 <NAME>. All rights reserved. # # The contents of this file are 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 r...
<filename>2018 Calculate Unconsented Surface Water Takes.py #A Model fo Assessing the Magnitude of Unconsented Surface Water Use in #the Canterbury Region def CalculateFinYear(Month,Year): if Month >= 7: FinYear = str(Year) + "_" + str(int(Year) + 1) else: FinYear = str(int(Year) - 1) + "_" + str(Year) return ...
Parsnips, cooked, boiled, drained, without salt 11300: ["Pea"], # Peas, edible-podded, raw 11301: [], # Peas, edible-podded, boiled, drained, without salt 11302: [], # Peas, edible-podded, frozen, unprepared 11303: [], # Peas, edible-podded, frozen, cooked, boiled, drained, without salt 11304: ["Pea", "green"], # ...
<reponame>raychorn/svn_Python-2.5.1 """numarray: The big enchilada numeric module """ import sys as _sys import types, math, os.path import operator as _operator import copy as _copy import warnings as _warnings from math import pi, e import memory import generic as _gen import _bytes import _numarray import _ufunc i...
<gh_stars>1-10 #!/usr/bin/env python3 import http.server import http.cookies import socketserver import base64 import subprocess import socket import os import json import sys import time import uuid import tempfile import importlib from urllib.parse import urlparse, parse_qs sys.path.append('lib') from amp import db...
} # Execute response = self.adminclient.post('/api/v1/registration/', json.dumps(post_data), content_type='application/json') # Check self.assertEqual(response.status_code, status.HTTP_201_CREATED) d = Registration.objects.last() self.assertEqual(d.source.name, 'test_ussd_source_adminuser') self.assertEqual(d...
#self.SEQLEADER.append(tk.BooleanVar(value=False)) #self.SEQNTIMES.append(1) self.make_plot() def contour_var(self): # ========================== ''' Calculates the long term variance of a contour field ''' if self.ncdf == 0: messagebox.showinfo(message='No Netcdf file opened yet') return ii = self.CDF_IN...
''' Superclass to extract yield data from tables and from mppnp simulations <NAME> 11/2013 Two classes: One for reading and extracting of NuGrid table data, the other one for SN1a data. ''' import matplotlib.pyplot as plt import numpy as np import os color=['r','k','b','g'] marker_type=['o','p','s','D'] l...
in name_parts: if folder_name == '': pass elif folder_name == 'Public Objects': folder_contents = self.get_folder_contents_by_guid(system_folder=TaskProc.SystemFolders.PublicObjects, type_restriction=intermediatefolder_type_restriction, sort_key=sort_key, sort_ascending=sort_ascending, ) else: found = False ...
<filename>datasets.py from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import cv2 import h5py import numpy as np import tensorflow as tf from glob import glob from tqdm import tqdm from multiprocessing import Pool from sklearn.model_sele...
'''Video Processing ===================== Provides a class that manipulates files en-masse using FFmpeg. It can compress/uncompress/merge/concatenate or perform other tasks on video files. In order to use this module, the ffmpeg binaries need to be installed in the parent directory of this module, or in $(FFMP...
fc00:e968:6179::de52:7100/64 dev eth0") dvs.servers[1].runcmd("ip -6 route del default dev eth0") dvs.servers[1].runcmd("ip -6 address del 2001::2/64 dev eth0") def test_RouteAddRemoveIpv4RouteUnresolvedNeigh(self, dvs, testlog): self.setup_db(dvs) self.clear_srv_config(dvs) # create l3 interface self.create...
<reponame>davidwych/VoterDataProject polls = { 'newsint2_baseline' : ('Interest in news and public affairs', 'Some people seem to follow what\'s going on in government and public affairs most of the time, whether there\'s an election going on or not. Others aren\'t that interested. Would you say you follow what\'s go...
# Copyright lowRISC contributors. # Licensed under the Apache License, Version 2.0, see LICENSE for details. # SPDX-License-Identifier: Apache-2.0 r"""Contains life cycle state encoding class which is used to generate new life cycle encodings. """ import logging as log import random from collections import OrderedDict ...
<reponame>AlexanderKalistratov/hpat<gh_stars>1-10 import operator from collections import namedtuple import pandas as pd import numpy as np import numba from numba import types, cgutils from numba.extending import (models, register_model, lower_cast, infer_getattr, type_callable, infer, overload, make_attribute_wrappe...
volume %(k)s should be in 'available' status " "but is in '%(v)s' status." ) % {'k': name_or_id, 'v': volume.status} raise exc.InvalidSpec(message=msg) except exc.InternalError as ex: if reason == 'create': raise exc.EResourceCreation(type='server', message=six.text_type(ex)) elif ex.code == 404: msg = _("The ...
""" StarGAN v2 Copyright (c) 2020-present NAVER Corp. This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, US...
"""PJ-Link projector driver supporting all PJ-Link compatible projectors over ethernet """ import enum import logging import sys from socket import socket, create_connection from cave.utils import merge_dicts, key_for_value from cave.drivers.projector import ProjectorInterface, ProjectorPowerState from cave.errors i...
<gh_stars>0 # encoding: utf-8 # module Rhino.Input calls itself Input # from RhinoCommon,Version=5.1.30000.16,Culture=neutral,PublicKeyToken=552281e97c755530 # by generator 1.145 """ NamespaceTracker represent a CLS namespace. """ # no imports # no functions # classes class GetBoxMode(Enum, IComparable, I...
Sample Details will become a Description"\ "\n4) Selected Documents will become TextSources"\ "\n4a) Any Document content will become a plain text file"\ "\n4b) Any Document notes will become Descriptions"\ "\n5) Codes will becoming Codes"\ "\n5a) Quotations will not be included"\ "\n5b) Any Code notes will becom...
Get random bucket data. :param buckets: The list of buckets. :param min_count: The minimum number of samples that will be sampled if no exact count is given. :param max_count: The maximum number of samples that will be sampled if no exact count is given. :param bucket_counts: For each bucket an optional exact exam...
#!/usr/bin/env python # coding: utf-8 # # Analyzing Student's Behavior and Model suggestion for classification levels # ### <NAME> # > #### This Data Science project was made under Capstone Data Science IBM Certification Program. # ## Table of contents # * [Introduction: Business Problem](#introduction) # * [Data](#d...
df = self.spark.range(3) res = df.select("id", explode(f(df.id))).collect() self.assertEqual(res[0][0], 1) self.assertEqual(res[0][1], 0) self.assertEqual(res[1][0], 2) self.assertEqual(res[1][1], 0) self.assertEqual(res[2][0], 2) self.assertEqual(res[2][1], 1) range_udf = udf(lambda value: list(range(value - ...
<reponame>kontexia/sogam<gh_stars>0 #!/usr/bin/env python # -*- encoding: utf-8 -*- from src.am_graph import AMGraph, EdgeType, Por, NodeId, NodeKey, get_node_id from src.normalise_amgraph import NormaliseAMGraph from typing import Optional, Set, Tuple import random NeuronId = NodeId """ unique identifier for a neu...
<reponame>qbox/k8s-policy<gh_stars>0 # Copyright (c) 2017 Tigera, 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
<reponame>xuptWeCloud/WeCloud<filename>file/views.py from django.http import HttpResponse, JsonResponse, FileResponse # Create your views here. from rest_framework.views import APIView from api.serializers import * from api.models import * import hashlib from rest_framework.parsers import MultiPartParser import hashlib...
#Reader for the coco panoptic data set for pointer based image segmentation import numpy as np import os import scipy.misc as misc import random import cv2 import json import threading ############################################################################################################ def rgb2id(color): # Conv...
from __future__ import print_function, absolute_import from __future__ import with_statement, nested_scopes, division, generators import os import gc import time import numpy as np import pandas as pd import obspy import scipy from obspy.core import UTCDateTime from obspy.core import AttribDict from obspy.taup import ...
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals r"""Importing this file includes common utility methods and base clases for checking quantization api and properties of resulting modules. """ import io import torch imp...
<filename>app/clients/YouTubePlaylistsHandler.py from urllib.parse import urlencode import requests import pandas as pd from typing import Dict import googleapiclient.discovery import google.oauth2.credentials from flask import session import os # ----------------------------------------------------------- # Данный к...
from django.conf import settings from django.http import HttpResponse from django.template import TemplateDoesNotExist, TemplateSyntaxError, Context, RequestContext from mako.exceptions import TopLevelLookupException, TemplateLookupException, CompileException, SyntaxException, html_error_template from mako.lookup impo...
""" xml_file.py Copyright 2006 <NAME> This file is part of w3af, http://w3af.org/ . w3af is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License. w3af is distributed in the hope that it will be...
at least one NA will be skipped completely. If the test dataset has missing values, then those predictors are omitted in the probability calculation during prediction. """ if algo == "pca": return """ Principal component analysis of an H2O data frame Principal components analysis of an H2O data frame using the ...
transitions.append(fac.Transition(st_5, [ fac.UpdateInstruction(cc_2, False) ])) st_3._set_transitionSet(transitions) transitions = [] transitions.append(fac.Transition(st_4, [ fac.UpdateInstruction(cc_3, True) ])) transitions.append(fac.Transition(st_5, [ fac.UpdateInstruction(cc_3, False) ])) st_4._set_transi...
<gh_stars>10-100 import os import time from pathlib import Path import numpy as np np.warnings.filterwarnings('ignore') import flopy import pandas as pd fm = flopy.modflow from flopy.modflow import Modflow from mfsetup.bcs import ( remove_inactive_bcs, setup_flopy_stress_period_data, setup_ghb_data, ) from mfset...
<reponame>silentsokolov/dagster<filename>python_modules/dagster/dagster/core/definitions/job_definition.py from functools import update_wrapper from typing import ( TYPE_CHECKING, AbstractSet, Any, Dict, FrozenSet, List, Mapping, Optional, Tuple, Type, Union, cast, ) import dagster._check as check from dag...
20 ) iiii1 = socket . htons ( 0x4000 ) iii1IiiiI1i1 = struct . pack ( "BBHHHBBH" , 0x45 , self . outer_tos , iiIIIIiii , 0xdfdf , iiii1 , self . outer_ttl , 17 , 0 ) iii1IiiiI1i1 += self . outer_source . pack_address ( ) iii1IiiiI1i1 += self . outer_dest . pack_address ( ) iii1IiiiI1i1 = lisp_ip_checksum ( iii1Ii...
<gh_stars>0 # pip install pytorch-lightning # pip install neptune-client # %% from __future__ import print_function from pytorch_lightning.loggers import WandbLogger from pytorch_lightning.callbacks.progress import ProgressBar from sklearn.model_selection import train_test_split import ast from pytorch_lightning.callba...
# -*- coding: utf-8 -*- from __future__ import unicode_literals """Contains the classes system_objects and single_object. Used to compute system models """ from .. import mats import os import copy from .. import solvers import object class system_objects: """system_objects class This class creates a system of...
<gh_stars>1-10 import unittest from helper import RpcWrapper, get_utxo from cfd.address import AddressUtil from cfd.key import SchnorrUtil, SigHashType, SchnorrPubkey, SignParameter from cfd.hdwallet import HDWallet from cfd.script import HashType, Script from cfd.descriptor import parse_descriptor from cfd.psbt import...
#!/usr/bin/python # Copyright 2002-2011 <NAME>. See LICENSE for licensing information. import sys # # Current Mixminion version # VERSION = '0.0.8alpha3' # System: 0==alpha, 50==beta, 98=pre, 99==release candidate, 100==release VERSION_INFO = (0,0,8,0,3) # Check the version. We need to make sure version_info exists b...
""" Get/set secret variable values from the AWS Secrets Manager """ import os import sys import select import typing import argparse import json import logging import copy import subprocess from botocore.exceptions import ClientError from dss.operations import dispatch from dss.operations.util import polite_print fro...
+= calcRelURL(toNodeURL, fromPageURL) continue mo = re.match('env:(.*)', directive) if mo: envName = mo.group(1) if envName in os.environ: xvalue += os.environ[envName] else: print "warning: the environment variable '%s' not defined" % envName continue raise DocError( "unknown directive '%s' found while expa...
import re import collections from copy import copy from numbers import Number from operator import truediv from itertools import chain, repeat, product, accumulate from typing import Any, Iterable, Dict, List, Tuple, Optional, Sequence, Hashable, Iterator, Union, Type, Callable from coba.config import CobaConfig from...
return self._raw_data def AsDict(self): return self._dict def GetPath(self): return self._path def FormatKeyValue(self, key, value): return ('%s=%s' if self._is_cros or ' ' not in value else '%s="%s"') % ( key, value) def GetValue(self, key, default=None): return self._dict.get(key, default) def AppendVa...
# Copyright (c) 2018-2019, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions ...
<reponame>NastyaArslanova/infoblox-netmri from ..broker import Broker class JobBroker(Broker): controller = "jobs" def index(self, **kwargs): """Lists the available jobs. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of the various ways to query lists, using this method...
request response body. ''' if self.initialize_body and key in self.initialize_body: return self.initialize_body[key] return None def get_threads(self): if self.threads is None: self.request_threads() return self.threads def get_thread_id(self, threadIndex=0): '''Utility function to get the first thread ID i...
<reponame>hugovk/w3lib import os import unittest from urllib.parse import urlparse import pytest from w3lib.url import ( add_or_replace_parameter, add_or_replace_parameters, any_to_uri, canonicalize_url, file_uri_to_path, is_url, parse_data_uri, parse_url, path_to_file_uri, safe_download_url, safe_url_stri...
will be appended. s_output_type : A string defining the observable type, one of the 1-qubit, 2-qubits, or global observables. Returns: result : A dictionary with the result. """ full_filename = s_output_path + f".{s_output_type}.dat" print("Loading output data file: " + full_filename) file = open(full_filename,...
= (fullname, self.scopestack.clone_top(), self._lineno) self._deferred_load_checks.append(data) else: # We're not in a FunctionDef. Deferring would give us the same # result; we do the check now to avoid the overhead of cloning the # stack. self._check_load(fullname, self.scopestack, self._lineno) def _check_lo...
# -*- encoding: utf-8 -*- # # 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 writing, softwar...
# -*- coding: utf-8 -*- """ Created on Thu Jul 25 16:29:42 2019 @author: Weike (Vicky) Sun <EMAIL>/<EMAIL> (c) 2020 <NAME>, all rights reserved """ """ Load packages and Set reproduceble results """ from sklearn.preprocessing import StandardScaler import RNN_feedback as RNN_fd import matplotlib.pyplot as...
<gh_stars>0 #%% import warnings from pathlib import Path import numpy as np import pandas as pd from scipy.stats import betabinom as sp_betabinom from metaDMG.viz import viz_utils def sort_dataframe(df): samples_ordered = list( df.groupby("sample") .sum("N_reads") .sort_values("N_reads", ascending=False) .inde...
#!/usr/bin/env python """ Contains validation functions. These functions are important to ensure that only valid values are passed to the processing functions. Validation could likely be improved by moving WTForms, which Overwatch already depends upon for CSRF protection. .. codeauthor:: <NAME> <<EMAIL>>, Yale Unive...
#2 program a car yourself # There is a self driving car Carla, # you can program it at the end of self driving car nanodegree. #3 quiz state space # class 1 = histogram filter, or monte carlo filter, # discrete state space, multimodal distribution, # exponential efficienty, approximate # class 2 = kalman fi...
ground-truth targets. Returns: x (Tensor): the result of the feature extractor proposals (list[BoxList]): during training, the subsampled proposals are returned. During testing, the predicted boxlists are returned losses (dict[Tensor]): During training, returns the losses for the head. During testing, ret...
#!/usr/bin/env python """ createSubStatsPlot.py migrated from cactusAssemblathonSubErrorPlotter.py 16 March 2011 ( 10 March 2011 ) dent earl, dearl(a) soe ucsc edu """ ############################## # Copyright (C) 2009-2011 by # <NAME> (<EMAIL>, <EMAIL>) # <NAME> (<EMAIL>, <EMAIL>) # <NAME> (<EMAIL>) # ... and other...
r, or # 2) we are putting things back after a failed transaction. # In case 1, if r has a shape_i client, we will want to # replace the shape_i of r with the shape of new_r. Say that # r is *scheduled*. # At that point, node is no longer a client of r, but of new_r for (shpnode, idx) in (r.clients + [(node, i)])...