input
stringlengths
2.65k
237k
output
stringclasses
1 value
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, # Define the common dependencies that contain all the actual # Chromium functionality. This list gets pulled in ...
#!/usr/bin/env python3 ''' Tools for standardized saving/loading a class or dictionary to a .hdf5 file. Strings are saved as attributes of the file; lists of strings are saved as tab delimited strings; arrays are saved as datasets. Dicts are saved as a new folder, with data saved as numpy datasets. Other objects are ...
experiment Ids taken from csv file kappaEmt = [i.split('.')[0] for i in kappaEmt] kappaFrame_Cluster_1['Experiment_id'] = kappaEmt kappaFrame_Cluster_1.set_index('Experiment_id', drop=True, inplace=True) kappaEmt = [i.split('/')[-1] for i in kappaFrame_Cluster_2.index.values] ### Renaming the experiment Ids taken ...
a bundle of transcripts, find intervals matching retained introns. A retained intron is defined as an interval from an exon/intron boundary to the next where both boundaries are in the same exon of another transcript''' intron_intervals = [GTF.toIntronIntervals(transcript) for transcript in gene] intron_interval...
<reponame>rockychen-dpaw/resource_tracking<gh_stars>0 import traceback import os import logging import requests import itertools import json from datetime import timedelta from django.utils import timezone from django.conf import settings from django.contrib.gis.db import models from django.contrib.auth.models import ...
"""Code for extracting geometry data from ETABS text files (*.E2K & *.$ET). Functions exist for pushing the data out to a GSA text file. TODO: - openings in floor diaphragms - revise default parsing so that two keys at the beginning become nested keys of nested dictionaries. Also, single key and value become a dicti...
# -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 2014 Bitcraze AB # # Crazyflie Nano Quadcopter Client # # This prog...
is None or existing_policy.window is None or (existing_policy.window.dailyMaintenanceWindow is None and existing_policy.window.recurringWindow is None)): raise util.Error(NOTHING_TO_UPDATE_ERROR_MSG) existing_policy.window.dailyMaintenanceWindow = None existing_policy.window.recurringWindow = None return self._Se...
<reponame>100kimch/ros_galapagos #!/usr/bin/env python3 # from lib_line_tracing # ! Deprecated # from lib_signal_recognition # ! Deprecated # NOTE: using rospy library unrecommended in processor.py import rospy # NOTE: python 3.5^ needed to use asyncio import asyncio from lib_frontcam import * from lib_fishcam impor...
at the moment because it is optimized for power!' # arm extension during toss if user.get_average_data('shoulder2wrist_left')[1] < (playerleft_arm.get_average_data()[1] * 0.80): arm_tip_load_left_first = 'Non-dominant arm extention throughout the toss is significantly inconsistent. Try to keep your left arm a lot st...
<filename>tools/utils/losses.py """ source code: x https://github.com/chtaal/pystoi """ import tensorflow.keras.backend as K import numpy as np import tensorflow as tf import functools from TrialsOfNeuralVocalRecon.tools.utils.OBM import OBM as oooooo import TrialsOfNeuralVocalRecon.tools.utils.pmsqe as pmsqe import...
<filename>sphinx/ext/autosummary/__init__.py # -*- coding: utf-8 -*- """ sphinx.ext.autosummary ~~~~~~~~~~~~~~~~~~~~~~ Sphinx extension that adds an autosummary:: directive, which can be used to generate function/method/attribute/etc. summary lists, similar to those output eg. by Epydoc and other API doc generati...
<filename>cltwit/main.py #!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Cltwit is a command line twitter utility Author : <NAME> Date : 2013 """ import os import sys import re import getopt import gettext import sqlite3 import webbrowser import ConfigParser from sqlite2csv import sqlite2csv from cltwitdb import c...
#!/usr/bin/env python3 # This software was developed at the National Institute of Standards # and Technology in whole or in part by employees of the Federal # Government in the course of their official duties. Pursuant to # title 17 Section 105 of the United States Code portions of this # software authored by NIST emp...
<<<<<<< HEAD #!/usr/bin/env python import inspect import re from pprint import pprint # require pip install --upgrade pandas import pandas as pd # ██╗ ██╗███████╗██████╗ ██████╗ ██████╗ ███████╗██╗████████╗██╗ ██╗ # ██║ ██║██╔════╝██╔══██╗██╔══██╗██╔═══██╗██╔════╝██║╚══██╔══╝╚██╗ ██╔╝ # ██║ ██║█████╗ ████...
import gc import os import sys import utime from uhttp_signature.authed_urequests import make_validated_request, RequestError, SignatureException from pozetron_config import * from credentials import KEY_ID, HMAC_SECRET from logger import log, exc_logline if isinstance(KEY_ID, bytes): KEY_ID = KEY_ID.decode('utf-8'...
an array or a tuple containing an array and a mask, depending on the value of ``filtered``. """ ids = origin['pore._id'][pores] return self._map(element='pore', ids=ids, filtered=filtered) def map_throats(self, throats, origin, filtered=True): r""" Given a list of throats on a target object, finds indices of ...
<gh_stars>0 from ..util import make_list from ..optimizers import LayerOptimizer from ..graphs import Link import numpy as np class Input(Link): def __init__(self, shape, name=None): self.Shape = shape # tensor shape without the minibatch dimension self.Values = None self.XGradSum = None self.Inputs = [] self.La...
from __future__ import annotations import logging import os import pytest zict = pytest.importorskip("zict") from packaging.version import parse as parse_version from dask.sizeof import sizeof from distributed.compatibility import WINDOWS from distributed.protocol import serialize_bytelist from distributed.spill i...
<filename>tests/staticfiles_tests/test_storage.py<gh_stars>1-10 import json import os import shutil import sys import tempfile import unittest from io import StringIO from pathlib import Path from unittest import mock from django.conf import settings from django.contrib.staticfiles import finders, storage from django....
= self.axial_data neck_rot_vert, neck_rot_horz = self.neck_rot truk_rot_vert, truk_rot_horz = self.trunk_rot center = self.MapVar.center lumbar = center sacrum = lumbar - FNS.vert_up(truk_rot_horz, truk_rot_vert, 10) thorax = lumbar + FNS.vert_up(truk_rot_horz, truk_rot_vert, 30) cervic = thorax + FNS.vert_up(...
vbox.Add( self._test_script_management, CC.FLAGS_EXPAND_PERPENDICULAR ) vbox.Add( self._test_arg, CC.FLAGS_EXPAND_PERPENDICULAR ) vbox.Add( self._fetch_data, CC.FLAGS_EXPAND_PERPENDICULAR ) vbox.Add( self._example_data, CC.FLAGS_EXPAND_BOTH_WAYS ) vbox.Add( self._test_parsing, CC.FLAGS_EXPAND_PERPENDICULAR ) vbox....
= [] for topic in topic_names: topic_prefix = '/rostopic_pub%s_' % topic node_names = self.master_info.node_names for n in node_names: if n.startswith(topic_prefix): nodes2stop.append(n) self.stop_nodes_by_name(nodes2stop) def _show_topic_output(self, show_hz_only, use_ssh=False, topics=[]): ''' Shows the ou...
}, { "value": 24, "color": "#6ee100" }, { "value": 28, "color": "#39a500" }, { "value": 30, "color": "#026900", "legend": { "prefix": ">" } } ], "legend": { "radix_point": 0, "scale_by": 1, "major_ticks": 10, "axes_position": [0.05, 0.5, 0.89, 0.15] } }, ], # Default style (if request does not ...
buyPointsOn='%.4f CMN'%(random.uniform(100000.0000, 200000.0000))) community.voteLeader(point, bob, leader2, 7000, providebw=bob+'/tech', keys=[bobKey,techKey]) self.accounts[bob] = 'Bob' alicePoints = community.getPointBalance(point, alice) bobPoints = community.getPointBalance(point, bob) transferPoints = alic...
load step data at tInd = {0} in file {1}'.format(tInd,get_outfile_path(options,'stats.p')) if not options.mpi: print '\n\ntInd = {0}, t = {2}, obst = {1}'.format(tInd,yt.T,t) # Read the posterior if baseData['mpi']: for (frameRef,pfile) in izip(stepData['post_pos_ref'],post_pkl_files): if not firstReadDone: pf...
<reponame>njes9701/poe-archnemesis-scanner import configparser from email.mime import image from re import I, T import sys from dataclasses import dataclass from configparser import ConfigParser import win32gui from win32clipboard import * import tkinter as tk from tkinter import messagebox from typing import Callabl...
# # Stripped version of "hookenv.py" (By <NAME>, 2020 <EMAIL>) # # # Copyright 2014-2015 Canonical Limited. # # 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/...
# Copyright The Linux Foundation and each contributor to CommunityBridge. # SPDX-License-Identifier: MIT import logging import unittest import cla from cla.controllers.github import get_org_name_from_installation_event, get_github_activity_action class TestGitHubController(unittest.TestCase): example_1 = { 'action...
-4 as might be expected - binary.gt where left=N/A and right=4 yields True - binary.gt where left=N/A and right=0 yields False The behavior is caused by grabbing the non-empty value and using it directly without performing any operation. In the case of `gt`, the non-empty value is cast to a boolean. For these rea...
from __future__ import annotations from contextlib import contextmanager import dataclasses from dataclasses import dataclass import functools import itertools import ply.lex from typing import List, Union, Tuple, Optional, Dict, Iterator, \ Callable, Any, Set, TypeVar, Generic, Iterable, Mapping, cast from typing_ex...
self.state.func_ir, axis_var) if labels != '' and axis is not None: if axis != 1: raise ValueError("only dropping columns (axis=1) supported") columns = labels else: columns_var = self._get_arg('drop', rhs.args, kws, 3, 'columns', '') err_msg = ("columns argument (constant string list) " "or labels and axis re...
# Copyright (C) 2010 Google Inc. All rights reserved. # Copyright (C) 2010 <NAME> (<EMAIL>), University of Szeged # # 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 ab...
#define the rows and cols rows = [ [7,3,1,1,7], [1,1,2,2,1,1], [1,3,1,3,1,1,3,1], [1,3,1,1,6,1,3,1], [1,3,1,5,2,1,3,1], [1,1,2,1,1], [7,1,1,1,1,1,7], [3,3], [1,2,3,1,1,3,1,1,2], [1,1,3,2,1,1], [4,1,4,2,1,2], [1,1,1,1,1,4,1,3], [2,1,1,1,2,5], [3,2,2,6,3,1], [1,9,1,1,2,1], [2,1,2,2,3,1], [3,1,1,1,1,5,1],...
<filename>radarly/publication.py """ Publications are all documents which match the query you have defined in your projects. """ from os import getcwd from os.path import abspath from reprlib import repr as trunc_repr import requests from .api import RadarlyApi from .constants import PLATFORM, TONE from .exceptions...
<gh_stars>0 # encoding: utf-8 # module renderdoc # from P:\1-Scripts\_Python\Py-Autocomplete\renderdoc.pyd # by generator 1.146 # no doc # imports import enum as __enum from .CaptureAccess import CaptureAccess class CaptureFile(CaptureAccess): """ A handle to a capture file. Used for simple cheap processing and m...
numpy if version >= (1, 18, 3): module.store_in_file_system = True def load_numpy_core_multiarray(finder: ModuleFinder, module: Module) -> None: """ The numpy.core.multiarray module is an extension module and the numpy module imports * from this module; define the list of global names available to this module i...
pairs. Each set of 2 pairs are interpreted as the control point at the end of the curve and the endpoint of the curve. The control point at the beginning of the curve is assumed to be the reflection of the control point at the end of the last curve relative to the starting point of the curve. If the previous curve...
# =========================================================================== # # ____________________ |Importation des lib/packages| ____________________ # # =========================================================================== # from tokens import Token # =======================================================...
<reponame>whywhs/Detection_and_Recognition_in_Remote_Sensing_Image # -------------------------------------------------------- # Deformable Convolutional Networks # Copyright (c) 2017 Microsoft # Licensed under The Apache-2.0 License [see LICENSE for details] # Written by <NAME> # Modified by <NAME> # ------------------...
the bit that puts in strings like py27np111 in the filename. It would be # nice to get rid of this, since the hash supercedes that functionally, but not clear # whether anyone's tools depend on this file naming right now. for s, names, places in (('py', 'python', 2), ('np', 'numpy', 2), ('pl', 'perl', 2), ('lua', '...
#!/usr/bin/env python """ Tests for the deploy module, which is used to configure and execute Overwatch scripts. .. codeauthor:: <NAME> <<EMAIL>>, Yale University """ from future.utils import iteritems import pytest import copy import os try: # For whatever reason, import StringIO from io doesn't behave nicely in ...
<filename>core/map_.py # -*- coding: utf-8 -*- # @Author: Administrator # @Date: 2019-04-24 23:48:49 # @Last Modified by: Administrator # @Last Modified time: 2019-05-29 18:41:17 """ 地图类 """ __all__ = [ "Tank2Map", ] from .const import DEBUG_MODE, COMPACT_MAP, SIDE_COUNT, TANKS_PER_SIDE, GAME_STATUS_NOT_OVER,\ G...
to database folder if copy_files: _copy_db_file(params, dbname, inpath, abs_outpath, log=True) # ------------------------------------------------------------------ # update database with key if dbname.lower() == 'telluric': # get object name if hasattr(outfile, 'get_key'): objname = outfile.get_key('KW_OBJNAME'...
boxes are zero rotated_boxes = rotated_boxes.T rotated_boxes = convert_coordinates_axis_aligned(rotated_boxes[:4].T, 0, 'centroids2minmax') b1 = convert_coordinates_axis_aligned(b1[:4], 0, 'centroids2minmax') rotated_boxes = rotated_boxes.T # get the greater xmin and ymin values. min_xy = np.maximum(rotated_box...
# coding: utf-8 """ Simulate low level RFI We are interested in the effects of RFI signals that cannot be detected in the visibility data. Therefore, in our simulations we add attenuation selected to give SNR about 1 in the unaveraged time-frequency data. This is about 180dB for a DTV station in Perth. The scenario i...
<filename>scripts/iscsictl.py #! /usr/bin/env python # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # # This program 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; either version 2 of the License, ...
h_alkyl=kwargs.get('r_h_alkyl', 1.22), cl=kwargs.get('r_cl', 1.77), na=kwargs.get('r_na', 0.95), # fe=kwargs.get('r_fe', 0.74), fe=kwargs.get('r_fe', 0.6), zn=kwargs.get('r_zn', 0.71)) def set_atom_types(self): self.atom_types_dfq = set(self.dfq.atom_type_label) self.atom_types_dft = set(self.dft.atom_type_lab...
self.timed_command(command,4,10) status, response, delta = self.timed_command(command,4,60) if status != 0: E=4 message = "QUERY_CLEAN %i: %s => %i,%s" % \ (E, command, status, response) Trace.log(e_errors.ERROR, message) return ("ERROR", E, response, "", message) else: #Get the information from the robot....
<filename>postprocessedtracer/frame.py from dataclasses import dataclass, field from typing import Tuple, Callable import numba as nb import numpy as np def _convert_type(x): if isinstance(x, np.integer): return int(x) if isinstance(x, np.floating): return float(x) if isinstance(x, bytes): return x.decode('asc...
high ## ($\lfloor \texttt{OH}_k(\mathbf{M}_{(j - 1) / 2}) / 2^{64}\rfloor$) ## 64-bit halves from `OH`'s outputs. ## The polynomial hash is parameterised on a single multiplier $f \in ## \mathbb{F}$ and evaluates to ## ## $$ ## CW_f(y) = \left(\sum_{j=0}^{d - 1} y_j \cdot f^{d - j}\right) \bmod 2^{61} - 1, ## $$ ## ## ...
12 - 12: Oo0Ooo . o0oOOo0O0Ooo - i1IIi - oO0o % IiII . I11i if 17 - 17: i1IIi % OoO0O00 + i11iIiiIii % I1Ii111 * ooOoO0o . I1ii11iIi11i if 64 - 64: O0 - iII111i if 82 - 82: O0 if 37 - 37: I1Ii111 if 98 - 98: iII111i - OoOoOO00 / I1Ii111 . OOooOOo - OOooOOo - ooOoO0o if 84 - 84: OOooOOo * ooOoO0o / O0 def lisp_get...
<reponame>flare561/berry # -*- coding: utf-8 -*- import HTMLParser import random import requests import datetime import socket import oembed import urllib2 import urllib import threading import functools import lxml.html import lxml.etree as etree from lxml import html import wikipedia as wiki import re import arrow im...
<filename>ndrive/client.py # -*- coding: utf-8 -*- """ ==================================== ndrive ==================================== What is ndrive ============== ndrive is a Naver Ndrive wrapper for python Getting started =============== git clone https://github.com/carpedm20/pyndrive.git Copyright =======...
<reponame>cgruber/make-open-easy<filename>moe/scrubber/scrubber.py #!/usr/bin/env python # Copyright 2009 Google Inc. All Rights Reserved. """Scrubber scrubs. Usage: scrubber [DIRECTORY] Args: directory: a directory to scan """ __author__ = '<EMAIL> (<NAME>)' import locale import os import re import shutil impor...
error occurred. Please check the asset configuration and|or action parameters." message = "Status Code: {0}. Data from server:\n{1}\n".format(status_code, error_text) message = message.replace('{', '{{').replace('}', '}}') return RetVal(action_result.set_status(phantom.APP_ERROR, message), None) def _process_j...
Descriptors for\n' ' another way in which attributes of a class retrieved via its\n' ' instances may differ from the objects actually stored in the\n' ' class\'s "__dict__". If no class attribute is found, and the\n' ' object\'s class has a "__getattr__()" method, that is called to\n' ' satisfy the lookup.\n'...
- 2)): for c in range(my_head["x"], width - 1): if (snake_head_test(data, c, my_head["y"] + 1)): test = (c, my_head["y"] + 1) if (test not in hazards): if ("left" not in preferred_moves_modified): preferred_moves_modified.append("left") if ("right" in possible_moves): if (my_head["y"] == 1): for c in range(0,...
repository.targets.add_verification_key(new_targets_public_key) repository.timestamp.remove_verification_key(old_timestamp_public_key) repository.timestamp.add_verification_key(new_timestamp_public_key) repository.snapshot.remove_verification_key(old_snapshot_public_key) repository.snapshot.add_verification_key(n...
, u'絞' : [u'x', u'j'] , u'䇡' : [u'z'] , u'烫' : [u't'] , u'鉬' : [u'm'] , u'啮' : [u'n'] , u'㿵' : [u'r'] , u'棻' : [u'f'] , u'詼' : [u'h'] , u'䵾' : [u'f'] , u'粈' : [u'r'] , u'茍' : [u'j'] , u'䘏' : [u'x'] , u'醖' : [u'y'] , u'甙' : [u'd'] , u'咘' : [u'b'] , u'覦' : [u'y'] , u'洩' : [u'x'] , u'䲨' : [u'h'] , u'箲' : [u'x'] , u'舷' : [...
<reponame>tillbiskup/aspecd<gh_stars>1-10 """ Plotting: Graphical representations of data extracted from datasets. Plotting relies on `matplotlib <https://matplotlib.org/>`_, and mainly its object-oriented interface should be used for the actual plotting. Each plotter contains references to the respective figure and a...
# coding: utf-8 # # Optimization Methods # # Until now, you've always used Gradient Descent to update the parameters and minimize the cost. In this notebook, you will learn more advanced optimization methods that can speed up learning and perhaps even get you to a better final value for the cost function. Having a g...
#!/usr/bin/env python3 import functools import re import subprocess import sys import packaging.version import pkg_resources import requests import urllib3 urllib3.disable_warnings() verbose = len([arg for arg in sys.argv[1:] if arg == '-v']) Packages = { 'advancecomp': { 'git': 'https://github.com/amadvance/adv...
<filename>heat/optim/dp_optimizer.py import torch import torch.distributed from torch.nn.parallel import DistributedDataParallel as tDDP from ..core.communication import MPICommunication from ..core.communication import MPI from ..core.communication import MPI_WORLD from .utils import DetectMetricPlateau from typing i...
#!/usr/bin/python # Copyright 2008,2009 <NAME> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License version 2 # as published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY ...
<reponame>crwsr124/GANsNRoses<gh_stars>0 import argparse import math import random import os from util import * import numpy as np import torch torch.backends.cudnn.benchmark = True from torch import nn, autograd from torch import optim from torch.nn import functional as F from torch.utils import data import torch.dis...
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may ...
Works for both packed and unpacked inputs. atten_idx = tf.reshape(tf.transpose(atten_idx), [-1]) input_embs += self.task_emb.EmbLookup(theta.task_emb, targets.task_ids) if p.model_dim != self._token_emb_dim: input_embs = self.emb_proj.FProp(theta.emb_proj, input_embs) input_embs = tf.transpose(input_embs, [1, 0,...
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 import json import logging import uuid from datetime import datetime from typing import ClassVar, Dict, Iterator, List, Optional, Sequence, Set, Tuple, Type, Union, cast import boto3 from botocore.exceptions imp...
which should be considered arbitrary. To retrieve a transcoded fixed-size jpeg version of the thumbnail, use :meth:`ShotgunDataRetriever.download_thumbnail` instead. This is a helper method meant to make it easy to port over synchronous legacy code - for a better solution, we recommend using the thumbnail retrieva...
639 MFn_kNurbsCircular2PtArc = 638 MFn_kCurveCurveIntersect = 636 MFn_kManipContainer = 148 MFn_kCurveFromMeshEdge = 635 MFn_kScript = 634 MFn_kDistanceManip = 633 MFn_kNumericData = 587 MFn_kSoftModManip = 632 MFn_kOffsetCosManip = 171 MFn_kDeformWaveManip = 631 MFn_kDeformSineManip = 630 MFn_kReverse = 46...
= self.GetPatchSeries() patch1, patch2, patch3, patch4 = patches = self.GetPatches(4) self.SetPatchDeps(patch1) self.SetPatchDeps(patch2, [patch1.id]) self.SetPatchDeps(patch3) self.SetPatchDeps(patch4) self.SetPatchApply(patch1).AndRaise( cros_patch.ApplyPatchException(patch1)) self.SetPatchApply(patch3) ...
+= area.sum()*0 continue bbox_gt = gt_bboxes[i] cls_score = flatten_cls_scores1[i, pos_inds, labels[pos_inds] - 1].sigmoid().detach() cls_score = cls_score[area>1.0] pos_inds = pos_inds[area > 1.0] ious = bbox_overlaps(bbox_gt[idx_gt]/2, bbox_dt, is_aligned=True) with torch.no_grad(): weighting = cls_score * i...
<reponame>mir-group/CiderPress from pyscf import scf, dft, gto, ao2mo, df, lib, cc from pyscf.dft.numint import eval_ao, eval_rho from pyscf.dft.gen_grid import Grids from pyscf.pbc.tools.pyscf_ase import atoms_from_ase import numpy as np import logging CALC_TYPES = { 'RHF' : scf.hf.RHF, 'UHF' : scf.uhf.UHF, 'RKS'...
<filename>baguette/app.py import inspect import ssl import typing from . import rendering from .config import Config from .headers import make_headers from .httpexceptions import BadRequest from .middleware import Middleware from .middlewares import DefaultHeadersMiddleware, ErrorMiddleware from .request import Reques...
software overlay method simulates the effect of hardware overlay.BLEND, specifying a hint of blend method. The blend method combines the color of the underlying pixel with the desired color producing an approximation of the transient graphics.The default value is (HARDWARE_OVERLAY, XOR, SOFTWARE_OVERLAY, BLEND)...
*, as_dict: bool, ) -> Union[List[DF], Dict[Any, DF]]: ... def partition_by( self: DF, groups: Union[str, List[str]], maintain_order: bool = True, *, as_dict: bool = False, ) -> Union[List[DF], Dict[Any, DF]]: """ Split into multiple DataFrames partitioned by groups. Parameters ---------- groups Group...
element matching each trial start if take == 'last': iall, iu = np.unique(np.flip(ind), return_index=True) t_event_nans[iall] = t_event[- (iu - ind.size + 1)] elif take == 'first': iall, iu = np.unique(ind, return_index=True) t_event_nans[iall] = t_event[iu] else: # if the index is arbitrary, needs to be numeric...
from CommonServerPython import * """ IMPORTS """ import requests import ast from datetime import datetime # disable insecure warnings requests.packages.urllib3.disable_warnings() # remove proxy if not set to true in params if not demisto.params().get("proxy"): del os.environ["HTTP_PROXY"] del os.environ["HTTPS_PRO...
heights : np.array or list heights along flowline climate_type : str either 'monthly' or 'annual', if annual floor of year is used, if monthly float year is converted into month and year Returns ------- (temp, tempformelt, prcp, prcpsol) """ y, m = floatyear_to_date(year) if self.repeat: y = self.ys + (y -...
= None v_0, h_0, v_k, h_k = self.contrastive_divergence( v, k=k, beta=betas[r], h_0=h ) res.append((v_k, h_k)) if include_negative_shift: neg_res.append((v_0, h_0)) # 3. Simulated Annealing to perform swaps ("exchange particles") for r in range(R - 1, 0, -1): a = np.exp((betas[r] - betas[r - 1]) * (self...
<filename>keras_text_summarization/library/attention.py from __future__ import division, print_function import abc from collections import OrderedDict from warnings import warn import numpy as np from keras import backend as K from keras.engine import InputSpec from keras.layers import Dense, concatenate from keras...
4, 3, 1, 1) for r in range(4, 5): self.main_tab_grid_layout_0.setRowStretch(r, 1) for c in range(3, 4): self.main_tab_grid_layout_0.setColumnStretch(c, 1) def _phase_rad_probe(): while True: val = self.phase_probe.level() try: self.set_phase_rad(val) except AttributeError: pass time.sleep(1.0 / (10)) _pha...
= RobotState() def setup_multiple_action_clients(self, action_topics, wait_duration=2.0): """ Tries to set up a MoveIt MoveGroup action client for calling it later. @param action_topics : list of tuples of Action type and topic names @param wait_duration: Defines how long to wait for the given client if it is not...
'seven teen' or 'Seven teen' or 'Seven Teen' or 'seven-teen' or 'Seven-Teen' or 'Seven-teen': correct += 1 else: wrong += 1 Cedric_Diggory["age"] = q6 q7 = input(f"{name.title()}, what is Cedric's dad's name? ") if q7 == 'Amos Diggory' or 'amos diggory' or 'Amos diggory' or 'amos Diggory': correct += 1...
from netapp.connection import NaConnection from extension_list_info import ExtensionListInfo # 1 properties from event_name import EventName # 0 properties from fpolicy_policy_get_iter_key_td import FpolicyPolicyGetIterKeyTd # 2 properties from monitored_operation_info import MonitoredOperationInfo # 1 properties from ...
""" return {self.name: getattr(obj, self.attname)} def get_attname(self): return self.name def get_attname_column(self): attname = self.get_attname() column = self.db_column or attname return attname, column def get_cache_name(self): return '_%s_cache' % self.name def get_internal_type(self): return self...
import copy import glob import os import gym import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.autograd import Variable from torch.utils.data.sampler import BatchSampler, SubsetRandomSampler from arguments import get_args from common.vec_env.s...
what user entered if doStaircase: if len(thisInfo[dlgLabelsOrdered.index('staircaseTrials')]) >0: staircaseTrials = int( thisInfo[ dlgLabelsOrdered.index('staircaseTrials') ] ) #convert string to integer print('staircaseTrials entered by user=',staircaseTrials) logging.info('staircaseTrials entered by user=',...
#!/usr/bin/env python3 import os import pandas as pd from scattertable import scattertable import numpy as np import glob import matplotlib.pyplot as plt import pandas as pd import seaborn as sns from matplotlib import markers def subtract_era(datadi, era5di, file_dict,r, model_name): ''' maxtrix hist - matrix era5...
<filename>Project_final_ver/admin/heuristics.py """ COMP30024 Artificial Intelligence, Semester 1, 2021 Project Part B: Playing the Game Team Name: Admin Team Member: <NAME> (955797) & <NAME> (693241) This module contain functions of our searching strategy to make decisions for player's next action based on eval...
<filename>SpaDecon/DEC.py from __future__ import division import os #import tensorflow as tf #tf.compat.v1.logging.set_verbosity(tf.compat.v1.logging.ERROR) from . SAE import SAE # load Stacked autoencoder from . preprocessing import change_to_continuous from time import time import numpy as np from keras.engine.topol...
if the etag you provide matches the resource's current etag value. :param obj retry_strategy: (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level. This should be one of the strategies available in the :py:mod:`~oci.retry` module. A con...
<reponame>wuyongwen/XX-Net # -*- coding: utf-8 -*- """ port from hyper/http20/stream for async remove push support increase init window size to improve performance ~~~~~~~~~~~~~~~~~~~ Objects that make up the stream-level abstraction of hyper's HTTP/2 support. Conceptually, a single HTTP/2 connection is made up of m...
<reponame>MikalaiMikalalai/ggrc-core # -*- coding: utf-8 -*- # Copyright (C) 2020 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # pylint: disable=invalid-name,too-many-lines """Tests for notifications for models with assignable mixin.""" import unittest from collections ...
from __future__ import absolute_import, division, print_function from collections import Iterable, defaultdict, deque from functools import reduce import numbers import operator import numpy as np import scipy.sparse try: # Windows compatibility int = long except NameError: pass class COO(object): """ A Sparse...
<reponame>Kelketek/evennia """ OOBHandler - Out Of Band Handler The OOBHandler.execute_cmd is called by the sessionhandler when it detects an OOB instruction (exactly how this looked depends on the protocol; at this point all oob calls should look the same) The handler pieces of functionality: function execution - ...
Asks user clarifying questions if an invalid number is provided. Returns None if user says any of the terminal answers.""" answer = await self.ask_freeform_question( recipient, question_text, require_first_device ) answer_text = answer # This checks to see if the answer is a valid candidate for float by replaci...
to kill me- 'banished'? O friar, the damned use that word in hell; Howling attends it! How hast thou the heart, Being a divine, a ghostly confessor, A sin-absolver, and my friend profess'd, To mangle me with that word 'banished'? Friar. Thou fond mad man, hear me a little speak. Rom. O, thou wilt speak again o...
2, 3]) s2 = _handle_zeros_in_scale(s1, copy=True) assert_allclose(s1, np.array([0, 1e-16, 1, 2, 3])) assert_allclose(s2, np.array([1, 1, 1, 2, 3])) def test_minmax_scaler_partial_fit(): # Test if partial_fit run over many batches of size 1 and 50 # gives the same results as fit X = X_2d n = X.shape[0] for c...