input
stringlengths
2.65k
237k
output
stringclasses
1 value
#!/usr/bin/python # # Copyright 2021 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 agreed ...
else: raise MKLivestatusSocketError(str(e)) except Exception, e: raise MKLivestatusSocketError("Unhandled exception: %s" % e) def do_command(self, command): if self.socket == None: self.connect() if not command.endswith("\n"): command += "\n" try: self.socket.send("COMMAND " + command + "\n") except IOErr...
<reponame>REMeyer/astropy # Licensed under a 3-clause BSD style license - see PYFITS.rst import sys import warnings import pytest import numpy as np from .test_table import comparerecords from ..hdu.base import _ValidHDU from ....io import fits from ....extern.six.moves import zip from . import FitsTestCase class...
<reponame>Min-Sheng/CA_FSIS_Cell # Written by <NAME> # # Based on: # -------------------------------------------------------- # Copyright (c) 2017-present, Facebook, 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 obta...
<filename>sdk/python/pulumi_aws/dms/endpoint.py<gh_stars>0 # 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, ...
# -*- coding: utf-8 -*- from copy import deepcopy, copy from dialog_machine.project_exceptions import * from dialog_machine.interfaces import ContextStorage, DataItemInterface, ContextItem from pprint import pformat import hashlib from collections import OrderedDict def get_key(value): """ Находит hash любого объек...
# $Id: ethernet.py 65 2010-03-26 02:53:51Z dugsong $ # -*- coding: utf-8 -*- """Ethernet II, LLC (802.3+802.2), LLC/SNAP, and Novell raw 802.3, with automatic 802.1q, MPLS, PPPoE, and Cisco ISL decapsulation.""" from __future__ import print_function from __future__ import absolute_import import struct from zlib import...
session :rtype: ``osid.calendaring.Calendar`` :raise: ``OperationFailed`` -- unable to complete request :raise: ``PermissionDenied`` -- authorization failure *compliance: mandatory -- This method must be implemented.* """ return # osid.calendaring.Calendar calendar = property(fget=get_calendar) @abc.abstrac...
'ask' not in options: options.append('ask') pkgname = [] for pkg in localcatalog: # Only install if not installed locally if not localcatalog[pkg].getIfInstalled(): pkgname.append(pkg.get('name', None)) if len(pkgname) == 0: print('Sorry, no packages available to install.') return False # Rerun return ins...
async_req bool :param str id: (required) :return: ResponseContainerEvent If the method is called asynchronously, returns the request thread. """ kwargs['_return_http_data_only'] = True if kwargs.get('async_req'): return self.delete_user_event_with_http_info(id, **kwargs) # noqa: E501 else: (data) = self.delet...
essential function to be restored within a suitable time-frame.", # noqa: E501 "score": 0 }, { "answer": "You have appropriately secured backups (including data, configuration information, software, equipment, processes and key roles or knowledge). These backups will be accessible to recover from an extreme event.",...
import numpy as np import tensorflow as tf import tensorlight as light def sse(outputs, targets, name=None): """Sum of squared error (SSE) between images. Parameters ---------- outputs: Tensor [batch_size, ...] of type float32 The first tensor. targets: Tensor [batch_size, ...] of type float32 The second tenso...
np.ones(3), 2, 10, {}, progressbar=False) def execute_DONEjl(params, problem, max_eval, log): from solvers.DONEjl.wDONEjl import optimize_DONEjl rand_evals = int(params['--rand-evals']) hyperparams = {} # Number of basis functions. if params["--n-basis"] is not None: hyperparams['n_basis'] = int(params["--n-b...
) : IiiiiII1i . eid . store_prefix ( oOo [ 0 ] ) IiiiiII1i . checkpoint_entry = True IiiiiII1i . map_cache_ttl = LISP_NMR_TTL * 60 if ( ooo0oo == [ ] ) : IiiiiII1i . action = LISP_NATIVE_FORWARD_ACTION IiiiiII1i . add_cache ( ) continue if 42 - 42: i1IIi . OoO0O00 % iII111i if 57 - 57: I1ii11iIi11i / I1IiiI OO...
masc[:-2] + 'είς' forms['pl']['masc']['gen'] = masc[:-2] + 'έων' forms['pl']['masc']['voc'] = masc[:-2] + 'είς' if fem != '-': forms['sg']['fem']['nom'] = fem forms['sg']['fem']['acc'] = fem forms['sg']['fem']['gen'] = fem + 'ς' forms['sg']['fem']['voc'] = fem forms['pl']['fem']['nom'] = fem[:-1] + 'ες' forms[...
'192.168.127.12/26' set policy prefix-list plist2 rule 30 set policy prefix-list plist2 rule 30 action 'deny' set policy prefix-list plist2 rule 30 ge '25' set policy prefix-list plist2 rule 30 prefix '172.16.31.10/24' set policy prefix-list6 plist3 set policy prefix-list6 plist3 description 'Test plist3' set po...
x.requires_grad = rx y.requires_grad = ry self.assertFalse(fn.has_trace_for(x, y)) out = fn(x, y) self.assertFalse(fn.has_trace_for(x, y)) for v, name, compute in [(x, 'x', rx), (y, 'y', ry)]: if not compute: continue grad_v, = torch.autograd.grad(out, v, retain_graph=True) expected_grad = grads.setdefault(n...
<filename>oferty/models.py from django.db import models # from django.urls import reverse class OfertyNazwa(models.Model): nazwa = models.CharField(max_length=50) name_en = models.CharField(max_length=50) name_de = models.CharField(max_length=50) nazwa_poz = models.CharField(max_length=40) class Meta: managed ...
param in p]) priorSigmas = np.array([priors[param + '_sigma'] for param in p]) priors = [priorMus, priorSigmas] ##### START VALUES ##### ###randomly generated start values #...these scale factors denote how sigma values are scaled relative to the means sigmaScale = 7.0 if informedStart == -1: print 'Creating ...
import sys import hashlib as hl import math import matplotlib.pyplot as plot # debug flag debug = 1 # Global Var nextPageNum = 1 # next available page, starting from 1, 0 reserved for Super Page rowid = 0 # rowid counter indexType = 9999 global inDB_file global indexFile_file # Global Counter buckets_count = 0 reg_p...
<reponame>Seabreg/leo-editor # -*- coding: utf-8 -*- #@+leo-ver=5-thin #@+node:ekr.20031218072017.3093: * @file leoGlobals.py #@@first ''' Global constants, variables and utility functions used throughout Leo. Important: This module imports no other Leo module. ''' # pylint: disable=eval-used # pylint: disable=global-...
verifyWitnessProgram(witness_stack: list, witness_version: int, witness_program: bytes, txn: bytes, input_index: int): global WITNESS_V0_P2SH_SIZE, WITNESS_V0_P2PKH_SIZE if witness_version != 0: return False if len(witness_program) == WITNESS_V0_P2SH_SIZE: scriptPubKey = witness_stack[-1] hashScriptPubKey = hashl...
# # This file is part of LiteDRAM. # # Copyright (c) 2020 Antmicro <www.antmicro.com> # SPDX-License-Identifier: BSD-2-Clause import copy import random import unittest from collections import namedtuple from migen import * from litex.soc.interconnect import stream from litedram.common import * from litedram.phy imp...
<reponame>SamDamDing/Halo-Asset-Blender-Development-Toolset # ##### BEGIN MIT LICENSE BLOCK ##### # # MIT License # # Copyright (c) 2022 <NAME> # # 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 Softwa...
name systematically to find the later; they'll be called "ck_<LPid>" e.g., ch_1 wName = "ck_" + str(s.id) w = widgets.CheckBox(name = wName) w.label = "" #we added the existing searches first, so we know to 'check' them if count <= currentSearches: w.default = True widgetList.append(w) count=count+1 ...
body, center, frame, first, last, segid, intlen, n, polydg, cdata, btime) spkw02_c = _pyswice.spkw02_c def spkw03_c(handle, body, center, frame, first, last, segid, intlen, n, polydg, cdata, btime): return _pyswice.spkw03_c(handle, body, center, frame, first, last, segid, intlen, n, polydg, cdata, btime) spkw03_c = _...
<filename>testmanagementserver/lib/dwt_parse.py #! /usr/bin/env python3 """ Copyright (c) 2020, ETH Zurich, Computer Engineering Group 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 ...
<filename>RPG_Siberia.py # import statements import random import time import math from tkinter import * import tkinter.simpledialog as simpledialog import tkinter.messagebox as messagebox # Create a window root = Tk() w = Label(root, text="Indev") w.pack() # initialize variables HP = 10 speed = 5 XP = 0 total_XP = 0...
skills to your characters current skills. \n \tUsage: `!addskills [character name] [skill name1; skill name2; skill name3]`") return #remove unnecesary ; if value.endswith(';'): value = value[:-1] #make an array of all the different skills skillArray = value.split("; ") #get the maximum index of the skill tab...
#!/usr/bin/python ''' This is a Master Node (inherites AbstractNode) 1. Handle Websocket connection to Gateway. 2. Managing local client sockets. 3. Port "DHCP like" manager. 4. Etc... Author Name: <NAME> E-Mail: <EMAIL> ''' import os import sys import json import time import thread...
bounding-boxes. One edge case is to have two # separate raster patterns of different colours that do NOT overlap but whose # bounding-boxes DO overlap. In these cases they will both be allocated to the same # raster Operations whereas they potentially could be allocated to different Operations. # # 2. For each gro...
<gh_stars>0 from ..utils import gislib, constants, detection from ..preprocessing import clustering import numpy as np import pandas as pd import geopandas from time import gmtime, strftime from shapely.geometry import MultiPoint, Point, LineString import os import glob def travel_analysis(tdf, save_location, stop...
${output_statement}; } } // }}} %else: // {{{ allow look-behind ('prev_item' in output_statement -> complicated) // We are not allowed to branch across barriers at a granularity smaller // than the whole workgroup. Therefore, the for loop is group-global, // and there are lots of local ifs. index_type group_...
<filename>core/polyaxon/polyboard/processors/events_processors.py #!/usr/bin/python # # Copyright 2018-2020 Polyaxon, 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.apach...
<reponame>philthestone/QSDsan<gh_stars>0 # -*- coding: utf-8 -*- ''' QSDsan: Quantitative Sustainable Design for sanitation and resource recovery systems This module is developed by: <NAME> <<EMAIL>> This module is under the University of Illinois/NCSA Open Source License. Please refer to https://github.com/QSD-Grou...
#!/usr/bin/env python """ Copyright 2000 <NAME> all rights reserved, <NAME> <<EMAIL>> Permission to use, modify, and distribute this software is given under the terms of the LGPL. See http://www.fsf.org NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. $Date: 2001/12/24 20:27:13 $ <NAME> """ __version__ = ...
unpack from zip zipdir = os.path.normpath(self.script_dir + "/cssjs.zip") with zipfile.ZipFile(zipdir,"r") as zip_ref: zip_ref.extractall(os.path.normpath(target + self.project)) #now top level? if self.is_copy_playlists_to_top: self.qr.put(('STATUS', 'Copying playlists to top folder...')) for pp in playlists...
<reponame>mishahmadian/HPC_Provenance<gh_stars>0 # -*- coding: utf-8 -*- """ Read and parse the "../server.conf" file 1. Read and pars the config file 2. Validate the config file contents 3. Apply the modified changes immediately (No need to restart the agent) 4. Provide external modules with requested parameters...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # pydae documentation build configuration file, created by # sphinx-quickstart on . # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All ...
# 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 writing, software #...
<filename>ddpg_agent/agent.py import tensorflow as tf tf.logging.set_verbosity(tf.logging.ERROR) import numpy as np import copy import random import sys import json from collections import namedtuple, deque, defaultdict from sklearn.preprocessing import MinMaxScaler, StandardScaler from ddpg_agent.models import Actor...
# FinSim # Copyright 2018 <NAME>. All Rights Reserved. # NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WAR...
ResourceClientTest(unittest.TestCase): URI = "/rest/testuri" TYPE_V200 = 'typeV200' TYPE_V300 = 'typeV300' DEFAULT_VALUES = { '200': {'type': TYPE_V200}, '300': {'type': TYPE_V300} } def setUp(self): super(ResourceClientTest, self).setUp() self.host = '127.0.0.1' self.connection = connection(self.host, 30...
<gh_stars>0 # Copyright (c) 2021, <NAME> # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, ...
# SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved. # # This computer software is owned by Core SDI Inc. and is # protected by U.S. copyright laws and other laws and by international # treaties. This computer software is furnished by CORE SDI Inc. # pursuant to a written license agreement and...
in ('micro', 'macro'): raise ValueError("f_type only supports `micro` or `macro`', got {}.".format(f_type)) self.ignore_labels = ignore_labels self.f_type = f_type self.beta = beta self.beta_square = self.beta ** 2 self.only_gross = only_gross super().__init__() self._init_param_map(pred=pred, target=target, ...
# pylint: disable=C0103, C0303 from __future__ import absolute_import import numpy as np import pandas as pd from pandas import DataFrame from lxml import objectify from fitparse import FitFile try: from . import tcxtools,gpxtools from .utils import totimestamp, geo_distance except (ValueError,ImportError): # pragma:...
from array import array import sys from py.test import raises from pyvx import vx import pyvx if sys.version_info > (3,): unicode = str class TestVX(object): def test_context(self): c = vx.CreateContext() assert vx.GetStatus(vx.reference(c)) == vx.SUCCESS assert vx.QueryReference(vx.reference(c), vx.REF_ATTRIB...
_request_timeout: maximum wait time for response :return: Attachments """ # verify the required parameter 'xero_tenant_id' is set if xero_tenant_id is None: raise ValueError( "Missing the required parameter `xero_tenant_id` " "when calling `update_credit_note_attachment_by_file_name`" ) # verify the required ...
list Fields to include in the search results, empty array/list means all fields. include_vector: bool Include vectors in the search results include_count: bool Include the total count of results in the search results asc: bool Whether to sort results by ascending or descending order keep_search_history: bool W...
import numpy as np from magpylib._src.fields.special_cel import cel def el30(x, kc, p): """ incomplete elliptic integral el3 from Numerical Calculation of Elliptic Integrals and Elliptic Functions ROLAND BULIRSCH Numerische Mathematik 7, 78--90 (t965) """ # pylint: disable=too-many-branches # pylint: disable...
WITH LEARNING ROLE # Otherwise, if output_source already projects to a LearningMechanism in the current Composition, # integrate with existing sequence elif any((isinstance(p.receiver.owner, LearningMechanism) and p.receiver.owner in self.learning_components) for p in output_source.efferents): # Set learning_mech...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 天勤接口的PYTHON封装, 提供以下功能 * 连接行情和交易服务器或天勤终端的websocket扩展接口, 接收行情及交易推送数据 * 在内存中存储管理一份完整的业务数据(行情+交易), 并在接收到新数据包时更新内存数据 * 通过一批函数接口, 支持用户代码访问业务数据 * 发送交易指令 * PYTHON SDK使用文档: https://doc.shinnytech.com/pysdk/latest/ * 天勤vscode插件使用文档: https://doc.shinnytech.com/pysdk/latest/devt...
<reponame>ptrcklv/snorkel import logging import os from collections import defaultdict from typing import Any, DefaultDict, Dict, List, Optional import torch import torch.nn as nn import torch.optim as optim from tqdm import tqdm from snorkel.classification.data import DictDataLoader # noqa: F401 from snorkel.classif...
Q_targets = rewards.unsqueeze(-1) + (self.GAMMA**self.n_step * Q_targets_next * (1. - dones.unsqueeze(-1))) # Get expected Q values from local model Q_expected, taus = self.qnetwork_local(states) Q_expected = Q_expected.gather(2, actions.unsqueeze(-1).expand(1, 64, 1)) return Q_expected.mean() - (self.GAMMA**se...
dispIdMember: Identifies the member. riid: Reserved for future use. Must be IID_NULL. lcid: The locale context in which to interpret arguments. wFlags: Flags describing the context of the call. pDispParams: Pointer to a structure containing an array of arguments, an array of argument DISPIDs for named a...
---------- indict : dict dictionary of observations Returns ------- expanded : dict Dictionary, expanded to include a separate entry for each dither """ # Initialize logger logger = logging.getLogger('mirage.yaml.generate_observationlist.expand_for_dithers') expanded = {} for key in indict: expanded[key]...
4540", 52342: "4366 4451 4541", 52343: "4366 4451 4542", 52344: "4366 4451 4543", 52345: "4366 4451 4544", 52346: "4366 4451 4545", 52347: "4366 4451 4546", 52348: "4366 4452", 52349: "4366 4452 4520", 52350: "4366 4452 4521", 52351: "4366 4452 4522", 52352: "4366 4452 4523", 52353: "4366 4452 4524", 52354...
recount the whole story to Fleming Stone. With grave attention, Stone listened, and young McGuire eagerly drank in each word, as if committing a lesson to memory. Which, indeed, he was, for Stone depended on his helper to remember all facts, theories and suggestions put forward by the speakers. Long experience had ma...
by other programs @options(labels="string", vertex_labels=True, edge_labels=False, edge_color=None, edge_colors=None, edge_options=(), color_by_label=False, rankdir='down', subgraph_clusters=[], ) def graphviz_string(self, **options): r""" Return a representation in the ``dot`` language. The ``dot`` langua...
group chat and spawn a game " "with /{cmd}").format(cmd=COMMAND_NEW_GAME))] + self._next_sheet([existing_user], session, repeat=True), session) else: user = model.User(api_id=user_id, chat_id=chat_id, first_name=first_name, last_name=last_name, username=username) session.add(user) session.flush() logger.info("C...
#!/usr/bin/env python # coding:utf-8 # Copyright (c) 2018 speaktech # # This application is released under the MIT License. # http://opensource.org/licenses/mit-license.php """This application translates your articles on Qiita into English ones with googletrans, and upload them to Qiita automatically. ...
ref_idxs[1:], initializer=nms_single_class(ref_idxs[0])), lambda: tf.to_int64(ref_idxs)) n_objs = tf.shape(nms_box_idxs)[0] nms_box_idxs,_ = tf.nn.top_k(-nms_box_idxs, k=n_objs) nms_box_idxs = -nms_box_idxs objs = tf.gather(objs, nms_box_idxs) n_objs = tf.minimum(opt.max_nodes, n_objs) objs = objs[:n_objs] o...
""" Policy Neural Network trainned with PPO, KL Divergence Constraint Multi Task Learning achieved thorugh Hard Parameter Sharing NN Adapted by <NAME> (<EMAIL>) Original code: <NAME> (pat-coady.github.io) """ import numpy as np import tensorflow as tf from tensorflow.python.ops.nn_ops import leaky_relu from tensorfl...
`None` or `list` of `type` instances Alternative type specifications, which are supported by the parser. converter : `async-function` The converter function. default_flags : ``ConverterFlag`` The default flags with what the converter will be used if not defining any specific. default_type : `None` or `type` The ...
* uk_104 + 82530 * uk_105 + 2966607 * uk_106 + 136710 * uk_107 + 6300 * uk_108 + 238328 * uk_109 + 2935886 * uk_11 + 38440 * uk_110 + 92256 * uk_111 + 503564 * uk_112 + 834148 * uk_113 + 38440 * uk_114 + 6200 * uk_115 + 14880 * uk_116 + 81220 * uk_117 + 134540 * uk_118 + 6200 * uk_119 + 473530 * uk_12 ...
- Funktion\n") print("Aufruf arccos( x )") print(" oder acos( x )\n") print(" x Zahl\n") print("Rückgabe einer reellen Zahl bei x in [-1, 1]\n") print("Zusatz d=1 Dezimaldarstellung\n") return if len(number) != 1: print("agla: eine Zahl angeben") return number = number[0] if not is_zahl(number): print("...
+ "Table.allow_cell_spacing.html") # Adjusting the "cell_spacing" property will automatically enable cell spacing. table.cell_spacing = 5 self.assertTrue(table.allow_cell_spacing) #ExEnd doc = aw.Document(ARTIFACTS_DIR + "Table.allow_cell_spacing.html") table = doc.get_child(aw.NodeType.TABLE, 0, True).as_tabl...
<gh_stars>10-100 ''' file bird_model.py @author <NAME>, <NAME> @copyright Copyright © UCLouvain 2020 multiflap is a Python tool for finding periodic orbits and assess their stability via the Floquet multipliers. Copyright <2020> <Université catholique de Louvain (UCLouvain), Belgique> List of the contributors to the...
from scipy.ndimage import uniform_filter, gaussian_filter from scipy import interpolate import numpy as np from numpy_groupies import aggregate_np as aggregate import matplotlib.pyplot as plt from matplotlib import patches from mpl_toolkits.axes_grid1 import make_axes_locatable from copy import deepcopy from tqdm impo...
<gh_stars>0 from sympy.utilities.pytest import XFAIL, raises from sympy import Symbol, symbols, oo, I, pi, Float, And, Or, Not, Implies, Xor from sympy.core.relational import ( Relational, Equality, Unequality, GreaterThan, LessThan, StrictGreaterThan, StrictLessThan, Rel, Eq, Lt, Le, Gt, Ge, Ne ) x, y, z, t = symbo...
solutions. """ # Get ntimes from gain array belonging to first key in the dict ntimes = red_gains[list(red_gains.keys())[0]].shape[0] # Load data file and get redundancy information hd = hc.io.HERAData(data_file) reds = hc.redcal.get_reds(hd.antpos, pols=['ee',]) # Create calibrator and fix degeneracies Red...
import logging import datetime as dt from dateutil.parser import parse import pytz from bs4 import BeautifulSoup as bs from pyo365.utils import OutlookWellKnowFolderNames, ApiComponent, BaseAttachments, BaseAttachment, AttachableMixin, ImportanceLevel, TrackerSet log = logging.getLogger(__name__) class Recipient: ...
#!/usr/local/bin/python3 # coding: utf-8 # YYeTsBot - mongodb.py # 6/16/21 21:18 # __author__ = "Benny <<EMAIL>>" import base64 import contextlib import json import logging import os import pathlib import random import re import sys import time from datetime import date, timedelta from http import HTTPStatus from ur...
# coding: utf-8 # Copyright (c) Materials Virtual Lab # Distributed under the terms of the BSD License. from __future__ import division, print_function, unicode_literals, \ absolute_import import os import abc import io import subprocess import itertools import numpy as np from monty.tempfile import ScratchDir from...
#!/usr/bin/env python # coding: utf-8 # (ch:decisionTrees)= # # 결정트리 # **감사의 글** # # 자료를 공개한 저자 오렐리앙 제롱과 강의자료를 지원한 한빛아카데미에게 진심어린 감사를 전합니다. # **소스코드** # # 본문 내용의 일부를 파이썬으로 구현한 내용은 # [(구글코랩) 결정트리](https://colab.research.google.com/github/codingalzi/handson-ml3/blob/master/notebooks/code_decision_trees.ipynb)에서 # 확...
is ``true`` , scale in is disabled and the target tracking scaling policy doesn't remove capacity from the scalable resource. Otherwise, scale in is enabled and the target tracking scaling policy can remove capacity from the scalable resource. The default value is ``false`` . - **ScaleOutCooldown** *(integer) --* ...
<filename>PyYADL/tests/test_redis_lock.py from json import loads from unittest import TestCase from unittest.mock import patch, ANY, MagicMock from redis import WatchError from PyYADL import RedisLock, RedisWriteLock, RedisReadLock class TestRedisLock(TestCase): @patch('PyYADL.redis_lock.StrictRedis') @patch('Py...
return node = None if self.showEval or self.showBlunder: for n in self.nodelist: if n["board"] == board: start = self.textbuffer.get_iter_at_offset(n["start"]) end = self.textbuffer.get_iter_at_offset(n["end"]) node = n break if node is None: return if self.showBlunder: self.colorize_node(ply, start, end)...
('CA',) | 35055 | 89837 | 1878 | 6814 | | ('Total (Sum)',) | 12068 | 28228 | 636 | 2719 | """.strip() ) # transpose_pivot pivoted = pivot_df( df, rows=None, columns=["state", "gender"], metrics=["SUM(num)", "MAX(num)"], aggfunc="Sum", transpose_pivot=True, combine_metrics=False, show_rows_total=False, sho...
sqrt(X**2 + Z**2) pos = a.map(Transform('r+qXqZ', '', '', '', '', '')) neg = a.map(Transform('nr+qXqZ', '', '', '', '', '')) m = max(abs(a.bounds.xmin), abs(a.bounds.xmax)) return Shape((pos | neg).math, -m, a.bounds.ymin, -m, m, a.bounds.ymax, m) @preserve_color def revolve_x(a): ''' Revolve a part in the XY p...
from __future__ import absolute_import import logging import six import weakref from six.moves import queue from threading import Event from redis.exceptions import TimeoutError from time import time from msgpack import loads from treestream.exceptions import TreeReaderError from treestream.tree import Tree from tree...
<reponame>trungnt13/sisua from __future__ import absolute_import, division, print_function import inspect import os import pickle import time from collections import OrderedDict, defaultdict import numpy as np import pandas as pd import seaborn as sns from matplotlib import pyplot as plt from six import string_types ...
= dst[slug] if v is not None or not isinstance(dst.get(k[-1]), Mapping ): dst[k[-1]] = v return root def update_flat(self, val): if isinstance(val, AttrDict): val = val.flatten() for k,v in val: dst = self for slug in k[:-1]: if dst.get(slug) is None: dst[slug] = AttrDict() dst = dst[slug] if v is not No...
# 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...
import torch import numpy as np import torch.nn as nn import torch.nn.functional as F from torch import Tensor from typing import List, Tuple import math from functools import partial from einops import rearrange, reduce, repeat from torch import nn, einsum, diagonal from math import log2, ceil import pdb from utils.m...
""" CoNLL-2011/2012 scores for coreference detection. ## References - **Scoring Coreference Partitions of Predicted Mentions: A Reference Implementation.** <NAME>, <NAME>, <NAME>, <NAME>, <NAME> and <NAME>. *Proceedings of the 52nd Annual Meeting of the Association for Computational Linguistics*, Baltimore, MD, June...
flags). :return: a list of strings of input and output parameters. """ return self.input_output_parameter_names def get_input_output_and_timestamp_parameters(self): """ Get the input, output, and timestamp parameter names (including feasibility flags). :return: a list of strings of input and output parameters. ...
<reponame>batfish/pybatfish<gh_stars>100-1000 # coding=utf-8 # Copyright 2018 The Batfish Open Source Project # # 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/license...
<gh_stars>10-100 """ @author: <NAME> @since: 21/08/2016 @modified: Material from Data Structures & Algorithm analysis in Java (Weiss 3rd ed) AVL property - Binary Search Tree with a balance property Idea: keep tree shallow so we don't get the O(n) worst case for search, insert, delete like in a BST Forces max heigh...
**kwargs): pass def MPxSurfaceShape_objectGroupId_get(*args, **kwargs): pass def MPx3dModelView_setTwoSidedLighting(*args, **kwargs): pass def MPxTransform_renderLayerRenderable_get(*args, **kwargs): pass def MPxEmitterNode_swigregister(*args, **kwargs): pass def MPx3dModelView_isBackgroundFogEnabled(*ar...
grand lane casselman autumn mi plums", "4042": "large red includes santa rosa late beaut rich spring first royal jewel rose zee ace aleta burgandy july frontier fortune grand lane casselman autumn mi plums", "4043": "small yellow flesh tree ripened ready to eat peaches", "4044": "large yellow flesh tree ripened read...
instructions. The '-' denotes we go there when the # nonterminal is done parsing. nt_next_node = new_node(graph,'-',bitpos) nt_next_node.instructions.extend(graph.instructions) # carry on build the graph from the nt_next_node build_sub_graph(common, nt_next_node, bitpos, 0) return else: if vbuild(): msge("No...
<reponame>yedivanseven/CheckerPy import logging import unittest as ut from collections import defaultdict, deque, OrderedDict from ....validators.one import Limited from ....exceptions import WrongTypeError, LimitError, CallableError from ....types.one import _COMPARABLES from ....types.weak import _LIKE_COMPARABLES fr...
import re from hyde.plugin import Plugin from hyde.site import Resource import json, yaml import os import requests import urllib import uuid import sys from rdflib import ConjunctiveGraph, URIRef from pyld.jsonld import expand, to_rdf, JsonLdProcessor, set_document_loader import cromulent from cromulent import model...
from django.shortcuts import render, get_list_or_404, get_object_or_404, redirect from django.http import HttpResponse, HttpResponseRedirect from django.template import loader import regex as re import functools import datetime from itertools import chain, cycle from .models import PatientDemographic, PatientYear, Note...
<filename>data/scripts/model.py import csv import importlib import sys sys.path.append('..') import os import json import argparse import copy from enum import IntEnum from datetime import datetime import numpy as np import scipy.integrate as solve import scipy.optimize as opt import matplotlib.pylab as plt from scri...
from inspect import getfullargspec from typing import ( TYPE_CHECKING, Callable, Mapping, Optional, Sequence, Tuple, Union, Hashable ) import numpy as np import xarray as xr from scipy.optimize import leastsq, curve_fit from .utils import da_filter, gen_coord_combo, gen_sim_da from .models import fitModel ...
else: result = f"""SELECT EXTRACT(year FROM start_time) AS Year,\nCOUNT(*) AS Total_Accidents \nFROM "J.POULOS".ACCIDENT a\nWHERE """ # check if city or state if self.location_choice == "City": result += f"a.STATE_NAME = '{state}' AND a.CITY_NAME = '{city}' \n\tAND " else: result += f"a.STATE_NAME = '{state}...
in the code if 25-th is set to 'man' though; for 25-th set to 'auto', minimum and maximum are obtained from the minimum and maximum values of the data 28th onwards: Must appear in pairs of increasing d-spacing values (in Angstrom), e.g, 1.955, 2.005, 2.050, 2.127 and so on. ----- Returns: No return object ...