input
stringlengths
2.65k
237k
output
stringclasses
1 value
'to_windows_username' : self.user_obj.windows_username, 'column_name' : 'Is Admin', 'new_value' : 'False', } ,{ 'to_windows_username' : self.user_obj.windows_username, 'column_name' : 'Active', 'new_value' : 'True', } ,{ 'to_windows_username' : self.user_obj.windows_username, 'column_name' : 'Active', 'new_...
import os import csv import math import copy import numpy as np from annogesiclib.gff3 import Gff3Parser from annogesiclib.helper import Helper from annogesiclib.coverage_detection import coverage_comparison from annogesiclib.coverage_detection import replicate_comparison from annogesiclib.lib_reader import read_wig, r...
# Copyright 2014 Huawei Technologies Co., LTD # All Rights Reserved. # # @author: z00209472, Huawei Technologies Co., LTD # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache...
ii += 1 # write arch_catal file arch_catal_file = open(arch_catal, 'w') ii = 0 while ii < n_rows: arch_catal_file.write("%.6i %s %.6i %s %.6i %s" % (ii, ' ', mtchx[ii], ' ', mtchy[ii], "\n")) ii += 1 arch_catal_file.close() # matrix of statistics arr_cv = [] # CV array of the Groups and Total arr_med = [...
= [valid_ids[i] for i in np.random.randint(0, len(valid_ids), n)] index2 = [valid_ids[i] for i in np.random.randint(0, len(valid_ids), n)] A = pd.Series(np.random.ranf(n), index=index1) B = pd.Series(np.random.ranf(n), index=index2) pd.testing.assert_series_equal(hpat_func(A, B), test_impl(A, B), check_dtype=False,...
+ 1892 * uk_26 + 4085 * uk_27 + 9331 * uk_28 + 688 * uk_29 + 43 * uk_3 + 256 * uk_30 + 704 * uk_31 + 1520 * uk_32 + 3472 * uk_33 + 256 * uk_34 + 1936 * uk_35 + 4180 * uk_36 + 9548 * uk_37 + 704 * uk_38 + 9025 * uk_39 + 16 * uk_4 + 20615 * uk_40 + 1520 * uk_41 + 47089 * uk_42 + 3472 * uk_43 + 256 * u...
the output of get_output, OR from a filename See _read_output or _get_centroid_values for further explanation of arguments e.g. # Case 1 -- get vertex values first, then centroids p = plot_utils.get_output('my_sww.sww', minimum_allowed_height=0.01) pc=util.get_centroids(p, velocity_extrapolation=True) # Cas...
z=None, batch=None: self._prior_posterior(z=z, batch=batch)[:2] #self._recog = lambda images, z=None: self._prior_posterior(images=images, z=z, encoder=self._encoder)[:2] pass else: if encoder_type == "dense": self._encoder = DenseEncoder( "encoder", num_outputs=num_outputs, activation=tf.nn.softplus) self._deco...
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021 # by the softwar...
from ...constant.colors import * from ...object.object import * from ..object import * from .function import reforge HUB_NPCS = [ Npc('adventurer', init_dialog=[ ("I've seen it all - every island" " from here to the edge of the world!"), ("Over the years I've acquired" " a variety of Talismans and Artifacts."...
the required parameter `name` when calling `delete_storage_v1beta1_storage_class`") # verify the required parameter 'body' is set if ('body' not in params) or (params['body'] is None): raise ValueError("Missing the required parameter `body` when calling `delete_storage_v1beta1_storage_class`") collection_formats ...
not None and isinstance(model_max_length, (int, float)): init_kwargs["model_max_length"] = min(init_kwargs.get("model_max_length", int(1e30)), model_max_length) # Merge resolved_vocab_files arguments in init_kwargs. added_tokens_file = resolved_vocab_files.pop("added_tokens_file", None) for args_name, file_path in...
Service.AZURE_ENVIRONMENTS['AzureUSGovernment']['endpoint'] args.azure_storage_suffix = Service.AZURE_ENVIRONMENTS['AzureUSGovernment']['storage_suffix'] if args.azure_environment == 'china': args.azure_endpoint_base_url = Service.AZURE_ENVIRONMENTS['AzureChinaCloud']['endpoint'] args.azure_storage_suffix = Service...
<reponame>darylperalta/DTC import torch import torch.nn as nn import torch.nn.functional as F from torch.nn.parameter import Parameter from torch.optim import SGD from torch.autograd import Variable from sklearn.metrics.cluster import normalized_mutual_info_score as nmi_score from sklearn.metrics import adjusted_rand_s...
<reponame>Lucas-Mc/physionet-build<filename>physionet-django/project/models.py from datetime import datetime, timedelta import hashlib from html import unescape import os import shutil import uuid import pdb import pytz import stat import logging from distutils.version import StrictVersion import bleach import ckedito...
<reponame>ajmal017/amp import collections import datetime import inspect import logging from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Union import pandas as pd import core.dataflow.nodes.base as cdnb import core.dataflow.utils as cdu import core.finance as cfinan import core.signal_processi...
<filename>ActualApp/Wireframe/main.py from DataStorage import Authentication, Database from kivy.app import App from kivy.lang.builder import Builder from kivy.uix.screenmanager import Screen, NoTransition from kivy.uix.popup import Popup from kivy.uix.label import Label from kivy.uix.gridlayout import GridLayout...
parser=parser) tm.assert_frame_equal(res, df < 2) df3 = DataFrame(np.random.randn(*df.shape), index=df.index, columns=df.columns) res = pd.eval("df < df3", engine=engine, parser=parser) tm.assert_frame_equal(res, df < df3) @pytest.mark.parametrize("r1", lhs_index_types) @pytest.mark.parametrize("c1", index_type...
Leakage': 0.00611897, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781, 'Renaming Unit/Peak Dynamic': 4.56169, 'Renaming Unit/Runtime Dynamic': 0.228261, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime ...
"value": "aes256gcm-prfsha256", "revisions": { "v6.0.0": True, "v7.0.0": True, "v6.0.5": True, "v6.4.4": True, "v7.0.1": True, "v6.4.0": True, "v6.4.1": True, "v6.2.0": True, "v6.2.3": True, "v6.2.5": True, "v6.2.7": True, "v6.0.11": True } }, { "value": "aes256gcm-prfsha384", "revisions": { "v6.0.0"...
<gh_stars>1-10 """ Helpers for courseware tests. """ import ast import json from collections import OrderedDict from datetime import timedelta from django.contrib import messages from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user from django.test import TestCase from djang...
List by keyword page - pagesize - page - Pagination ''' if 'lbdeviceid' not in args: raise RuntimeError("Missing required argument 'lbdeviceid'") return self.request('listSrxFirewallNetworks', args) def listNetscalerLoadBalancerNetworks(self, args={}): ''' lists network that are using a netscaler load balan...
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
= "M51.2" M51_3 = "M51.3" M51_4 = "M51.4" M51_8 = "M51.8" M51_9 = "M51.9" M53 = "M53" M53_0 = "M53.0" M53_1 = "M53.1" M53_2 = "M53.2" M53_3 = "M53.3" M53_8 = "M53.8" M53_9 = "M53.9" M54 = "M54" M54_0 = "M54.0" M54_1 = "M54.1" M54_2 = "M54.2" M54_3 = "M54.3" M54_4 = "M54.4" M54_5 = "M54.5" M54_6 = "M5...
from __future__ import print_function import sys from pyc4 import c4 def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def test_sum(): assert sum([1, 2, 3]) == 6, "Should be 6" def test_encoding(): tests = [ { 'in': "", 'exp': "<KEY>" } ] for test in tests: actual = c4.Identify(test['in']) ...
name of the assignee given the assigneeID conn.request("GET", "/api/v2/users/" + request_assignee, headers=headers) res = conn.getresponse() userAssigneeId = res.read() tempUserAssignee = str(userAssigneeId.decode('utf-8')) # data = json.dumps(tempUserAssignee, indent=2) # data_dict = ast.literal_eval(data) data...
The angle theta (scalar or shape (N,)) or both angles (scalar or shape (2, N)) if phi is not given. phi : float, scalar or array-like, optionnal The angle phi (scalar or shape (N,)). lonlat : bool If True, input angles are assumed to be longitude and latitude in degree, otherwise, they are co-latitude and longitu...
False # privkey.sign("some text") <- this would raise an exception with privkey.unlock("TheCorrectPassphrase"): # privkey is now unlocked assert privkey.is_unlocked # so you can do things with it sig = privkey.sign("some text") # privkey is no longer unlocked assert privkey.is_unlocked is False Emits a :py:...
Francis University"), ("Saint Gregory's University","Saint Gregory's University"), ("Saint John Fisher College","Saint John Fisher College"), ("Saint John Vianney College Seminary","Saint John Vianney College Seminary"), ("Saint John's Seminary","Saint John's Seminary"), ("Saint Johns River State College","Saint J...
import pygame, random, sys, os, time, math import numpy as np from pygame.locals import * import _thread as thread import argparse import multiprocessing # for processing osc stream from pythonosc import dispatcher as dsp from pythonosc import osc_server from pythonosc import udp_client import urllib.request...
<reponame>arccode/factory # Copyright 2017 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # pylint: disable=line-too-long """Calibration test for light sensor (a chamber is needed). Description ----------- This is a s...
emoji_servers = settings.emojiServers() await ctx.send(box("\n".join(str(s) for s in emoji_servers))) @padinfo.command() @checks.is_owner() async def setvoicepath(self, ctx, *, path=''): """Set path to the voice direcory""" settings.setVoiceDir(path) await ctx.tick() def get_emojis(self): server_ids = [int(s...
<gh_stars>0 # Copyright 2022 MosaicML Composer authors # SPDX-License-Identifier: Apache-2.0 """The :class:`StreamingDataset` class, used for building streaming iterable datasets. """ import math import os from threading import Lock, Thread from time import sleep from typing import Any, Callable, Dict, Iterator, Opti...
: 2 }, { 'service_mode' : 'in-network', 'max_inst' : 2 }] self.verify_multi_inline_svc(si_list=si_list, create_svms=True, **self.common_args) # end test_three_stage_SC_with_ECMP @preposttest_wrapper def test_multi_inline_SVC_VN_with_external_RT(self): """ Description: Validate multi-Inline SVC with ECMP. Bug:...
<reponame>marktsuchida/Xnuplot<gh_stars>1-10 # Copyright (c) 2011 <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 us...
grid_longitude coordinates in degrees for the desired grid. Must be positive. *Parameter example:* :: grid_longitude_resolution=10 grid_latitude_grid_longitude_location: `str` or `int`, optional The location of the grid_latitude and grid_longitude coordinates in relation to their grid cells (i.e. their bound...
and separator vars, recycle the density model in the old clique and convert it to that in the new clique. """ raise NotImplementedError("Implementation depends on probabilistic modeling") def clique_density_to_separator_factor(self, separator_var_list: List[Variable], density_model, true_obs: np.ndarray) -> Cli...
args and parameters phi = self.store.phi_cp if conp else self.store.phi_cv args = {'phi': lambda x: np.array(phi, order=x, copy=True), 'kf': lambda x: np.zeros_like(self.store.fwd_rate_constants, order=x)} opts = loopy_options(order='C', lang='c') namestore = arc.NameStore(opts, rate_info, True, self.store.test_s...
import numpy as np import tensorflow as tf from t3f.tensor_train_base import TensorTrainBase from t3f.tensor_train import TensorTrain from t3f import shapes class TensorTrainBatch(TensorTrainBase): """Represents a batch of Tensor Train objects (TT-tensors or TT-matrices). t3f represents a Tensor Train object as a...
are not in the correct order or if a complete dataframe is passed as ``data``. subscales : dict, optional A dictionary with subscale names (keys) and column names or column indices (count-by-1) (values) if only specific subscales should be computed. Returns ------- :class:`~pandas.DataFrame` TICS_L score R...
<reponame>mrkevinlin/eighty<filename>appengine/lib/gevent/_sslgte279.py # Wrapper module for _ssl. Written by <NAME>. # Ported to gevent by <NAME>. """SSL wrapper for socket objects. For the documentation, refer to :mod:`ssl` module manual. This module implements cooperative SSL socket wrappers. """ from __future__ ...
t_deaths_pca_age = t_deaths_sc_pca_age + t_deaths_ns_pca_age # Healthy life-years (screened arm) lyrs_healthy_sc_nodiscount_age = (healthy_sc - (0.5 * (healthy_death_other_sc+pca_incidence_sc))) lyrs_healthy_sc_discount_age = lyrs_healthy_sc_nodiscount_age * discount_factor[:total_cycles] (s_lyrs_healthy_sc_dis...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ @author:<NAME>, <NAME> This module will concentrate all the functions related to quality measurements for the pipeline and also make some ploting for comparing those measures. """ import os import logging import pickle import numpy as np import datetime import ca...
>>> thread = api.get_segment_members_list(list_id, segment_id, async_req=True) >>> result = thread.get() :param async_req bool :param str list_id: The unique ID for the list. (required) :param str segment_id: The unique id for the segment. (required) :param list[str] fields: A comma-separated list of fields to re...
<reponame>ThanksBoomerang/graphql-core-legacy from graphql.language.ast import ( Document, Field, Name, OperationDefinition, SelectionSet, ) from graphql.language.parser import parse from graphql.language.printer import print_ast from graphql.language.visitor import ( BREAK, REMOVE, ParallelVisitor, TypeInfoVi...
<gh_stars>0 """ Test harness for fitting the competing models. """ import time import pickle import copy import os import gzip import numpy as np from collections import namedtuple from pybasicbayes.util.text import progprint_xrange # Use the Agg backend in running on a server without the DISPLAY variable if "DISPLA...
<filename>sleep_utils.py # -*- coding: utf-8 -*- """ Created on Thu Nov 21 20:19:26 2019 @author: skjerns """ from pyedflib.highlevel import * import os import gc import warnings import ospath #pip install https://github.com/skjerns/skjerns-utils import numpy as np import pyedflib #pip install https://github.com/skjer...
np.inf, 'maxiter': 40000}} # minimizer_kwargs = {'method': 'L-BFGS-B', 'args': (eqnInfoDictList, fluidMethod, errorNorm), 'bounds': boundsVelocityPressure, 'options': {'maxiter': 40000, 'maxfun': 40000}} optResult = basinhopping(computeNetworkDetail, velocityPressureInit, minimizer_kwargs=minimizer_kwargs, niter=100,...
<filename>ao/upcloud/serializers.py<gh_stars>0 from rest_framework import serializers from rest_framework import fields from ao.core import fields as ao_fields from ao.core import utils from . import settings from . import models from . import factories class SerializerMixin(object): def __init__(self, *args, **kwa...
# Copyright (C) 2019 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Tests Workflow related API calls.""" import datetime import unittest import ddt import freezegun from ggrc.models import all_models from integration.ggrc import TestCase from integration.ggrc.api_help...
<filename>models/VAE.py<gh_stars>1-10 #!/usr/bin/env python """Variational Autoencoder class @author: <NAME>, June 2017 VAE class implements a variational autoencoder """ from __future__ import print_function from __future__ import division import os import numpy as np import tensorflow as tf import sys sys.path....
################################################################### # # Copyright (c) 2014 Wi-Fi Alliance # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copi...
gds_collector_=gds_collector_) self.Errors = obj_ obj_.original_tagname_ = 'Errors' elif nodeName_ == 'InformationalMessages': obj_ = ArrayOfInformationalMessage.factory(parent_object_=self) obj_.build(child_, gds_collector_=gds_collector_) self.InformationalMessages = obj_ obj_.original_tagname_ = 'Informationa...
to create it in VPP. m_network_on_host.return_value = {'bridge_domain_id': 'fake_dom_id'} with mock.patch.object(self.vpp.vpp, 'get_bridge_bvi', return_value=None): loopback_idx = self.vpp.ensure_router_interface_on_host( port, router) self.vpp.vpp.get_ifidx_mac_address(loopback_idx) self.vpp.vpp.set_loopback_b...
<reponame>matthewfeickert/reana-client # -*- coding: utf-8 -*- # # This file is part of REANA. # Copyright (C) 2018, 2019, 2020, 2021, 2022 CERN. # # REANA is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """REANA client output related c...
""" Test suite for the productdb.datatables module """ import pytest from urllib.parse import quote from django.contrib.auth.models import User from django.urls import reverse from django.test import Client from rest_framework import status from app.productdb import models from app.productdb.models import UserProfile, ...
# There is no restriction on the value of this field. # Tuple_dn_getMoteLinks = collections.namedtuple("Tuple_dn_getMoteLinks", ['RC', 'idx', 'utilization', 'numLinks', 'frameId_1', 'slot_1', 'channelOffset_1', 'moteId_1', 'flags_1', 'frameId_2', 'slot_2', 'channelOffset_2', 'moteId_2', 'flags_2', 'frameId_3', 'sl...
for `%s`" % self.name) key = args[self.name] if len(key.shape) != self.ndim: raise InvalidArgument("Shape %s of runtime value `%s` does not match " "dimensions %s" % (key.shape, self.name, self.indices)) if key.dtype != self.dtype: warning("Data type %s of runtime value `%s` does not match the " "Function data t...
<reponame>Atomicology/isilon_sdk_python # coding: utf-8 """ FilepoolApi.py Copyright 2016 SmartBear Software Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICE...
# Create an ill-conditioned situation in which the LARS has to go # far in the path to converge, and check that LARS and coordinate # descent give the same answers # Note it used to be the case that Lars had to use the drop for good # strategy for this but this is no longer the case with the # equality_tolerance c...
from eagles.Unsupervised.utils import plot_utils as pu from eagles.Unsupervised.utils import cluster_eval_utils as ceu from eagles.Unsupervised.utils import logger_utils as lu import numpy as np import pandas as pd from IPython.display import display from sklearn.cluster import KMeans, AgglomerativeClustering, ...
"""Column definitions for GEM Tables.""" from typing import Type, Optional, List, Union from abc import abstractmethod from gemd.enumeration.base_enumeration import BaseEnumeration from citrine._serialization.serializable import Serializable from citrine._serialization.polymorphic_serializable import PolymorphicSeria...
<gh_stars>1-10 #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Jan 19 23:45:56 2018 @author: dimitricoukos """ import unittest import json import DataTreatment from DataTreatment import openJson, write class SampleData(unittest.TestCase): initial_input = { "GLNLASEer": { "N-octanoyl-DL-homoserine...
import struct import cpuid_native def cpuid(leaf): _, a, b, c, d = cpuid_native.get_cpuid(leaf) return (a, b, c, d) def cpuid_count(leaf, subleaf): _, a, b, c, d = cpuid_native.get_cpuid_count(leaf, subleaf) return (a, b, c, d) def cpu_vendor(): _, b, c, d = cpuid(0) return struct.pack("III", b, d...
""" Base Forest device class ======================== **Module name:** :mod:`pennylane_forest.device` .. currentmodule:: pennylane_forest.device This module contains a base class for constructing Forest devices for PennyLane, as well as some auxillary functions for converting PennyLane supported operations (such as ...
occurs, the output protection of the power supply disables the output. Once the output protection is reset, the power supply resumes generating a power signal. Use the Query Output State function to determine if the power supply is in an over-voltage or over-current state. """, cls, grp, '4.3.10')) self._init...
#Copyright 2014 Center for Internet Security - Computer Emergency Response Team (CIS-CERT) #This is part of the CIS Enumeration and Scanning Program (CIS-ESP) # #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 th...
<gh_stars>0 from Jumpscale import j class ZOSContainer(j.baseclasses.object_config): _SCHEMATEXT = """ @url = jumpscale.clients.zoscmd.zoscontainer.1 name** = "" (S) zos_node_instance = "" (S) #name to the instance of the ZOSNode ssh_client_instance = "" (S) #name of the ssh client instance (if already created)...
<reponame>OpenJarbas/little_questions from nltk import word_tokenize, pos_tag # begin of sentence indicators for Yes/No questions YES_NO_STARTERS = ["would", "is", "will", "does", "can", "has", "if", "could", "are", "should", "have", "has", "did"] # begin of sentence indicators for "command" questions, eg, "do this...
<gh_stars>10-100 ### A new playback engine for playing RGB based ### lampshows. ####### import re import logging import sys from procgame.game import Mode from procgame.game.advancedmode import AdvancedMode class RgbShowPlayer(AdvancedMode): def __init__(self, game, priority=3): super(RgbShowPlayer, self).__init__(...
#!/usr/bin/env python3 import csv import math import numpy as np import os import scikitplot as skplt from matplotlib import pyplot as plt, rc from random import randint from sklearn.metrics import accuracy_score, f1_score, recall_score, precision_score, roc_auc_score, roc_curve from typing import List CSV_FILE = "d...
from linepy import * from datetime import datetime from time import sleep from bs4 import BeautifulSoup from humanfriendly import format_timespan, format_size, format_number, format_length import time, random, sys, json, codecs, threading, glob, re, string, os, requests, subprocess, six, ast, pytz, urllib, urllib.parse...
import pygame import mapaController import cheater import spriteLoader as tiles import random import time import os import sys class Player: def __init__(self): self.xp = 0 self.nivel = 1 self.sprite_atual = tiles.playerDict[pygame.K_s] # 24, 35 (final em cima) # 25, 34 (final esquerda) self.p...
from copy import deepcopy from unittest.mock import Mock import pytest from opentrons.drivers.types import MoveSplit from tests.opentrons.conftest import fuzzy_assert from opentrons.config.robot_configs import ( DEFAULT_GANTRY_STEPS_PER_MM, DEFAULT_PIPETTE_CONFIGS) from opentrons.drivers import serial_communication, ...
res = es.load_data(index, type, doc, doc['doc_id']) if not res: logger.info('Fail to retrieve or load data to {}: project {}, kg_id {}, tag{}, index {}, type {}' .format(index_version, project_name, kg_id, tag_name, index, type)) return logger.info('Fail to retrieve or load data to {}: project {}, kg_id {}, tag{}...
<filename>sources/backend/mods/generate_report.py # coding: utf-8 import os import sys import time import json import atexit import datetime import tempfile import zipfile import shutil import base64 import zipimport import traceback from relatorio.templates.opendocument import Template from xml.sax.saxutils import...
= getHostname(element); if (elementDomain !== docDomain) { offending.push(element); if (offendingDomains.indexOf(elementDomain) === -1) { offendingDomains.push(elementDomain); score += 10; } } } cssFilesInHead.forEach(function (style) { checkDomain(style) }); synchJsScript.forEach(function (script) { che...
<reponame>Acidburn0zzz/CNTK<filename>contrib/Python/cntk/cntk1_ops.py # This file is auto-generated by _fetch_ops.py. from cntk.graph import ComputationNode, InputComputationNodeBase, ImageInputComputationNodeBase class Print(ComputationNode): def __init__(self, value, format='', name='Print', var_name=None): super...
"#-*-coding:utf-8-*- import requests,bs4,sys,os,subprocess import requests,sys,random,time,re,base64,json reload(sys) sys.setdefaultencoding("utf-8") from multiprocessing.pool import ThreadPool if ("linux" in sys.platform.lower()): ##### WARNA ##### P = '\033[0;97m' # Putih M = '\033[0;91m' # Merah H = '\033[0;92m...
<reponame>dutxubo/nni<filename>examples/nas/legacy/textnas/retrain.py # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import sys import os import logging import pickle import shutil import random import math import time import datetime import argparse import distutils.util import numpy as np...
%s found' % (rule_id)) except StatementError: raise RucioException('Badly formatted rule id (%s)' % (rule_id)) @transactional_session def reduce_rule(rule_id, copies, exclude_expression=None, session=None): """ Reduce the number of copies for a rule by atomically replacing the rule. :param rule_id: Rule to be r...
= User.parse(api=None, json=user_dic) user_features = UserFeatures(user, []) self.assertTrue(np.isnan(user_features[USER_FEATURES_INDEX["number_of_different_countries"]])) def test_number_of_different_countries(self): user_dic = { "id": 1, "name": "<NAME>", "screen_name": "test_account", "location": "", "ur...
<reponame>alexpilotti/sushy-tools # 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, s...
retreive description of a metric 'm' try: return cls.property(m, 'description') except: return '' @classmethod def value(cls, m): # retreive description of a metric 'm' return cls.property(m, 'value') @classmethod def print_if_exists(cls, statement, m): ''' Print a Verilog statement if metric m exists. ...
<reponame>bernardocuteri/wasp input = """ 1 2 0 0 1 3 0 0 1 4 0 0 1 5 0 0 1 6 0 0 1 7 0 0 1 8 0 0 1 9 0 0 1 10 0 0 1 11 0 0 1 12 0 0 1 13 0 0 1 14 0 0 1 15 0 0 1 16 0 0 1 17 0 0 1 18 0 0 1 19 0 0 1 20 0 0 1 21 0 0 1 22 0 0 1 23 0 0 1 24 0 0 1 25 0 0 1 26 0 0 1 27 0 0 1 28 0 0 1 29 0 0 1 30 0 0 1 31 0 0 1 32 0 0 1 33 0 ...
<gh_stars>0 """ Cisco_IOS_XR_skp_qos_oper This module contains a collection of YANG definitions for Cisco IOS\-XR skp\-qos package operational data. This module contains definitions for the following management objects\: platform\-qos\: QoS Skywarp platform operational data platform\-qos\-ea\: platform qos ea Co...
<filename>landmarkrest/util/TreeListLearner.py import re import json import sys from PageManager import PageManager from Tree import Tree import time import TreeNode import math import itertools void_tags = frozenset(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'pa...
<filename>delfin/tests/unit/drivers/hitachi/hnas/constants.py<gh_stars>1-10 # Copyright 2021 The SODA Authors. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http:...
# -*- coding: utf-8 -*- # Copyright 2015 Cray Inc. # (C) Copyright 2015,2017 Hewlett Packard Enterprise Development LP # Copyright 2016-2017 FUJITSU 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 t...
site, i.e. number of visits per time unit dur_mean : float Mean duration of a visit num_age_groups : int Number of age groups verbose : bool (optional, default: False) Verbosity level """ synthetic = (num_people is not None and num_sites is not None and mob_rate_per_type is not None and dur_mean is not None a...
<reponame>robpop/explore_engine from django.urls import reverse from rest_framework import status from rest_framework.authtoken.models import Token from rest_framework.test import APITestCase, APIClient from django.contrib.auth.models import User from account.models import Profile class AccountTests(APITestCase): de...
{'if_h': 29, 'index': {'0': {'name': 'GigabitEthernet1/0/4', 'queue_id': '0xa3', 'software_control_info': {'cache_queue_id': '0x000000a3', 'debug_name': 'GigabitEthernet1/0/4', 'defer_obj_refcnt': 0, 'max': 0, 'max_dflt': 0, 'max_qos': 0, 'min': 105000000, 'min_dflt': 0, 'min_qos': 0, 'orig_max': 0, 'orig_...
import os import tarfile import zipfile import re import requests import platform import subprocess import json import shutil import io import tempfile from default_platform import default_platform import deps_cross_checker import aws # Master table of dependency types. # A dependency definition can specify 'type' to...
light opaque walls(W) # - Q_dot_sh: total solar flux and infrared emission of heavy opaque walls # - Q_dot_sd_tot: total direct solar flux through glazing # - Q_dot_svl_tot: Solar gain due to the increase in temperature of the ventilated air cavity #INPUTS # - Lat: Latitude of the location (north positive) -90<L...
computed as described in Slide #19 of: ## http://www.cs.umd.edu/class/fall2016/cmsc723/slides/slides_02.pdf def get_features_for_label(instance,label,class_labels): num_labels = len(class_labels) num_feats = len(instance) feats = np.zeros(len(instance)*num_labels+1) assert len(feats[num_feats*label:num_feats*label+...
start + end - i]) i += 1 elif (end - start) < N - 1: """ If the resolving has to go backwards, the path is first mapped to a separate circuit and then copied back to the original circuit. """ temp = QubitCircuit(N - end + start) i = 0 while i < (N - end + start): if (N + start - end - i - i == 1 and (N -...
<reponame>haddocking/molmod-education<gh_stars>0 #!/usr/local/bin/python # ########################################################################### ########################################################################### # Simple EM of <NAME> charged or uncharges particles # <NAME>, Utrecht University # # adapte...
<reponame>xianhegithub/opt_comms import numpy as np from scipy import stats from scipy.special import comb import mkl_fft from numba import jit """ This is a set of functions that calculate the original density evolution for regular and irregular LDPC code in AWGN channel. """ def de_reg_ldpc_awgn_orig(pc_0, itermax...
<reponame>santacml/Malware-as-Video import tensorflow as tf from keras import backend as K from keras.engine import InputSpec from keras.layers import * from keras.layers import RNN from keras.engine.topology import Layer from keras.layers.recurrent import _generate_dropout_mask from keras.utils.generic_utils import ha...
<gh_stars>1-10 import numpy as np import json import os import matplotlib.pyplot as plt import seaborn as sb import shutil import pprint pp = pprint.PrettyPrinter(indent=4) # --- import config from constants import * import utils from raw_log_types import * from results import * from tasks import * from task_results i...