input
stringlengths
2.65k
237k
output
stringclasses
1 value
import os import pandas as pd import numpy as np from matplotlib import pyplot as plt import sys import seaborn as sns sns.set() sns.set_context("paper") from sklearn import metrics # get colors from https://medialab.github.io/iwanthue/ or artenatevly from http://phrogz.net/css/distinct-colors.html colors_cycle = ["...
if level is None: # all levels result = [self.getNNew(level=t_level) for t_level in range(self.topLevel+1)] return result else: # level specified return len(self.findNewIds(level=level)) def findIds(self, func, kargs): """ Returns ids for which function func applied on arguments arg retruns True. Arg...
>>> i, j = symbols('i,j', integer=True) >>> powdenest((x**x)**(i + j)) # -X-> (x**x)**i*(x**x)**j x**(x*(i + j)) But exp() will be denested by moving all non-log terms outside of the function; this may result in the collapsing of the exp to a power with a different base: >>> powdenest(exp(3*y*log(x))) x**(3*y)...
}, ], "range" : { "min" : "0", "max" : "1024" }, }, }, "access" : "readwrite", "description" : """""", }, # scalar "arpInspectLogInterval" : { "nodetype" : "scalar", "moduleName" : "ZYXEL-GS4012F-MIB", "oid" : "1.3.6.1.4.1.890.172.16.31.10.102.1.3.3", "status" : "current", "syntax" : { "type" : { "ba...
# -*- coding: utf-8 -*- import curses try: from dns import resolver except ImportError: pass from copy import deepcopy import random import json import collections from operator import itemgetter try: import requests except ImportError: pass import threading import logging from .player import info_dict_to_list from...
#! /usr/bin/env python # -*- coding: utf-8 -*- '''Tests cribbed from linkscape/processing/test/robotstxt.test.old.cc''' import unittest import reppy import logging from reppy import Utility reppy.logger.setLevel(logging.FATAL) MYNAME = 'rogerbot' class TestOldMozscape(unittest.TestCase): @staticmethod def parse(...
# -*- coding: utf-8 -*- """4_focus_random_classify_random_train_classify.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1pHaGvxPWtFJXolLP6BXSnxm-_rZpiWB5 """ from google.colab import drive drive.mount('/content/drive') import torch.nn as nn import...
<filename>CodeAnalysis/SourceMeter_Interface/SourceMeter-8.2.0-x64-linux/Python/Tools/python/logilab/common/pytest.py<gh_stars>1000+ # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:<EMAIL> # # This file is part of logilab-common. # # logilab-common is ...
# coding=utf-8 # Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor. # # 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...
from kivy.clock import Clock from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.floatlayout import FloatLayout from kivy.core.window import Window from kivy.graphics import RenderContext, Color, Rectangle, BindTexture from kivy.graphics.texture import Texture from kivy.properties import ObjectPro...
<reponame>Jonypr-code/KivyMD """ Components/TapTargetView ======================== .. seealso:: `TapTargetView, GitHub <https://github.com/KeepSafe/TapTargetView>`_ `TapTargetView, Material archive <https://material.io/archive/guidelines/growth-communications/feature-discovery.html#>`_ .. rubric:: Provide value a...
no address decoded continue out_addresses = output["scriptPubKey"]["addresses"] amount_btc = output["value"] if address in out_addresses: utxos.append(output) return utxos def create_unsigned_transaction(source_address, destinations, redeem_script, input_txs): """ Returns a hex string representing an unsigne...
<reponame>Del2909/Online-concencus-app #################################################################### # Licence: Creative Commons (see COPYRIGHT) # # Authors: <NAME>, <NAME> # # {nik0spapp, <EMAIL> # # Supervisor: <NAME> # # <EMAIL> # # University of the Aegean # # Department of Information and Communication Sys...
# encoding: utf-8 import time import pytest import ckan.model as model import ckan.tests.legacy as tests import ckan.tests.helpers as helpers from ckan.tests.legacy import TestController as ControllerTestCase class TestEmailNotifications(ControllerTestCase): @classmethod def setup_class(cls): model.repo.rebuild_...
<filename>crcbeagle/crcbeagle.py # # CRC Beagle, automatic CRC/Checksum detection for communication protocols. # # Copyright (C) <NAME>, 2021. # # See https://github.com/colinoflynn/crcbeagle for more details. # # See LICENSE file for distribution requirements. # # CRC differential technique based on Gregory Ewing # ht...
= not _ignore elif not _ignore and _l[_i] in '#%': # if we're not in a string and it's a comment break # stop before here _i += 1 _l = _l[:_i] # get the code to run # have to bundle for subprocess.run _to_exec = [_l] if _l and _l[0] not in '%#' else [] while _l and _l[:2] not...
RuntimeError as e: bad_plogp += 1 plogp = -999 print(i+1, Chem.MolToSmiles(mol, isomericSmiles=True), ' error in penalized_log') results.append((qed, plogp, smile, smile2)) f.write('{},{},{},{}\n'.format(qed, plogp, smile, smile2)) f.flush() f.close() results.sort(key=lambda tup: tup[0], reverse=True) fv = ...
- 0 bytes out - OutObject<0,0>, InRaw<4,4,0>'), ('nn::ro::detail::IRoInterface', 0, '0x28 bytes in - 8 bytes out - takes pid - OutRaw<8,8,0>, InRaw<8,8,0>, InRaw<8,8,8>, InRaw<8,8,0x10>, InRaw<8,8,0x18>, InRaw<8,8,0x20>'), ('nn::ro::detail::IRoInterface', 1, '0x10 bytes in - 0 bytes out - takes pid - InRaw<8,8,0>, In...
<filename>sympy/core/tests/test_power.py from sympy.core import ( Basic, Rational, Symbol, S, Float, Integer, Mul, Number, Pow, Expr, I, nan, pi, symbols, oo, zoo, N) from sympy.core.tests.test_evalf import NS from sympy.core.function import expand_multinomial from sympy.functions.elementary.miscellaneous import sqrt...
<filename>extra_foam/pipeline/processors/tests/test_image_roi.py """ Distributed under the terms of the BSD 3-Clause License. The full license is in the file LICENSE, distributed with this software. Author: <NAME> <<EMAIL>> Copyright (C) European X-Ray Free-Electron Laser Facility GmbH. All rights reserved. """ impor...
terminated (nEnd == -1) nEnd = max(nStart, nEnd) self.sections[i].sectionName = bytes(stringtable_str[nStart:nEnd]) ############################################### # parse program header table ''' typedef struct { uint32_t p_type; Elf32_Off p_offset; Elf32_Addr p_vaddr; Elf32_Addr p_paddr; uint32_t p_file...
# Copyright (c) 2015, Novartis Institutes for BioMedical Research Inc. # 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 # n...
<gh_stars>1-10 #!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Copyright (c) 2017 The Bitcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ This test checks activation of UAHF and the...
<reponame>Aks-Dmv/WSDDN import argparse import os import shutil import time import sys import sklearn import sklearn.metrics import torch torch.cuda.init() import torch.nn as nn import torch.nn.parallel import torch.nn.functional as F import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.o...
<filename>attacks.py from PIL import Image from torchvision import transforms import torch from models import * from torch import nn, optim from torchvision.models import resnet50 from torchvision.models.vgg import VGG import torchvision.models.densenet as densenet import torchvision.models.alexnet as alexnet from torc...
<filename>emr_mine_python_scipts/pq_tree/PQNode.py #!/usr/bin/env python # -*- coding: utf-8 -*- import sys from SiblingVector import SiblingVector pq_counter = 0 class PQNode(object): """ generated source for PQNode """ LABEL_EMPTY = 0 LABEL_PARTIAL = 1 LABEL_FULL = 2 TYPE_PNODE = 0 TYPE_QNODE = 1 label =...
''' This file contains the functions for the groupig/clustering algorithm from Watkins & Yang, J. Phys. Chem. B, vol 109, no 1, 2005 that do the actual work. THis includes (1) initial hierarchical clustering - InitialClustering (2) with that clustering as input, Bayesian Inf. Crit. based clustering into m-levels ''' ...
<gh_stars>0 from collections import namedtuple, OrderedDict from .trex_stl_packet_builder_scapy import STLPktBuilder from .trex_stl_streams import STLStream from .trex_stl_types import * from .rx_services.trex_stl_rx_service_ipv6 import * from . import trex_stl_stats from .utils.constants import FLOW_CTRL_DICT_REVE...
self.ssh_port_label_ssh_port_inputbox_frame.pack(side = "top", fill = "both", pady = 10) self.ssh_user_name_label_ssh_user_name_inputbox_frame = tk.Frame(self) self.ssh_user_name_label_ssh_user_name_inputbox_frame.config(background = "white") self.ssh_user_name_label = tk.Label(self.ssh_user_name_label_ssh_user_nam...
self.labels = ['Susceptible', 'Exposed', 'Infectious'] self.colors = ['green', 'yellow', 'red'] def __repr__(self): """ redefine the model representation """ return f"Covid_SEIS(s={self.s}, e={self.e}, i={self.i})\n(lam={self.lam}, b={self.b}, k={self.k}, a={self.a}, mu={self.mu})" def rhs(self, t, y): """ D...
= Constraint(expr= - m.b213 + m.x1074 <= 0) m.c1835 = Constraint(expr= - m.b214 + m.x1075 <= 0) m.c1836 = Constraint(expr= - m.b215 + m.x1076 <= 0) m.c1837 = Constraint(expr= - m.b216 + m.x1077 <= 0) m.c1838 = Constraint(expr= - m.b217 + m.x1078 <= 0) m.c1839 = Constraint(expr= - m.b218 + m.x1079 <= 0) m.c1840 = ...
CTACGCATCCTGTACCTTATAGACGAAATTAACGACCCTCACCTGACAATTAAAGCAATA Chicken CTCCAAATCCTCTACATAATAGACGAAATCGACGAACCTGATCTCACCCTAAAAGCCATC Human CTACGCATCCTTTACATAACAGACGAGGTCAACGATCCCTCCCTTACCATCAAATCAATT Loach CTACGAATTCTATATCTTATAGACGAGATTAATGACCCCCACCTAACAATTAAGGCCATG Mouse CTACGCATTCTATATATAATAGACGAAATCAACAACCCCGTATTAACCGT...
# coding: utf-8 # In[1]: from jove.SystemImports import * from jove.TransitionSelectors import * from jove.DotBashers import chk_consistent_pda # # Pushdown Automata (PDA) # # ## Basic Definitions # # Pushdown Automata are structures # # $(Q, Sigma, Gamma, Delta, q0, z0, F)$ # # where # # * $Q$ : Finite non-e...
__author__ = "<NAME>" __copyright__ = "Copyright 2020" __version__ = "1.0.1" __maintainer__ = "Rabaa" __email__ = "<EMAIL>" import numpy as np import sys ## Class: TestParticle # Functions: Default Constructor, DataDissection, IdentifyResonance, PrintData class TestParticle: def __init__(self): # Attributes defined...
<gh_stars>10-100 import numpy as np import torch from torch.utils.data import DataLoader, Dataset from torchvision import datasets, transforms class MaskGenerator(): """Class used to generate masks. Can be used to create masks during training or to build various masks for generation. Parameters ---------- img_s...
from datetime import datetime import hashlib from werkzeug.security import generate_password_hash, check_password_hash from itsdangerous import TimedJSONWebSignatureSerializer as Serializer from markdown import markdown import bleach from flask import current_app, request from flask.ext.login import UserMixin, Anonymou...
Entries: valid_schema_keys = ( 'name', 'private', 'required', 'type', 'values', 'min', 'max', 'regex', 'default', 'list', 'delim', 'prefix', 'map_to', 'alias_of', ) for entry in details['schemas']: # Track the map_to entries (if specified); We need to make sure that # these properly map back map_to_entries = s...
"ipSetup" : { "nodetype" : "node", "moduleName" : "ZYXEL-ES2024A-MIB", "oid" : "1.3.6.1.4.1.890.172.16.17.32.11", }, # node "dnsIpAddress" : { "nodetype" : "scalar", "moduleName" : "ZYXEL-ES2024A-MIB", "oid" : "1.3.6.1.4.1.890.172.16.17.32.11.1", "status" : "current", "syntax" : { "type" : { "module" :"SNMPv...
fileobj, B1=None, blobopprod=0.0): """ Nonmonotone Spectral Projected Gradient solver for problems of the type .. math:: \\min \\lVert AXC - B\\rVert_F^2 \\qquad s.t. X^TX = I The method is described in references :cite:`FranBaza12` and :cite:`FranBazaWebe17`, and we implement a few variations (including a m...
<reponame>dvogt/salt-check # -*- coding: utf-8 -*- ''' A module for testing the logic of states and highstates Saltcheck provides unittest like functionality requiring only the knowledge of salt module execution and yaml. In order to run state and highstate saltcheck tests a sub-folder of a state must be creaed and n...
#!/usr/bin/env python # Lint as: python3 # -*- encoding: utf-8 -*- """Tests for the flow database api.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import queue import random import time import mock from grr_response_core.lib import rdfvalue from g...
+str(currDCRBTCAsk) +" -> Sell DCR for " +str(currDCREURBid) +"€ = " +str("%.3f" % arb12_profitA)) arb12_profitB = safe_division((currDCRBTCBid*currBTCEURBid - currDCREURAsk)*100.0,currDCREURAsk) if arb12_profitB >= min_profit: print(strftime("[%H:%M] ") +"Buy DCR " +str(currDCREURAsk) +"€ -> Sell DCR " +str(currDC...
import os import torch import torch.nn.functional as F import transformers from torch import nn from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence from torch.nn.utils.rnn import pad_sequence from .util import is_module_available, get_module_or_attr from ..commons import ALLENNLP_ELMO_PRETRAINED_...
cls, method): return vmfield_get_helper(locals, "ref") def VMField_getType(locals, loader, cls, method): this = locals.get(0, "ref") clazz = this.fields.get('clazz', "ref") name = unpack_string(this.fields.get('name', "ref")) const = clazz.class_type.cls.constant_pool for i in range(clazz.class_type.cls.fields_c...
import xml.sax import rdflib from django.db import transaction from hs_core.serialization import GenericResourceMeta class RasterResourceMeta(GenericResourceMeta): """ Lightweight class for representing metadata of RasterResource instances. """ def __init__(self): super(RasterResourceMeta, self).__init__() s...
import numpy as np import random from scipy.stats import skew as scipy_skew from skimage.transform import resize as skimage_resize from QFlow import config ## set of functions for loading and preparing a dataset for training. def get_num_min_class(labels): ''' Get the number of the minimum represented class in labe...
# stdlib import json import re import traceback from typing import Any, Dict, Optional # libs import netaddr # local from bin import RouterMixin, utils import settings ADDRESS_NAME_SUB_PATTERN = re.compile(r'[\.\/:]') class RouterScrub(RouterMixin): def run(self): self.run_router() def prompt(self): print() u...
<filename>calibration/configured_suites.py<gh_stars>10-100 ########################################################################## # # Configure different suites here # ########################################################################## # A suite is an assemblage of variables to plot in one or more sub-plots...
# -*- coding: utf-8 -*- """ Created on Fri Jan 22 06:55:02 2021 @author: david """ import os import pickle import sys import matplotlib.cm import networkx as nx import pandas as pd from Patent2Net.P2N_Config import LoadConfig from Patent2Net.P2N_Lib import LoadBiblioFile, UrlPatent, UrlApplicantBuild, UrlInventorBu...
RD, IMMEDIATE], [RD, RS, IMMEDIATE]) self.fit('ADDU', [[OPCODE, 0], RS, RT, RD, 5, [OPCODE, 33]], [RD, RS, RT]) self.fit('AND', [[OPCODE, 0], RS, RT, RD, 5, [OPCODE, 36]], [RD, RS, RT]) self.fit('ANDI', [[OPCODE, 12], RS, RD, IMMEDIATE], [RD, RS, IMMEDIATE]) self.fit('DADD', [[OPCODE, 0], RS, RT, RD, 5, [OPCODE...
# 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 to in writing, softw...
complete to the local file system https://api.qualtrics.com/docs/get-response-export-file :param responseExportId: The ID given to you after running your Response Export call or URL return by GetResponseExportProgress :type responseExportId: str :param filename: where to save zip file returned by Qualtrics :type f...
shape [batch, seq_length, hidden_size]. num_attention_heads: Number of attention heads. head_size: The size per attention head. initializer: Kernel initializer. activation: Actication function. name: The name scope of this layer. Returns: float logits Tensor. """ input_shape = get_shape_list(input_tensor) hi...
after the last equality. while pointer < len(diffs): if diffs[pointer][0] == self.DIFF_EQUAL: # Equality found. if (len(diffs[pointer][1]) < self.Diff_EditCost and (post_ins or post_del)): # Candidate found. equalities.append(pointer) pre_ins = post_ins pre_del = post_del lastequality = diffs[pointer][1] else...
# coding: utf-8 """ Cloudbreak API Cloudbreak is a powerful left surf that breaks over a coral reef, a mile off southwest the island of Tavarua, Fiji. Cloudbreak is a cloud agnostic Hadoop as a Service API. Abstracts the provisioning and ease management and monitoring of on-demand clusters. SequenceIQ's Cloudbreak ...
= feed_forward(X) return np.argmax(probabilities, axis=1) predictions = predict(X_train) print("predictions = (n_inputs) = " + str(predictions.shape)) print("prediction for image 0: " + str(predictions[0])) print("correct label for image 0: " + str(Y_train[0])) ### Choose cost function and optimizer To measure how ...
"""defines a Tensor Network, which is the class that holds most of our genome information""" import copy import itertools import json import time import random import tensorflow as tf import networkx as nx from matplotlib import pyplot as plt from tensorEvolution import tensor_encoder, evo_config from tensorEvolution.n...
not in metric_kwargs: metric_kwargs[kwargs_id] = set() for metric_name in metric_list: metric_kwargs[kwargs_id].add(metric_name) deduplicated[suite_name] = list(metrics) if len(metric_kwargs) > 0: deduplicated[suite_name] = deduplicated[suite_name] + [ { "metric_kwargs_id": { metric_kwargs: list(metrics_set) ...
np.random.permutation(np.shape(x)[0]) return perm def iszero(x): x = np.array(x) return True if np.shape(x)[0] == 0 else False def get_cur_pos(cur_pos): cur_pos = np.array(cur_pos) return np.reshape(cur_pos, (-1,1)) def center_size(boxes): """ Convert prior_boxes to (cx, cy, w, h) representation for comparis...
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # acme_event_log = sa_orm_relationship( # "AcmeEventLog", # primaryjoin="AcmeChallenge.acme_event_log_id==AcmeEventLog.id", # uselist=False, # back_populates="acme_challenges", # ) acme_challenge_polls = sa_orm_relationship( "AcmeChalleng...
from sys import maxint from heapq import heappop, heappush, heapify from networkx import single_source_dijkstra_path_length, single_source_dijkstra_path, is_connected from structures import steiner_graph as sg import steiner_approximation as sa from reduction import degree, long_edges, ntdk, sdc from preselection impor...
<reponame>lockhart39/HueQualityAndIngestionApp<gh_stars>1-10 # Copyright (c) 2003-2012 LOGILAB S.A. (Paris, FRANCE). # http://www.logilab.fr/ -- mailto:<EMAIL> # # 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 Softwar...
#BEGIN_LEGAL # #Copyright (c) 2019 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
<filename>SMlib/utils/qthelpers.py<gh_stars>1-10 """Qt utilities""" import sys,os sys.path.append('..'+ os.path.sep + '..' + os.path.sep) from PyQt4.QtGui import (QAction, QStyle, QWidget, QIcon, QApplication, QLabel, QVBoxLayout, QHBoxLayout, QLineEdit, QKeyEvent, QMenu, QKeySequence, QToolButton, QPixmap,...
+ 0.49 * umath.pow(t4,-0.52) * (umath.exp(-4.544/t4))) / D # # y_I4471 = y0_I4471 / (1.0 + g_I4471) # y_I5876 = y0_I5876 / (1.0 + g_I5876) # y_I6678 = y0_I6678 / (1.0 + g_I6678) # # Magnitude = (3.0/5.0) * (y_I5876 + (1.0/3.0) * y_I4471 + (1.0/3.0) * y_I6678) # # elif methodology == 'Liu2000': # # if Parameter == ...
1318, (-1, 2): 1319, ( 1, 2): 1320, ( 2, 1): 1321, ( 2,-1): 1322, ( 1,-2): 1323, (-1,-2): 1324, (-2,-1): 1325, } MOVE_MAP_46 = { (-1, 0): 1326, (-2, 0): 1327, (-3, 0): 1328, (-4, 0): 1329, (-5, 0): 1330, (-1, 1): 1331, ( 0, 1): 1332, ( 1, 1): 1333, ( 1, 0): 1334, ( 2, 0): 1335, ( 1,-1): 1336, ( 2,-2...
# Copyright (c) 2019 Horizon Robotics. 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 la...
<gh_stars>10-100 """ Generate HTML reports """ import os import glob import pandas as _pd import logging import jinja2 import re import sys from warnings import warn from datetime import timedelta from ._version import __version__ as v from .const import * from .processed_project import get_project_outputs from .utils...
<filename>nflwin/tests/test_preprocessing.py from __future__ import print_function, division import numpy as np import pandas as pd import pytest from sklearn.utils.validation import NotFittedError from sklearn.pipeline import Pipeline from nflwin import preprocessing class TestPipelines(object): """Testing if pipe...
2.09\ 546C2.81988 2.80\ 969 1.98679 3.82\ 485 1.49482 5.01\ 257C1.00285 6.20\ 029 0.874083 7.5\ 0719 1.12489 8.7\ 6807C1.37569 10.\ 0289 1.99478 11.\ 1872 2.90382 12.\ 0962C3.81286 13.\ 0052 4.97107 13.\ 6243 6.23194 13.\ 8751C7.49282 14.\ 1259 8.79972 13.\ 9972 9.98744 13.\ 5052C11.1752 13.\ 0133 12.1903 12.\ 1801 12....
await ctx.send(Translator.translate(ctx.guild, "mkick_success", _emote="YES", users=kicked, total=len(kicked))) on_time = datetime.datetime.utcnow().strftime("%Y-%m-%d %H:%M:%S") await Logging.log_to_guild(ctx.guild.id, "memberLogChannel", Translator.translate(ctx.guild, "log_mass_kick", _emote="SHOE", on_time=on_tim...
49113: "4360 4462 4532", 49114: "4360 4462 4533", 49115: "4360 4462 4534", 49116: "4360 4462 4535", 49117: "4360 4462 4536", 49118: "4360 4462 4537", 49119: "4360 4462 4538", 49120: "4360 4462 4539", 49121: "4360 4462 4540", 49122: "4360 4462 4541", 49123: "4360 4462 4542", 49124: "4360 4462 4543", 49125: "...
<reponame>guineawheek/ftc-data-take-2 import datetime from firebase_admin import messaging from firebase_admin.exceptions import FirebaseError, InvalidArgumentError, InternalError, UnavailableError from firebase_admin.messaging import QuotaExceededError, SenderIdMismatchError, ThirdPartyAuthError, UnregisteredError imp...
<gh_stars>1-10 # -*- test-case-name: twisted.words.test.test_jabberxmlstream -*- # # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ XMPP XML Streams Building blocks for setting up XML Streams, including helping classes for doing authentication on either client or server side, and w...
<filename>DrAnalysis.py #!/usr/bin/env python # Copyright (c) 2020, Arm Limited and Contributors. # # 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...
__copyright__ = 'Copyright 2014-2016, http://radical.rutgers.edu' __license__ = 'MIT' import copy import os import pprint import stat import time import radical.utils as ru from .. import utils as rpu from .. import states as rps from .. import constants as rpc from ..db import DBSession from .resource_manager imp...
text/html. """ return pulumi.get(self, "mime_type") @mime_type.setter def mime_type(self, value: Optional[pulumi.Input[str]]): pulumi.set(self, "mime_type", value) @property @pulumi.getter(name="staticFile") def static_file(self) -> Optional[pulumi.Input[str]]: """ Static file content to be served for this ...
i, v in enumerate(sorted(vectors, key=lambda x: random())): # Randomly partition the vectors across k clusters. clusters[i % int(k)].append(v) # Cache the distance calculations between vectors (4x faster). map = DistanceMap(method=distance); distance = map.distance converged = False while not converged and iterat...
<filename>src/python/excitation_energies_fit/energies.py import numpy as np import plot class Files: # main directory where everything is stored blobs = 'assets/' data_directory = blobs + 'data/' plot_directory = blobs + 'plots/' # store the experimental data for 183Au AU_183_DATA_POSITIVE = data_directory + ...
20, 1, 5): (-1, 1), (6, 20, 2, -5): (0, 1), (6, 20, 2, -4): (0, 1), (6, 20, 2, -3): (0, 1), (6, 20, 2, -2): (0, 1), (6, 20, 2, -1): (0, 1), (6, 20, 2, 0): (-1, 1), (6, 20, 2, 1): (-1, 1), (6, 20, 2, 2): (-1, 1), (6, 20, 2, 3): (-1, 0), (6, 20, 2, 4): (-1, -1), (6, 20, 2, 5): (-1, -1), (6, 20, 3, -5): (1, 1)...
counts as being read only " "to the user who reads it."), ), ] return crispy.Fieldset( _("Chat Settings"), *fields ) @property def section_internal(self): return crispy.Fieldset( _("Internal Settings (Dimagi Only)"), hqcrispy.B3MultiField( _("Override Daily Outbound SMS Limit"), crispy.Div( InlineField(...
that takes a dataframe or a genomic region alternatively to calculate a PCA. @df_or_gene Dataframe or GenomicRegion containing d-dimensional data @columns Dataframe columns that contain the actual data @classlabel_column column that contains class labels @axis 1 if columns are instances, 0 if rows are instances @...
import numpy as np import logging import time import concurrent.futures from hytra.core.probabilitygenerator import ( IlpProbabilityGenerator, computeDivisionFeaturesOnCloud, computeRegionFeaturesOnCloud, DummyExecutor, ) from hytra.util.progressbar import ProgressBar logger = logging.getLogger(__name__) def f...
list(belief['beliefs']['requested'].values())]) ret_vec = [0] * 5 if n_requested > 4: n_requested = 4 ret_vec[n_requested] = 1. return ret_vec def convert_joint_slot_b(self, belief): """ Extracts the features for the joint vector of all the slots :param belief: The full belief state :return: The joint slot v...
''' Sub encoder that is based on the Alphanum Encoder that is part of monay.py and the Optimised Subencoder that is part of Metasploit https://github.com/rapid7/metasploit-framework/blob/master//modules/encoders/x86/opt_sub.rb https://github.com/corelan/mona ''' import argparse import binascii import sys import os ...
50) config_object = JsonObject(content={"foo": 100}) config._Configuration__verify_or_set_optional_int( config_object=config_object, field="foo", default_value=None, config_description=None, min_value=10, max_value=100, ) self.assertEqual(config_object["foo"], 100) # 2. value < min config_object = JsonObj...
<filename>sasmodels/kernelcl.py """ GPU driver for C kernels TODO: docs are out of date There should be a single GPU environment running on the system. This environment is constructed on the first call to :func:`env`, and the same environment is returned on each call. After retrieving the environment, the next step ...
) avg_training_recall_of_epoch = np.average(self.stats.training_recall) self.tb_writer.add_scalar( "Avg Epoch Classification Metrics/Train Recall", avg_training_recall_of_epoch, self.epoch_sup_current + 1 ) avg_training_f1_of_epoch = np.average(self.stats.training_f1) self.tb_writer.add_scalar("Avg Epoch Classifi...
"ciscoMgmt.10.64.2.1.1.7": {}, "ciscoMgmt.10.64.2.1.1.8": {}, "ciscoMgmt.10.64.2.1.1.9": {}, "ciscoMgmt.10.64.3.1.1.1": {}, "ciscoMgmt.10.64.3.1.1.2": {}, "ciscoMgmt.10.64.3.1.1.3": {}, "ciscoMgmt.10.64.3.1.1.4": {}, "ciscoMgmt.10.64.3.1.1.5": {}, "ciscoMgmt.10.64.3.1.1.6": {}, "ciscoMgmt.10.64.3.1.1.7": {}, ...
import nibabel as nib import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import matplotlib.pyplot as plt import os import math import struct import csv import time def gpu_usage(): print('gpu usage (current/max): {:.2f} / {:.2f} GB'.format(torch.cuda.memory_allocated()*1e-9, torch.c...
ck.out(y) ck.out('') ry=os.system(y) if tosd.get('delete_file_extra','')!='': y=tosd['delete_file_extra']+df+' '+rse if o=='con': ck.out('') ck.out(y) ck.out('') ry=os.system(y) if os.path.isfile(df): os.remove(df) elif os.path.isdir(df): shutil.rmtree(df,ignore_errors=True) # Delete global directori...
__author__ = '<NAME>' from PyQt4 import QtCore, QtGui from core.pco_definitions import PixelFly from threading import Thread import os, time, sys, pickle import pyqtgraph as pg from astropy.io import fits import numpy as np import matlab.engine from queue import Empty import pygame, os, time, pickle import w...
<filename>compyle/cuda.py """Common CUDA related functionality. """ from __future__ import print_function from pytools import Record, RecordWithoutPickling import logging from pytools.persistent_dict import KeyBuilder as KeyBuilderBase from pytools.persistent_dict import WriteOncePersistentDict from pycuda._cluda impo...
# pylint: disable=arguments-differ, unused-argument """Samplers for positive/negative/ignore sample selections. This module is used to select samples during training. Based on different strategies, we would like to choose different number of samples as positive, negative or ignore(don't care). The purpose is to allevia...
Illuminant=D65 # NOTE: this is actually the XYZ values for the illuminant above. lab_ref_white = np.array([0.95047, 1., 1.08883]) # XYZ coordinates of the illuminants, scaled to [0, 1]. For each illuminant I # we have: # # illuminant[I][0] corresponds to the XYZ coordinates for the 2 degree # field of view. # # illum...
Raw message. - **Simple** *(dict) --* The simple email message. The message consists of a subject and a message body. - **Subject** *(dict) --* **[REQUIRED]** The subject line of the email. The subject line can only contain 7-bit ASCII characters. However, you can specify non-ASCII characters in the subject line by...
<reponame>levidantzinger/hawaii_covid_forecast ######################################################### ############### ~ Import Libraries ~ #################### ######################################################### import numpy as np import pandas as pd import scipy.integrate as integrate from dd_model.model imp...
#!/usr/bin/env python # -*- coding: utf-8 -*- """QSTAR Utilities """ from __future__ import print_function from itertools import combinations, permutations import copy, sys from igraph import Graph as iGraph import numpy as np import warnings import qstag def compute_episodes(world_qsr): """ Compute QSR Episodes f...
"br/" else: pattern = "ra/" metaid = "" id_list = list(filter(None, id_list)) how_many_meta = [i for i in id_list if i.lower().startswith('meta')] if len(how_many_meta) > 1: for pos, elem in enumerate(id_list): if "meta" in elem: id_list[pos] = "" else: for pos, elem in enumerate(id_list): try: elem = Cura...
* mu.cost(1.25519718278 + 3894.18182954220 * x) L1 += 0.00000019455 * mu.cost(2.53112676345 + 4399.99435688900 * x) L1 += 0.00000015000 * mu.cost(1.03464802434 + 2288.34404351140 * x) L1 += 0.00000020029 * mu.cost(4.73119428749 + 4690.47983635860 * x) L1 += 0.00000015381 * mu.cost(2.47009470350 + 4535.05943692440 *...