input stringlengths 2.65k 237k | output stringclasses 1
value |
|---|---|
= "{0} about as intelligent as a freshman in the high school of your choice; loyal, devoted, honest, and too easily screwed over by bastards like {1}.".format(target, sender)
return msg
def amber3(self):
if lt == 0 and le == 0:
msg = "Talk is cheap, whiskey costs money."
elif lt > 0 and le == 0:
msg = "Talk is c... | |
<reponame>siyuan-chen/la_forge
#!/usr/bin/env python
import os.path
import corner
import matplotlib.pyplot as plt
import numpy as np
from . import utils
__all__ = ['determine_if_limit',
'get_rn_freqs',
'get_Tspan',
'plot_rednoise_spectrum',
'plot_powerlaw',
'plot_tprocess',
'plot_free_spec',
]
secperyr = 365... | |
<filename>GUAP/generate_perturbation.py
#!/usr/bin/env python
# coding: utf-8
from __future__ import division
from __future__ import print_function
import os
import time
import argparse
import numpy as np
import math
import torch
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import... | |
"#ba3655",
"#ed6825",
"#fbb318",
"#fcfea4"
],
8: [
"#000003",
"#270b52",
"#63146e",
"#9e2963",
"#d24742",
"#f57c15",
"#fabf25",
"#fcfea4"
],
9: [
"#000003",
"#1f0c47",
"#550f6d",
"#88216a",
"#ba3655",
"#e35832",
"#f98c09",
"#f8c931",
"#fcfea4"
],
10: [
"#000003",
"#1a0b40",
"#4a0b6a",
"#78... | |
= coords.frame.get_representation_component_names()
inv_dict = {val: key for key, val in comp_dict.items()}
self.lon = getattr(coords, inv_dict["lon"])
self.lat = getattr(coords, inv_dict["lat"])
self._frame_inst = frame
self._frame.value = frame.name
return
def healpix_interp_transform(
self,
frame,
full_... | |
node : PhyloTree.Clade
Tree node. **Note** because the method operates
on the sequences on both sides of a branch, sequence reconstruction
must be performed prior to calling this method.
"""
seq_pairs, multiplicity = self.gtr.compress_sequence_pair(node.up.cseq,
node.cseq,
pattern_multiplicity = self.multiplici... | |
#!/usr/bin/python
# -*- coding=utf-8 -*-
# Project: eaglemine
# File: eaglemine.py
# Goal: The main routine of eaglemine
# Version: 1.0
# Created by @wenchieh on <12/17/2017>
#
__author__ = 'wenchieh'
# sys
import time
# third-party lib
import numpy as np
from scipy.sparse.linalg import svds
# project
from .eaglem... | |
import os
import gym
from gym.envs.registration import register
from sinergym.utils.constants import *
from sinergym.utils.rewards import *
# Set __version__ in module
version_file = os.path.join(os.path.dirname(__file__), "version.txt")
with open(version_file, "r") as file_handler:
__version__ = file_handler.read(... | |
<filename>dashboard/dashboard/graph_json.py
# Copyright 2015 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.
"""Serves JSON for a graph.
This serves the JSON in the format consumed by Flot:
https://github.com/flot/flot/bl... | |
69, 861, 21, 743, 609, 921,
484, 440, 12, 207, 900, 220, 584, 795, 568, 155, 226,
358, 216, 749, 640, 381, 958, 449, 867, 327, 376, 955,
690, 784, 588, 187, 394, 366, 592, 643, 444, 600, 855,
40, 822, 156, 851, 683, 303, 638, 818, 714, 303, 509,
353, 557, 51, 592, 663, 475, 725, 262, 508, 896, 894,
85, 815, 59, 9... | |
<reponame>AbhigyaShridhar/cc-licenses<gh_stars>10-100
# Standard library
from unittest import mock
# Third-party
import polib
from django.conf import settings
from django.test import TestCase, override_settings
from django.utils.translation import override
# First-party/Local
from legal_tools.models import (
FREEDOM... | |
local_var_params['status'])) # noqa: E501
collection_formats['status'] = 'csv' # noqa: E501
header_params = {}
form_params = []
local_var_files = {}
body_params = None
# HTTP header `Accept`
header_params['Accept'] = self.api_client.select_header_accept(
['application/xml', 'application/json']) # noqa: E501
... | |
<reponame>Rakshit2214/virtual-assistant-Python-<gh_stars>1-10
from __future__ import print_function
import numpy as np
from pydub import AudioSegment
import random
import sys
import os
from scipy.io import wavfile
print("by Logical Spot")
import tensorflow
import argparse
parser = argparse.ArgumentParser(description=... | |
<reponame>NDevTK/chromium-infra<filename>appengine/findit/model/code_coverage.py
# Copyright 2018 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.
import hashlib
from google.appengine.api import datastore_errors
from googl... | |
good job of exploiting novelty in examples without
getting too obsessed with any particular novel factor.
Roughly speaking what we want to do is give each distinct coverage target
equal amounts of time. However some coverage targets may be harder to fuzz
than others, or may only appear in a very small minority of ... | |
<gh_stars>0
#!/usr/bin/env python
# =============================================================================
# nnAvicaching_find_weights_hiddenlayer.py
# Author: <NAME> -- github: @anmolkabra
# Project: Solving the Avicaching Game Faster and Better (Summer 2017)
# -------------------------------------------------... | |
import pandas as pd
import numpy as np
import config
class Result:
"""
A class used to represent a Result.
Attributes
----------
ticker : sequence
The stock ticker.
data : dataframe
The historical data associated with the ticker.
strategy : Strategy
An instance of the Strategy class.
buy_transactions: seq... | |
<gh_stars>10-100
# --------------------------------------------------------
# mmqgis_library - mmqgis operation functions
#
# begin : 10 May 2010
# copyright : (c) 2010 by <NAME>
# email : See <EMAIL>
#
# MMQGIS is free software and is offered without guarantee
# or warranty. You can redistribute it and/or modify it
#... | |
<filename>f5_cccl/service/manager.py
"""Manages the creation and deployment of desired services configuration."""
# coding=utf-8
#
# Copyright 2017 F5 Networks Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a c... | |
<filename>pokemon.py<gh_stars>10-100
from .utils import *
from .tags import Tags
from aqt.qt import *
from aqt.utils import tooltip
# Nickname Settings
def Nickname():
deckmonlist, f = get_pokemons()
if deckmonlist is None:
return
displaylist = []
for item in deckmonlist:
deckname = mw.col.decks.name(item[1]... | |
<filename>cli/src/klio_cli/commands/job/gke.py
# Copyright 2021 Spotify AB
#
# 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 b... | |
Test to verify :func: `validate_token` and then authenticate
"""
core, root = core_and_root([make_example_internal_api(self)])
# Authenticate the impersonator (admin user 1)
(response0, json_body0) = authenticate_with_token(
self, root,
tenant_id="111111",
token_id="123456a")
self.assertEqual(200, response0.co... | |
<filename>astroquery/esa/hsa/core.py<gh_stars>0
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import cgi
import os
import re
import shutil
from pathlib import Path
from astropy import units as u
from astroquery.utils import commons
from astroquery import log
from astroquery.exceptions import LoginEr... | |
<reponame>shui02/appyter-catalog
# Basic libraries
import pandas as pd
import os
import urllib3
import requests, json
import sys
import math
from collections import OrderedDict
import random
from time import sleep
import time
import operator
import numpy as np
import warnings
import shutil
from datetime import datetime... | |
Handle error elements
elif child.tag == dbgp.ELEMENT_ERROR or child.tag == dbgp.ELEMENT_PATH_ERROR:
message = 'error'
for step_child in child:
if step_child.tag == dbgp.ELEMENT_MESSAGE or step_child.tag == dbgp.ELEMENT_PATH_MESSAGE and step_child.text:
message = step_child.text
break
if default_key:
properties[... | |
= Pipeline([node(biconcat, ["input", "input1"], "output1", name="a")])
pipeline2 = Pipeline([node(biconcat, ["input", "input1"], "output1", name="a")])
new_pipeline = pipeline1 - pipeline2
assert new_pipeline.inputs() == set()
assert new_pipeline.outputs() == set()
assert not new_pipeline.nodes
def test_invalid_... | |
<reponame>sisisin/pulumi-gcp
# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, U... | |
need to check this.'''
isotope_check = [str(a) for a in [sum([[mod_names[[b[0] for b in mod_names].index(a)][1] for a in D[2][0].split('_')].count(m) == peptide.count(m) for m in [a[1] for a in mod_names]])==len(mod_names) for peptide in [peptideL,peptideH]]]
mods_check = [0,0]
for i,line in enumerate(zip([modsL,m... | |
<filename>ibllib/ephys/ephysqc.py
"""
Quality control of raw Neuropixel electrophysiology data.
"""
from pathlib import Path
import logging
import numpy as np
import pandas as pd
from scipy import signal
from scipy.ndimage import gaussian_filter1d
import alf.io
from brainbox.core import Bunch
from brainbox.processing... | |
<reponame>opoplawski/scipy<filename>scipy/sparse/linalg/_expm_multiply.py<gh_stars>0
"""Compute the action of the matrix exponential.
"""
from __future__ import division, print_function, absolute_import
import math
import numpy as np
import scipy.linalg
import scipy.sparse.linalg
from scipy.sparse.linalg import Lin... | |
<reponame>mikhail-dvorkin/competitions<filename>adventofcode/y2018.py
#!/usr/bin/env python3
import adventofcode
import collections
import itertools
import numpy as np
import re
assembler_instructions = {
'addr': lambda r, a, b: r[a] + r[b],
'addi': lambda r, a, b: r[a] + b,
'mulr': lambda r, a, b: r[a] * r[b],
'm... | |
doc
self._childView = view
if view:
view.SetFrame(self)
# self.Create(doc, view, frame, id, title, pos, size, style, name)
self._activeEvent = None
self._activated = 0
wx.EVT_ACTIVATE(self, self.OnActivate)
wx.EVT_CLOSE(self, self.OnCloseWindow)
if frame: # wxBug: For some reason the EVT_ACTIVATE event is not... | |
model arg must be a ModelConfig instead of nn.Module."
assert not isinstance(self.model, ModelConfig), error_msg2
# initialize logger
self.logger = _Logger(n_classes=n_classes, criteria=criteria, verbose=verbose)
def initialize(self, device: str, pretrained_param_path=None, n_threads=12):
"""
Initialize the mod... | |
the velocity head difference between the end of
the outlet conduit and the destination node: <font color=blue>%s</font><br><br>
If less than 0, number of table specifying
the pump speed as a function of time. If greater than 0, operation block
number controlling the pump. If 0, pump will run at its base
speed all ... | |
and len(cname) > 0:
self.write_attribute(NAME, cname)
if idc.is_bf(eid) == True:
self.write_numeric_attribute("BIT_MASK", mask)
self.close_tag()
def export_enum_references(self, addr):
"""
Finds and exports enum references at an address.
Args:
addr: Integer representing the instruction address.
"""
f = idc... | |
#!/usr/bin/env python
#
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author <N... | |
<filename>pychunkedgraph/backend/chunkedgraph.py
import collections
import numpy as np
import time
import datetime
import os
import sys
import networkx as nx
import pytz
import cloudvolume
import re
import itertools
import logging
from itertools import chain
from multiwrapper import multiprocessing_utils as mu
from py... | |
import sqlite3
from dataclasses import dataclass, field
import typing
from enum import IntEnum
from src.Errors import *
# TODO add date as a special type (subset of text - sqlite doesn't have native date/time support)
# TODO refactor the executes into a private function (_run)
# * isolate the connect, execute, and c... | |
from . import auth_blueprint
from flask.views import MethodView
from flask import make_response, request, jsonify, session
from flask_cors import cross_origin
from app.models.user import User
from app.models.token import Token
from app import db
from flasgger import swag_from
import re
import json
from sqlalchemy.sql.... | |
"""
"""
import math
import random
from PySide2.QtCore import QTimer, QSize, QRect
from PySide2.QtGui import QPainter, QPen, QColor
from PySide2.QtWidgets import QApplication, QWidget, QHBoxLayout, QFormLayout, QPushButton, QSpinBox, QDoubleSpinBox, \
QCheckBox
TOTAL_BOIDS = 150
DEFAULT_MAX_SPEED = 9.0
DEFAULT_MAX_D... | |
tried to reanalyze on GPU with reanalyze off. I'll fix it later. Perhaps something like 'self.use_last_model_value, self.reanalyse_on_gpu = True' in one line in the game file
self.config.train_on_gpu
+ self.config.num_workers * self.config.selfplay_on_gpu
+ log_in_tensorboard * self.config.selfplay_on_gpu
+ self.co... | |
<filename>llgeo/props_nonlinear/darendeli_2011.py
''' Darendeli Non-linear Properties for Equivalent-Linear Ground Response Analyses
DESCRIPTION:
This module contains functions related to the non-linear dynamic properties of
soils, specifically geared towards use in equivalent-linear ground response
analyses. The curv... | |
x1, -1, [[0]])
self.base_bad_size_zi([1, 1], [1], x1, -1, [0, 1, 2])
self.base_bad_size_zi([1, 1, 1], [1], x1, -1, [[0]])
self.base_bad_size_zi([1, 1, 1], [1], x1, -1, [0, 1, 2])
self.base_bad_size_zi([1], [1, 1], x1, -1, [0, 1])
self.base_bad_size_zi([1], [1, 1], x1, -1, [[0]])
self.base_bad_size_zi([1], [1, 1],... | |
<reponame>lasconic/randomsheetmusic<gh_stars>1-10
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
# Name: spanner.py
# Purpose: The Spanner base-class and subclasses
#
# Authors: <NAME>
# <NAME>
#
# Copyright: Copyright © 2010-2012 <NAME> and the music21 Project
... | |
return np.array([sindex_HK1, sindex_HKn, sindex_HKm, sindex_HK2, sindex_HKp])
def polygon_area(self, xy, plot=0):
"""
This utility takes coordinates (x, y) ordered in an array and calculates the polygon area enclosed.
The coordinates needs to be ordered in a counter-clock-wise manner since the circuference usi... | |
import os, glob, warnings
import numpy as np
from collections import OrderedDict
from typing import Union, Dict, List
from pygromos.files import imd, repdat
from pygromos.utils import bash
import reeds.function_libs.analysis.free_energy
import reeds.function_libs.analysis.parameter_optimization
import reeds.function... | |
case1 = True
if polygon_array[row, 2] == 0:
length_not_given += 1
if polygon_array[row, 1] == 0:
angles_not_given += 1
#case1
if case1 == True:
return "case 1"
else:
if length_not_given >= 2: #parallelness needs to be solved in case2calc function
return "case 2"
elif length_not_given == 1:
if ... | |
(string) --The value for the resource tag.
:type KmsKeyId: string
:param KmsKeyId: The AWS Key Management Service (KMS) key ID of the encryption key that you want to use to encrypt data in the cluster.
:type EnhancedVpcRouting: boolean
:param EnhancedVpcRouting: An option that specifies whether to create the ... | |
self.assertEqual('abc', self.stack['AResource'].properties['Foo'])
updated_stack = stack.Stack(self.ctx, 'updated_stack',
template.Template(tmpl),
disable_rollback=True)
self.stack.update(updated_stack)
self.assertEqual((stack.Stack.UPDATE, stack.Stack.COMPLETE),
self.stack.state)
self.assertEqual(
'abc',
sel... | |
<reponame>jonassoenen/noise_robust_cobras
import copy
import gc
import itertools
import logging
from enum import Enum
from typing import Union
import numpy as np
from noise_robust_cobras.cluster import Cluster
from noise_robust_cobras.clustering import Clustering
from noise_robust_cobras.clustering_algorithms.cluster... | |
NUM},
"<cjt>|<card>|NUM|M|P|@N<": {POS: NUM},
"<cjt>|<card>|NUM|M|P|@P<": {POS: NUM},
"<cjt>|<card>|NUM|M|S|@>N": {POS: NUM},
"<cjt>|<card>|NUM|M|S|@N<": {POS: NUM},
"<cjt>|<card>|NUM|M|S|@N<PRED": {POS: NUM},
"<cjt>|<card>|NUM|M|S|@P<": {POS: NUM},
"<cjt>|<card>|NUM|M|S|@PRED>": {POS: NUM},
"<cjt>|<co-... | |
as input
Returns:
TimeDataset
"""
return time_dataset.GlobalTimeDataset(
df_dict,
predict_mode=predict_mode,
n_lags=self.n_lags,
n_forecasts=self.n_forecasts,
season_config=self.season_config,
events_config=self.events_config,
country_holidays_config=self.country_holidays_config,
covar_config=self.config_c... | |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2020 The github-release-retry Project Authors
#
# 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
#
# https://www.apache.org/licenses/L... | |
<filename>Voice Assistant/Jarvis.py
import datetime
import pickle
import smtplib
import subprocess
from GoogleNews import GoogleNews
import pywhatkit as kit
import tkinter as tk
from bs4 import BeautifulSoup
from getpass import getpass
import pytz
import time as tm
import speech_recognition as sr # importing speech re... | |
<filename>reference/parson/eg_mutagen_from_js.py<gh_stars>1-10
"""
Translate from Zarf's Javascript (the subset used) to my Mutagen
grammar syntax.
http://www.eblong.com/zarf/mutagen/mutagen.js
"""
import re
from parson import Grammar
def translate(grammar):
for x, y in reversed(g.grammar(grammar)):
print x, '=', y... | |
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
from django.db import connection
from django.db import IntegrityError
from django.utils.text import slugify
from django.http import HttpResponse, JsonResponse
from decimal import Decimal
from build.management.commands.bas... | |
import torch
from torch.nn.modules import Module
import cutlassconv_cuda
import int8pool_cuda
import int8mm_cuda
import int8conv_cuda
import torch.nn.functional as F
import time
from options import args
class UpdateWeight(Module):
"""
The parameter update part of both TiConv2d and TiLinear are the same
Use on base ... | |
"vibrational")
def __init__(
self,
input_dir: str = ".",
output_dir: str = ".",
wanted_files: Optional[Iterable[Union[str, Path]]] = None,
quantum_software: str = "gaussian",
):
"""
Parameters
----------
input_dir : str or path-like object, optional
Path to directory containing files for extraction, defaul... | |
quantumgates
from utilitiesquantumgates import utilities
from tensorboardutilities import tensorboardutilities
from datetime import datetime
import time
#%% datatypes
npdatatype=np.complex64
tfdatatype=tf.complex64
tfrealdatatype=tf.float32 # to use double switch aboe to complex128
#%% number of training poi... | |
<filename>SPGPylibs/PHItools/phifdt_pipe_modules.py
### phifdt_pipe_modules
import numpy as np
import random, statistics
from scipy.ndimage import gaussian_filter
from matplotlib import pyplot as plt
from .tools import printc,bcolors,fix_path
from .phi_fits import fits_get
from .phi_rte import phi_rte
from .phi_utils... | |
close=True)
rxn_df = table_lookup_update(rxn_df,
('reaction_id', rid),
('plot_path', fpath))
else:
logger.info(" missing Arrhenius coefficients; skipping...")
logger.info("Writing updated reaction table to {:s}".format(rxn_csv_out))
write_table_to_csv(rxn_df, rxn_csv_out)
def read_thermo_data(spc_csv):
""" ... | |
<reponame>mih/multimatch
#!/usr/bin/python3
import numpy as np
import math
import sys
import collections
def cart2pol(x, y):
"""Transform cartesian into polar coordinates.
:param x: float
:param y : float
:return: rho: float, length from (0,0)
:return: theta: float, angle in radians
"""
rho = np.sqrt(x **... | |
#!/usr/bin/env python
#
# Copyright 2014 Tuenti Technologies S.L.
#
# 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 applica... | |
from farms C and D to the blending station. This calculation assumed the milk would be delivered at the original concentration, which will require at least two trucks to keep the sources of milk separated until they reach the blending facility. The plan does not allow pooling these sources prior to transport, otherwise... | |
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": "2",
"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,
... | |
with DNA ligase for 30 minutes at room-temperature.'))
elif fragment.bottomLeftOverhang.sequence != '':
if isComplementary(fragment.topLeftOverhang.sequence.lower(), fragment.topRightOverhang.sequence.lower()):
ligated = DNA('plasmid',fragment.name+' self-ligation',fragment.sequence+fragment.topRightOverhang.sequenc... | |
# -*- coding: utf-8 -*-
"""
Execution utilities.
"""
import multiprocessing
import concurrent.futures as cf
from subprocess import call, Popen, PIPE
import logging
import gc
from math import floor
import os
import psutil
import getpass
import shlex
from warnings import warn
from rex.utilities.loggers import LOGGERS, l... | |
is not None:
raise result.e
raise TApplicationException(TApplicationException.MISSING_RESULT, "getRecommendationIds failed: unknown result")
def getBlockedRecommendationIds(self, syncReason):
"""
Parameters:
- syncReason
"""
self.send_getBlockedRecommendationIds(syncReason)
return self.recv_getBlockedRecomme... | |
import yaml
import numpy
import scipy.interpolate
class Material:
""" Material class"""
def __init__(self, filename, interpolation_points=100, empty=False):
"""
:param filename: The name of the material file
:interpolation_points=100: The number of interpolation_points
:empty=False: Create an empty... | |
import numpy as np
import torch as t
import torch.nn as nn
import torch.distributed as dist
from jukebox.transformer.ops import LayerNorm
from jukebox.prior.autoregressive import ConditionalAutoregressive2D
from jukebox.prior.conditioners import Conditioner, LabelConditioner
from jukebox.data.labels import Labeller
f... | |
to pi'
ein = 1.0 * esig
pol = np.deg2rad(polarisation)
eout = np.cos(pol)*esig + np.sin(pol)*piout
if polarisation in ['sigmasigma', 'sigsig', 'ss']:
ein = 1.0 * esig
eout = 1.0 * esig
elif polarisation in ['sigmapi', 'sigpi', 'sp']:
ein = 1.0 * esig
eout = 1.0 * piout
elif polarisation in ['pisigma', 'pisig'... | |
given number of items per page
:param str item: The name of the item type whose inventory pages to calculate
:param int maxPerPage: The maximum number of items that may be present on a single page of items (TODO: Add a default)
:return: The number of pages of size maxPerPage needed to display all of the user's ina... | |
cas = settings.login_form
cas_user = cas.get_user()
if cas_user:
cas_user[passfield] = None
# Ensure new users go through their post registration tasks
register_onaccept = settings.register_onaccept
if register_onaccept:
settings.register_onaccept = \
[self.s3_register_onaccept,
register_onaccept, # Used by DR... | |
0,
"Unexpected value {} for NAT counter 'Packets'".format(nat_counters[entry]["Packets"]))
pytest_assert(int(nat_counters[entry]["Bytes"]) > 0,
"Unexpected value {} for NAT counter 'Bytes'".format(nat_counters[entry]["Bytes"]))
# Send bidirectional traffic
for path in DIRECTION_PARAMS:
generate_and_verify_traffic... | |
email_text = '''
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--[if IE]><html xmlns="http://www.w3.org/1999/xhtml" class="ie"><![endif]-->
<!--[if !IE]><!-->
<html style="margin: 0;padding: 0;" xmlns="http://www.w3.org/1999/xhtml">
<... | |
1
)
def __init__(self, status=None,):
self.status = status
def read(self, iprot):
if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None:
fastbinary.decode_binary(self, iprot.trans, (... | |
取得第几页的数据,和 PageSize 同时传递才会生效。
:type PageNum: int
:param PageSize: 分页大小,和 PageNum 同时传递才会生效。
取值:10 ~ 100 之间的任意整数
:type PageSize: int
"""
self.PackageType = None
self.OrderBy = None
self.PageNum = None
self.PageSize = None
def _deserialize(self, params):
self.PackageType = params.get("PackageType")
self.Order... | |
# Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions ... | |
<gh_stars>0
"""
@author: <NAME>
@editor: <NAME>
"""
import sys
sys.path.insert(0, '../utilities')
# import os
# os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' # or any {'0', '1', '2'}
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import scipy.io
from scipy.interpolate import griddata
from pyDO... | |
__self__).__init__(
'rancher2:index/clusterTemplate:ClusterTemplate',
resource_name,
__props__,
opts)
@staticmethod
def get(resource_name, id, opts=None, annotations=None, default_revision_id=None, description=None, labels=None, members=None, name=None, template_revisions=None):
"""
Get an existing ClusterTemp... | |
import logging
import json
import datetime
import typing
import uuid
from flask import g
from driftbase.models.db import Match
from driftbase import flexmatch
from driftbase.lobbies import InvalidRequestException, NotFoundException, UnauthorizedException, ConflictException, _post_lobby_event_to_members, _get_lobby_memb... | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... | |
upgrades on
the cluster (UTC).
:type upgrade_pause_end_timestamp_utc: ~datetime.datetime
:param wave_upgrade_paused: Boolean to pause automatic runtime version upgrades to the cluster.
:type wave_upgrade_paused: bool
:param notifications: Indicates a list of notification channels for cluster events.
:type notific... | |
# Copyright (c) 2009 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,
'test_shell_windows_resource_files': [
'resources/test_shell.rc',
'resources/pan_east.cur',
'resources/pan_mid... | |
from __future__ import division
import numpy as np
from matplotlib.ticker import AutoMinorLocator
from matplotlib.ticker import MultipleLocator
from matplotlib.ticker import MaxNLocator
from scipy.interpolate import LinearNDInterpolator
import matplotlib.pyplot as plt
import time
import sys
import os
sys.path.append(... | |
= get_expected(placed, lowest, exclude
) - exclude - needed_budget
ret = max(ret, cand)('Case #%d: %.10lf' % (cc + 1, ret))
return needed_budget
def func_654db418d7c34fa1a93ae5fab58b01ee(budget, cc, infile):
placed = sorted(map(int, infile.readline().split()))
ret = 0.0
queue = [1] + placed + [(p - 1) for p in ... | |
(Note: you can use libraries that implement the state machine concept)"
elif self.generic_yesno_input("Do you need to enforce pre or post conditions in a hierarchy", ref):
self.pattern = "Template Method (implemented as NVI Idiom in C++)"
elif self.generic_yesno_input("Do you need method chaining in a hierarchy", re... | |
= torch.tensor(bleu_rewards).float().mean()
quantities_to_log["bleu"].append(reward)
if self._include_perplexity is True:
nll_reward = (
self._compute_nll_reward(
sentences=generated_texts))
reward = reward + nll_reward
quantities_to_log["nll"].append(nll_reward)
rewards.append(reward)
# all_classifier_outp... | |
added
render_context.update( {"full_report" : 'yes'} )
createReport( html_report, 'report.html', render_context )
def createBlockReport():
'''Called at the end of run to create a block.html report. Use 'pass' if not wanted.'''
if pluginParams['cmdOptions'].cmdline: return
printtime("Creating block report...")
if... | |
from imported module. Error was "{}."', e.args[0])
def _ensure_files_exist(exit_on_failure):
failure = False
if not _case_sensitive_regular_file_exists(VERSION_FILENAME):
_error_output('Version file {} was not found!', RE_FILE_EXTENSION.sub('.(py|txt)', VERSION_FILENAME))
failure = True
if not _case_sensitive_... | |
<reponame>enwudz/pytracker<filename>trackingTools.py
#!/usr/bin/python
import numpy as np
import cv2
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import glob
import sys
import os
from datetime import datetime
import sys
import analysisTools
import csv
'''
stuff to tweak to change tracking parameters:
g... | |
Process points in the list ``v``, with saturation at primes up to
``sat``. If ``sat`` is zero (the default), do no saturation.
INPUT:
- ``v`` (list of 3-tuples or lists of ints or Integers) -- a
list of triples of integers, which define points on the
curve.
- ``sat`` (int, default 0) -- saturate at primes up t... | |
listaips.append(str(i))
# verifica se há ips fixos no dhcp
checkfixosdhcp = set(listaips).intersection(set(dhcprange))
if checkfixosdhcp:
raise ValidationError("Existe um Ip fixo configurado dentro do range de DHCP, por favor corrija.")
def __unicode__(self):
# return self.name
#return u'%s (%s) - VLAN: ... | |
<gh_stars>0
# Copyright (C) 2022. Huawei Technologies Co., Ltd. All rights reserved.
# 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 right... | |
= dict()
log['func_name'] = func.__name__
if self.current_queries:
best_query = self.current_queries[0]
log['old_best_query'] = best_query
log['old_precision'] = best_query.precision
log['old_recall'] = best_query.recall
log['old_score'] = best_query.score
else:
log['old_best_query'] = None
log['old_precision... | |
SLHA_TABLE = '''
# ISAJET SUSY parameters in SUSY Les Houches Accord 2 format
# Created by ISALHA 2.0 Last revision: <NAME> 27 May 2014
Block SPINFO # Program information
1 ISASUGRA/ISASUSY from ISAJET # Spectrum Calculator
2 7.88 02-JAN-2018 11:01:14 # Version number
Block MODSEL # Model selection
1 2 # Minimal ga... | |
<gh_stars>0
#!/usr/bin/env python
import argparse
import cPickle
import traceback
import logging
import time
import sys
import numpy
import experiments.nmt
from experiments.nmt import \
RNNEncoderDecoder, \
prototype_phrase_state, \
parse_input
from experiments.nmt.numpy_compat import argpartition
logger = logg... | |
import os
import shutil
import time
import glob
import subprocess
import web
from libs import utils, form_utils
from libs.logger import logger
import settings
subscription_versions = ['normal', 'nomail', 'digest']
def __get_ml_dir(mail):
"""Get absolute path of the root directory of mailing list account."""
if ... | |
size = sig.size
plt.imshow(sig.reshape((N_FRAMES, size//N_FRAMES)).T)
plt.clim(min_val_exp - diff/10, max_val_exp + diff/10)
plt.title(titles[i])
plt.savefig(plotdir + '{}.png'.format(name), dpi=400)
plt.close()
async def do_pcm_test_fft_correction(dut, pdm_fname, test_num):
'''Correct for fft innacuracies.'''
... | |
[[float(i == j) for j in range(n)] for i in range(n)]
#pivot
if piv:
for j in range(len(A)):
A, P, Q = pivot(A, P, Q, j, piv)
for k in range(n):
for i in range(k, n):
L[i][k] = A[i][k] - sum(L[i][p]*U[p][k] for p in range(k))
for i in range(k+1, n):
if L[k][k] == 0:
exit('Debe usarse pivoteo par... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.