text stringlengths 5.98k 166k | length int64 7.94k 8.45k | is_long_context bool 2
classes | metric_val float64 0.04 0.48 | label_metric stringclasses 1
value | label_class stringclasses 3
values | source stringclasses 1
value | threshold_scale stringclasses 1
value |
|---|---|---|---|---|---|---|---|
+= 1
continue
blk = virt_io['block'][vmid][i]
rootfs_img = blk.split(':')[1].strip(':')
print('if [ ! -f "/data{}/{}" ]; then'.format(i, rootfs_img), file=config)
print(' echo "no /data{}/{}, exit"'.format(i, rootfs_img), file=config)
print("... | 8,071 | false | 0.140979 | median | negative | code | normalized |
adbase
sys.path.insert(0, os.path.dirname(__file__))
#
# Register App Services
#
self.AD.services.register_service("appdaemon", "app", "start", self.manage_services)
self.AD.services.register_service("appdaemon", "app", "stop", self.manage_services)
self.AD.ser... | 8,382 | false | 0.111189 | median | negative | code | normalized |
included in environment sources.'.format(obj))
else:
continue
sources.append(obj)
def disable_warnings(self):
# 'self' is the environment
if self.msvc:
# We have to remove existing warning level defines before appending /w,
# otherwise we get: "warning D902... | 8,095 | false | 0.051504 | median | negative | code | normalized |
# current_piece
#
import copy
import queue
import threading
import time
from threading import Lock
from typing import Tuple, List
import numpy as np
import actions
import shape
# Some global settings
DEFAULT_LENGTH = 20
DEFAULT_WIDTH = 10
MAP_PADDING_SIZE = 4
# When there are less than threshold pieces, spawn... | 8,377 | false | 0.093081 | median | negative | code | normalized |
= 'Production'
__all__ = [
'ACES_CONFIG_REFERENCE_MAPPING_FILE_PATH',
'ACES_CONFIG_REFERENCE_COLORSPACE',
'ACES_CONFIG_OUTPUT_ENCODING_COLORSPACE',
'ACES_CONFIG_COLORSPACE_NAME_SEPARATOR',
'ACES_CONFIG_COLORSPACE_FAMILY_SEPARATOR',
'ACES_CONFIG_BUILTIN_TRANSFORM_NAME_SEPARATOR',
'ACES_CONF... | 7,950 | false | 0.09158 | median | negative | code | normalized |
.. import strategy
from ..op import OpPattern
from .._tensor import elemwise_shape_func
from ..strategy.generic import is_depthwise_conv2d
from ...transform import LayoutConfig
# relu
reg.register_broadcast_schedule("nn.relu")
reg.register_pattern("nn.relu", OpPattern.ELEMWISE)
# softmax
reg.register_strategy("nn.s... | 8,418 | false | 0.141328 | median | negative | code | normalized |
:BB:BB:BB:BB"
self.rogue_mac = "CC:CC:CC:CC:CC:CC"
self.target_essid = "Evil"
self.args = mock.Mock()
self.args.deauth_essid = False
self.args.channel_monitor = False
self.args.deauth_channels = []
data0 = custom_tuple(self.target_bssid, self.target_channel, self... | 8,211 | false | 0.203538 | median | middle | code | normalized |
must not be allowed.\n\n")
def windows_installer_elevated_prviliges_disabled_errmsg(self, success):
if not success:
self.log.write("Check SV-77815r1_rule: ")
self.log.write(
"The Windows Installer Always install with elevated privileges must be disabled.\n\n")... | 8,251 | false | 0.214007 | median | middle | code | normalized |
from arcana.utils.interfaces import MergeTuple, Chain
from arcana.data import FilesetSpec, InputFilesetSpec
from arcana.utils.interfaces import SelectSession
from arcana.study import ParamSpec, SwitchSpec
from arcana.exceptions import ArcanaMissingDataException, ArcanaNameError
from banana.requirement import (
fsl... | 8,074 | false | 0.186106 | median | middle | code | normalized |
self.nodes[0].getnetworkinfo()['relayfee']
# This test is not meant to test fee estimation and we'd like
# to be sure all txs are sent at a consistent desired feerate
for node in self.nodes:
node.settxfee(min_relay_tx_fee)
# if the fee's positive delta is higher than this v... | 8,391 | false | 0.167065 | median | middle | code | normalized |
': 0}
mutex_clean = threading.Semaphore(1)
# misc. constants
TIMESTAMP_FORMAT = '%Y-%m-%dT%H:%M:%S'
TIMESTAMP_FORMAT_MILLIS = '%Y-%m-%dT%H:%M:%S.%fZ'
CODEC_HANDLER_UNDERSCORE = 'underscore'
# chunk size for file downloads
DOWNLOAD_CHUNK_SIZE = 1024 * 1024
# set up logger
LOG = logging.getLogger(__name__)
# flag to ... | 8,202 | false | 0.063828 | median | negative | code | normalized |
= main_engine
self.event_engine = event_engine
self.backtester_engine = main_engine.get_engine(APP_NAME)
self.class_names = []
self.settings = {}
self.target_display = ""
self.init_ui()
self.register_event()
self.backtester_engine.init_engine()
... | 7,992 | false | 0.088285 | median | negative | code | normalized |
AGES, ENTITY_STORAGES
from torchbiggraph.losses import LOSS_FUNCTIONS, AbstractLossFunction
from torchbiggraph.model import MultiRelationEmbedder, make_model
from torchbiggraph.parameter_sharing import ParameterServer, ParameterSharer
from torchbiggraph.row_adagrad import RowAdagrad
from torchbiggraph.stats import Stat... | 8,130 | false | 0.106377 | median | negative | code | normalized |
headers=None):
"""This is a decorator for web api endpoints
Args:
uri: The URI for the API, can contain keywords denoted by '{}' which indicate
objects: a list of tuples
methods: the list of HTTP methods this API accepts
auth_group: the group that the token must be in for acces... | 8,263 | false | 0.110175 | median | negative | code | normalized |
mlinks_photos(photos, destination, dry_run):
photo_filenames = etiquette.helpers.decollide_names(photos, lambda p: p.basename)
for (photo, filename) in photo_filenames.items():
symlink_path = destination.with_child(filename)
if dry_run:
yield symlink_path
continue
... | 8,006 | false | 0.131396 | median | negative | code | normalized |
</h1>
<p>""" + question + """</p>
"""
footer = """
</body>
</html>"""
# write html to file
text_file = open(fichier, "w")
text_file.write(header)
text_file.write(resultat_html)
text_file.write(footer)
text_file.close()
# open report.html in browser
current_path = p... | 8,239 | false | 0.21242 | median | middle | code | normalized |
istributed import rank_zero_info, rank_zero_warn
from pytorch_lightning.utilities.exceptions import MisconfigurationException
from pytorch_lightning.utilities.memory import recursive_detach
from pytorch_lightning.utilities.model_utils import is_overridden
from pytorch_lightning.utilities.parsing import AttributeDict
fr... | 7,952 | false | 0.138764 | median | negative | code | normalized |
getitem__.
Usage: _SliceBuilder()[<expr>] slice_spec Python generates for <expr>.
"""
def __getitem__(self, slice_spec):
return slice_spec
SLICE_BUILDER = _SliceBuilder()
def _make_tensor_slice_spec(slice_spec, use_constant=True):
"""Wraps all integers in an extended slice spec w/ a tensor.
This fu... | 8,124 | false | 0.158758 | median | middle | code | normalized |
('BaxA', ['BaxM', 'BaxA_1', 'BaxA_2', 'SmacM', 'CytoCM'])
Monomer('ApafI')
Monomer('BidU', ['C8A'])
Monomer('BidT')
Monomer('C3A', ['Xiap', 'ParpU', 'C6pro'])
Monomer('ApafA')
Monomer('BidM', ['BaxM'])
Monomer('Receptor', ['Ligand', 'Fadd'])
Monomer('C6pro', ['C3A'])
Parameter('bind_0_Ligand_binder_Receptor_binder_tar... | 8,295 | false | 0.179805 | median | middle | code | normalized |
er import accumulator
from ceilometer.transformer import conversions
class TestTransformerAccumulator(test.BaseTestCase):
def test_handle_sample(self):
test_sample = sample.Sample(
name='a',
type=sample.TYPE_GAUGE,
volume=1,
unit='B',
user_id="t... | 8,299 | false | 0.191134 | median | middle | code | normalized |
ORKING_DIR, 'samples')
TEST_DATA_DIR = os.path.join(uptane.WORKING_DIR, 'tests', 'test_data')
TEST_DIRECTOR_METADATA_DIR = os.path.join(TEST_DATA_DIR, 'director_metadata')
TEST_IMAGE_REPO_METADATA_DIR = os.path.join(
TEST_DATA_DIR, 'image_repo_metadata')
TEST_DIRECTOR_ROOT_FNAME = os.path.join(
TEST_DIRECTOR_ME... | 8,287 | false | 0.111909 | median | negative | code | normalized |
self.handle_list = args.handle
self.show_extract = args.extract
self.imports = args.imports
self.dynamics = []
if self.trace:
self.calltrace = []
if self.stack and self.registers:
self.dump = True
if self.dump:
self.registers =... | 8,049 | false | 0.101645 | median | negative | code | normalized |
from selfdrive.controls.lib.alertmanager import AlertManager, set_offroad_alert
from selfdrive.controls.lib.vehicle_model import VehicleModel
from selfdrive.locationd.calibrationd import Calibration
from selfdrive.hardware import HARDWARE, TICI, EON
from selfdrive.manager.process_config import managed_processes
SOFT_D... | 7,953 | false | 0.127199 | median | negative | code | normalized |
list[ExtensionsV1beta1AllowedHostPath]',
'allowed_proc_mount_types': 'list[str]',
'allowed_unsafe_sysctls': 'list[str]',
'default_add_capabilities': 'list[str]',
'default_allow_privilege_escalation': 'bool',
'forbidden_sysctls': 'list[str]',
'fs_group': 'ExtensionsV1beta1... | 8,050 | true | 0.252601 | median | positive | code | normalized |
akatime.session_cache.SessionCache.connect', None],
]
def shared(self, expected_project='', expected_branch=ANY, entity='', config='good_config.cfg', extra_args=[]):
self.patched['wakatime.packages.requests.adapters.HTTPAdapter.send'].return_value = CustomResponse()
config = os.path.join('test... | 8,052 | true | 0.231079 | median | positive | code | normalized |
RangeConstraint", "ValueSizeConstraint")
switch001, = mibBuilder.importSymbols("CISCOSB-MIB", "switch001")
InetAddress, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType")
snmpTargetAddrExtEntry, = mibBuilder.importSymbols("SNMP-COMMUNITY-MIB", "snmpTargetAddrExtEntry")
Snmp... | 8,201 | true | 0.224504 | median | positive | code | normalized |
db, "VLAN_MEMBER")
fvs = swsscommon.FieldValuePairs([("tagging_mode", tagging_mode)])
tbl.set("Vlan" + vlan + "|" + interface, fvs)
time.sleep(1)
def remove_vlan_member(self, vlan, interface):
tbl = swsscommon.Table(self.cdb, "VLAN_MEMBER")
tbl._del("Vlan" + vlan + "|" + int... | 8,361 | true | 0.26342 | median | positive | code | normalized |
QU8RRbSlE8xIqtrNTGltqYhM9hVmxnpQ621MGfI1iv1MmWOpm0WD7HIloX20ows1eCfxpjm91MjbKHEhMPMf9DEz2UJXZX62GaxLMkttnL1Gb+kGSbnewhTFWaaWm2eYRpfTwDHo4yzO5nm8ewhAoEJiBPktRTbF3C4qvHmZpiH4HaTzC1lSInmNpGEZmp7RQZYGoHRZ5kKtBxkqld9HiKqd1s6TRbh/gghWcoHMJQeYriT1P4DIXPUniWwgxTe6iRYab2UiTL1DRFRph6hCKjTO2jyBhTj1JknKn9FJlg6jGKTDL1OEWmmPoERc4x9Q... | 8,021 | true | 0.227702 | median | positive | code | normalized |
"]
return entry if isinstance(expr, relay.Function) else entry.body
def test_resize_infer_type():
n, c, h, w = tvm.var("n"), tvm.var("c"), tvm.var("h"), tvm.var("w")
x = relay.var("x", relay.TensorType((n, c, h, w), "int8"))
th, tw = tvm.var("th"), tvm.var("tw")
z = relay.image.resize(x, (th, tw))
... | 8,295 | false | 0.150759 | median | middle | code | normalized |
model
self.dataset = scenario.dataset
self.partners_list = scenario.partners_list
self.init_model_from = scenario.init_model_from
self.use_saved_weights = scenario.use_saved_weights
self.amounts_per_partner = scenario.amounts_per_partner
self.val_set = scenario.val_set
... | 8,345 | false | 0.158391 | median | middle | code | normalized |
_service.worker.reporting import StatusReporter
from packit_service.worker.tasks import (
run_koji_build_report_handler,
run_copr_build_end_handler,
run_copr_build_start_handler,
run_testing_farm_handler,
)
from packit_service.worker.testing_farm import TestingFarmJobHelper
from tests.conftest import co... | 8,143 | true | 0.260683 | median | positive | code | normalized |
('BaxA', ['BaxM', 'BaxA_1', 'BaxA_2', 'SmacM', 'CytoCM'])
Monomer('ApafI')
Monomer('BidU', ['C8A'])
Monomer('BidT')
Monomer('C3A', ['Xiap', 'ParpU', 'C6pro'])
Monomer('ApafA')
Monomer('BidM', ['BaxM'])
Monomer('Receptor', ['Ligand', 'Fadd'])
Monomer('C6pro', ['C3A'])
Parameter('bind_0_Ligand_binder_Receptor_binder_tar... | 8,295 | false | 0.179898 | median | middle | code | normalized |
()
self.assertEqual(len(errors), 1)
error = errors[0]
self.assertEqual(error.hint, hint)
self.assertEqual(error.obj, invalid_obj)
self.assertEqual(error.id, id)
self.assertRegex(error.msg, msg)
def assertIsValid(self, model_admin, model, admin_site=None):
if ... | 8,413 | true | 0.224181 | median | positive | code | normalized |
uel.angel@thecorpora.com
# Enabled classic controller message publishing
# Mon Nov 08 11:46:58 2010 (David Lu) davidlu@wustl.edu
# Added calibrated nunchuk information, changed /joy to /wiijoy
# Only publish on /wiimote/nunchuk if attached
# Tue Jul 05, 2011 (Chad Rockey) chadrockey@gmail.com
# Removed LED and Ru... | 8,423 | false | 0.173979 | median | middle | code | normalized |
"sma",
"vwap",
"zlma",
"cci",
"macd",
"rsi",
"stoch",
"fisher",
"cg",
"adx",
"aroon",
"bbands",
"donchian",
"ad",
"obv",
"fib",
]
CHOICES += CHOICES_COMMANDS
def __init__(
... | 8,112 | false | 0.197314 | median | middle | code | normalized |
.cisco.com/meraki/api-v1/#!get-network-sm-bypass-activation-lock-attempt
- networkId (string): (required)
- attemptId (string): (required)
"""
metadata = {
'tags': ['sm', 'configure', 'bypassActivationLockAttempts'],
'operation': 'getNetworkSmBypassActivationLoc... | 8,054 | true | 0.279576 | median | positive | code | normalized |
pytorch_lightning.utilities.distributed import rank_zero_info
from pytorch_lightning.utilities.exceptions import MisconfigurationException
from pytorch_lightning.utilities.finite_checks import detect_nan_parameters
from pytorch_lightning.utilities.grads import grad_norm
from pytorch_lightning.utilities.model_helpers i... | 8,151 | false | 0.147057 | median | negative | code | normalized |
価の対象とする外界照応の照応先 (kyoto_reader.ALL_EXOPHORS を参照)
bridging (bool): 橋渡し照応の評価を行うかどうか (default: False)
coreference (bool): 共参照の評価を行うかどうか (default: False)
pas_target (str): 述語項構造解析において述語として扱う対象 ('pred': 用言, 'noun': 体言, 'all': 両方, '': 述語なし (default: pred))
Attributes:
cases (List[str]): 評価... | 8,223 | false | 0.095041 | median | negative | code | normalized |
- b) <= 1
@assert_no_logs
@pytest.mark.parametrize('width, height', (
(100, 100),
(200, 10),
(3.14, 987654321),
))
def test_pdf_parser(width, height):
fileobj = io.BytesIO()
surface = cairocffi.PDFSurface(fileobj, 1, 1)
surface.set_size(width, height)
surface.show_page()
surface.finis... | 8,389 | false | 0.157538 | median | middle | code | normalized |
BatchAccountOperations(object):
"""BatchAccountOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type... | 8,082 | true | 0.323108 | median | positive | code | normalized |
.nn.zero_fraction(value))
tf.summary.histogram('%s/activation' % tag, value)
def _assert_all_equal_and_return(tensors, name=None):
"""Asserts that all tensors are equal and returns the first one."""
with tf.name_scope(name, 'assert_all_equal', values=tensors):
if len(tensors) == 1:
ret... | 8,196 | false | 0.075134 | median | negative | code | normalized |
.recommended_mask[recommended_items_ids] = True
def get_metric_value(self):
return self.recommended_mask.sum()/(len(self.recommended_mask)-self.n_ignore_items)
def merge_with_other(self, other_metric_object):
assert other_metric_object is Coverage_Item, "Coverage_Item: attempting to merge wit... | 8,117 | false | 0.077349 | median | negative | code | normalized |
datetime64[D]",
)
numeraire = np.ones((nsim, dategrid.size), dtype=np.float)
rnd = np.random.RandomState(123)
rate = rnd.normal(size=(nsim, dategrid.size))
eurusd = rnd.lognormal(size=(nsim, dategrid.size))
abc = rnd.lognormal(size=(nsim, dategrid.size))
return Model(
dategrid,
... | 8,226 | false | 0.160183 | median | middle | code | normalized |
.pickle', 'rb') as f:
conf_name = pickle.load(f)
opt = ConfLoader(conf_name).opt
return opt
def data():
# it just for processing, meaningless
dataloader = None
dataset_size = None
return dataloader, dataset_size
def create_model(dataloader, dataset_size):
cla... | 7,980 | true | 0.259851 | median | positive | code | normalized |
(data_path):
os.makedirs(data_path)
static_path = os.path.join(base,"STATIC")
if not os.path.exists(static_path):
os.makedirs(static_path)
CFSR_path = os.path.join(static_path,"CFSR")
if not os.path.exists(CFSR_path):
os.makedirs(CFSR_path)
out = {'data_path':data_path,'... | 7,959 | false | 0.11024 | median | negative | code | normalized |
is([
dict(method='GET',
uri=self.get_mock_url(
'network', 'public', append=['v2.0', 'networks.json']),
json={'networks': []}),
dict(method='POST',
uri=self.get_mock_url(
'compute', 'public', append=['ser... | 8,080 | true | 0.250519 | median | positive | code | normalized |
estimator doesn't have a `random_state` parameter), an *exact clone* is
returned: the clone and the original estimator will give the exact same
results. Otherwise, *statistical clone* is returned: the clone might
yield different results from the original estimator. More details can be
found in :ref... | 7,965 | false | 0.060501 | median | negative | code | normalized |
NOTE: this is just b/c of an outdated file...
GPU activities 'Time' total:
65.78635
API calls 'Time' total:
149.37072
Q: Why's there a discrepancy?
==18229== NVPROF is profiling process 18229, command: /home/jgleeson/envs/cycle_counter_prod/bin/python3 /home/jgleeson/clone/baselines... | 8,078 | false | 0.077647 | median | negative | code | normalized |
2076-b67c-4ee7-8c3a-2bf5a2cc2475'),
})
def test_custom_encoder_decoder(self):
value = {'uuid': uuid.UUID('{d85e2076-b67c-4ee7-8c3a-2bf5a2cc2475}')}
obj = NullableJSONModel(value_custom=value)
obj.clean_fields()
obj.save()
obj.refresh_from_db()
self.assert... | 8,322 | false | 0.139057 | median | negative | code | normalized |
img = torch.rand(batch_size, channels, height, width, device=device)
img = utils.tensor_to_gradcheck_var(img) # to var
assert gradcheck(kornia.geometry.transform.imgwarp.angle_to_rotation_matrix, (img,), raise_exception=True)
@pytest.mark.jit
@pytest.mark.skip("Problems with kornia.pi... | 8,045 | true | 0.22786 | median | positive | code | normalized |
HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False
def build_create_or_update_request_initial(
subscription_id: str,
resource_group_name: str,
disk_encryption_set_name: str,
*,
json: JSONType = None,
content: Any = None,
... | 8,129 | false | 0.219857 | median | middle | code | normalized |
distribution ensures that no encounter geometries yield a higher risk than others.\n
@param relativePosition - relative position of objects 1 and 2 within the collision plane in the form of 1x2 numpy arrays.\n
@param collisionRadius - combined radius that contains extremities of the objects in the same units a... | 8,233 | false | 0.078675 | median | negative | code | normalized |
)
self.caseresult = True
self._log.info("============= {0} Setup case============".format(self.casename))
# Set all shape in cloud
# self.testarg_rpc_cloud = [
# # testflag,opfuncname,testRunArgs, setdimArgs
# #("prelu_grad_000", prelu_grad_run, ((1, 64, 2, 2), (... | 8,115 | true | 0.287938 | median | positive | code | normalized |
def apply_move(self, move):
new_current_config = move.apply(self.current_config)
return Diff(new_current_config, self.target_config)
def has_no_diff(self):
return self.current_config == self.target_config
class JsonMove:
"""
A class similar to JsonPatch operation, but it allows th... | 7,937 | false | 0.09083 | median | negative | code | normalized |
self.device = device
self.url = '/system'
def exit_jd(self):
"""
:return:
"""
resp = self.device.action(self.url + "/exitJD")
return resp
def restart_jd(self):
"""
:return:
"""
resp = self.device.action(self.url + "/restartJD")... | 8,022 | false | 0.074857 | median | negative | code | normalized |
dict__["stop_exceptions"] = OrderedDict()
def add(self, item, uid=None):
"""
Adds a :py:class:`Resource <testplan.common.entity.base.Resource>` to
the Environment.
:param item: Resource to be added.
:type item: :py:class:`Resource <testplan.common.entity.base.Resource>`
... | 8,342 | false | 0.109597 | median | negative | code | normalized |
Scikit",
"CreationTime": datetime.datetime(2018, 8, 3, 22, 44, 54, 437000),
"TrainingSpecification": {
"TrainingImage": "123.dkr.ecr.us-east-2.amazonaws.com/decision-trees-sample@sha256:12345",
"TrainingImageDigest": "sha256:206854b6ea2f0020d216311da732010515169820b898ec29720bcf1d2b46806a",
... | 7,960 | false | 0.187178 | median | middle | code | normalized |
"""ApplicationGatewaysOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.... | 7,985 | true | 0.327815 | median | positive | code | normalized |
Maybe use NotImplemented
LIBCLOUD_FUNCS_NOT_SUPPORTED = (
"parallels.avail_sizes",
"parallels.avail_locations",
"proxmox.avail_sizes",
)
SALT_INTERNAL_LOADERS_PATHS = (
str(SALT_BASE_PATH / "auth"),
str(SALT_BASE_PATH / "beacons"),
str(SALT_BASE_PATH / "cache"),
str(SALT_BASE_PATH / "clien... | 8,242 | false | 0.125937 | median | negative | code | normalized |
.3')
HIREDIS_SUPPORTS_BYTE_BUFFER = \
hiredis_version >= StrictVersion('0.1.4')
if not HIREDIS_SUPPORTS_BYTE_BUFFER:
msg = ("redis-py works best with hiredis >= 0.1.4. You're running "
"hiredis %s. Please consider upgrading." % hiredis.__version__)
warnings.warn(msg)
... | 8,398 | false | 0.071255 | median | negative | code | normalized |
ations.MonthlyDonor'].objects.all().delete()
orm['recurring_donations.MonthlyDonorProject'].objects.all().delete()
orm['recurring_donations.MonthlyBatch'].objects.all().delete()
orm['recurring_donations.MonthlyOrder'].objects.all().delete()
orm['recurring_donations.MonthlyDonation'].obj... | 8,069 | false | 0.192725 | median | middle | code | normalized |
.array([[0, 1, 0],
[1, 1, 1],
[0, 1, 0]], dtype=np.uint8)
img = np.array([[ 0, 41, 0],
[ 30, 81, 106],
[ 0, 147, 0]], dtype=np.uint8)
result = rank.otsu(img, selem)
assert result[1, 1] in [41, 81]
img = np.arr... | 8,355 | false | 0.161566 | median | middle | code | normalized |
='3pp'),
'source_cache_prefix': Property(default='sources'),
'to_build': Property(kind=List(str), default=[]),
'tryserver_affected_files': Property(kind=List(str), default=[]),
}
def RunSteps(api, GOOS, GOARCH, experimental, load_dupe, package_prefix,
source_cache_prefix, to_build, tryserver_... | 8,088 | false | 0.157901 | median | middle | code | normalized |
InvalidJSONError, InvalidAPIKeyError, InvalidAPIKeyFormatError, \
OrganizationAdministratorRequired
from zerver.lib.types import ViewFuncT
from zerver.lib.rate_limiter import RateLimitedUser
from zerver.lib.request import REQ, has_request_variables
from functools import wraps
import base64
import datetime
import... | 8,141 | false | 0.15384 | median | middle | code | normalized |
"resourceAccess": [
{
"id": "a42657d6-7f20-40e3-b6f0-cee03008a62a",
"type": "Scope"
}
]
}]
- name: Create an application with a role
text: |
az ad app create --display-name mytestapp --identifier-uris ht... | 8,210 | false | 0.15108 | median | middle | code | normalized |
x01(\x01\x12\x12\n\nupdated_at\x18\x05 \x01(\x01\"[\n\x06\x42\x61ttle\x12\n\n\x02id\x18\x01 \x01(\x04\x12\x17\n\x0fmatchmaker_type\x18\x02 \x01(\r\x12\x18\n\x10participants_ids\x18\x03 \x03(\x04\x12\x12\n\ncreated_at\x18\x04 \x01(\x01\"K\n\x1a\x43reateBattleRequestRequest\x12\x14\n\x0cinitiator_id\x18\x01 \x01(\x04\x12... | 8,420 | false | 0.199726 | median | middle | code | normalized |
'\n'
nl|'\n'
name|'import'
name|'six'
newline|'\n'
nl|'\n'
name|'import'
name|'testscenarios'
newline|'\n'
nl|'\n'
name|'from'
name|'nova'
name|'import'
name|'context'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'db'
newline|'\n'
name|'from'
name|'nova'
name|'import'
name|'exception'
name|'as'
name|'ex'
new... | 8,134 | false | 0.173975 | median | middle | code | normalized |
#16 for 0.5 column figure,12 for 1 column figure
rcParams['xtick.labelsize']=10 # 14 for 0.5 column figure
rcParams['ytick.labelsize']=10
rcParams['lines.markersize']=3
rcParams['lines.linewidth']=1
rcParams['lines.antialiased']=True
rcParams['mathtext.default']='regular'
rcParams['figure.figsize']=3.5,3.2 #3.5... | 7,993 | false | 0.215422 | median | middle | code | normalized |
116 -56 -114 0
109 69 116 0
34 -46 65 0
25 -38 76 0
-83 35 -59 0
44 -142 113 0
-141 -103 -18 0
-27 118 68 0
-142 -141 -81 0
-30 149 -35 0
-25 -75 -68 0
-108 -36 14 0
-48 -78 -18 0
-146 -58 149 0
82 144 31 0
20 34 123 0
146 -39 -56 0
5 16 19 0
144 106 138 0
45 31 -149 0
-102 62 117 0
-101 64 -87 0
11 -130 -2 0
74 -23 7... | 8,394 | true | 0.247598 | median | positive | code | normalized |
H_CONFIG_OPTS = [
'domain', 'peerdns', 'defroute',
'mtu', 'static-routes', 'gateway'
]
_RH_CONFIG_BONDING_OPTS = [
'mode', 'miimon', 'arp_interval',
'arp_ip_target', 'downdelay', 'updelay',
'use_carrier', 'lacp_rate', 'hashing-algorithm',
'max_bonds', 'tx_queues', 'num_grat_arp',
'num_unsol_... | 8,398 | false | 0.12179 | median | negative | code | normalized |
_metric_pb2
from google.api import monitored_resource_pb2
from google.cloud.monitoring_v3.gapic import enums
from google.cloud.monitoring_v3.gapic import metric_service_client_config
from google.cloud.monitoring_v3.gapic.transports import metric_service_grpc_transport
from google.cloud.monitoring_v3.proto import alert_... | 8,362 | true | 0.22041 | median | positive | code | normalized |
nE = len(E)
nC = len(C)
op = ''.join(E)
perm = Recursive(choices=E)
perm.choose()
perm.simplify()
dimNe = len(perm.total)
elif isinstance(op,type(Operator())):
first = copy(op[0])
newop1 = FermiString(coeff... | 8,001 | false | 0.138812 | median | negative | code | normalized |
self).describe(), {
'id': 'gemini',
'name': 'Gemini',
'countries': ['US'],
'rateLimit': 1500, # 200 for private API
'version': 'v1',
'has': {
'cancelOrder': True,
'CORS': False,
'createDepositAddres... | 8,230 | false | 0.091881 | median | negative | code | normalized |
junit_dispatcher
from pylib.monkey import setup as monkey_setup
from pylib.monkey import test_options as monkey_test_options
from pylib.perf import setup as perf_setup
from pylib.perf import test_options as perf_test_options
from pylib.perf import test_runner as perf_test_runner
from pylib.results import json_results
... | 8,034 | false | 0.09549 | median | negative | code | normalized |
retry
from google.cloud.ndb import tasklets
from google.cloud.ndb import utils
EVENTUAL = datastore_pb2.ReadOptions.EVENTUAL
EVENTUAL_CONSISTENCY = EVENTUAL # Legacy NDB
STRONG = datastore_pb2.ReadOptions.STRONG
_DEFAULT_TIMEOUT = None
_NOT_FOUND = object()
log = logging.getLogger(__name__)
def stub():
"""Get... | 8,103 | false | 0.199318 | median | middle | code | normalized |
_session
def test_makeMd5s(self):
game = self.db.Game(url='foo', gm_url='url456')
game.postSetup()
# create empty files (to mimic uploaded images)
img_path = self.engine.paths.getGamePath(game.gm_url, game.url)
id1 = game.getNextId()
p1 = img_path / '{0}.png'.format(... | 8,401 | false | 0.147722 | median | negative | code | normalized |
\x01(\x0e\x32\x15.buildbucket.Acl.Role\x12\r\n\x05group\x18\x02 \x01(\t\x12\x10\n\x08identity\x18\x03 \x01(\t\"-\n\x04Role\x12\n\n\x06READER\x10\x00\x12\r\n\tSCHEDULER\x10\x01\x12\n\n\x06WRITER\x10\x02\"6\n\x06\x41\x63lSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x1e\n\x04\x61\x63ls\x18\x02 \x03(\x0b\x32\x10.buildbucket.... | 8,321 | false | 0.201104 | median | middle | code | normalized |
is associated with a finite or potentially infinite
sequence of bytes or characters. A source/sink always has a beginning, but
has an end only if it is finite.
"""
OPTIONS_ALLOWED = ('type', 'reposition', 'alias', 'eof_action')
MODES_ALLOWED = ('read', 'write', 'append')
def __init__(... | 8,026 | false | 0.15357 | median | middle | code | normalized |
= pd.Timestamp("2019-01-01", tz="UTC")
end: pd.Timestamp = pd.Timestamp("2019-01-01 01:00:00", tz="UTC")
start_timestamp: float = start.timestamp()
end_timestamp: float = end.timestamp()
maker_trading_pairs: List[str] = ["COINALPHA-WETH", "COINALPHA", "WETH"]
taker_trading_pairs: List[str] = ["COIN... | 8,242 | false | 0.193814 | median | middle | code | normalized |
=None,
min_rev=None, max_rev=None, label=None, description=None):
"""Initialize a new build configuration with the specified attributes.
To actually create this configuration in the database, the `insert`
method needs to be called.
"""
self.env = env
sel... | 8,049 | false | 0.198746 | median | middle | code | normalized |
ube config file")
try:
config.load_kube_config()
config_loaded = True
load_kubernetes_client_proxy()
except (IOError, config.config_exception.ConfigException) as exc:
if not mute:
logger.warning("Unable to load Kube config; reason={}".forma... | 8,246 | false | 0.160586 | median | middle | code | normalized |
_fixtures as k_fix
from kuryr_kubernetes import utils
CONF = cfg.CONF
class TestKuryrPortHandler(test_base.TestCase):
def setUp(self):
super().setUp()
self._project_id = mock.sentinel.project_id
self._subnets = mock.sentinel.subnets
self._security_groups = mock.sentinel.security... | 8,232 | true | 0.257371 | median | positive | code | normalized |
06,
norm_y_weights=False):
"""Inner loop of the iterative NIPALS algorithm.
Provides an alternative to the svd(X'Y); returns the first left and right
singular vectors of X'Y. See PLS for the meaning of the parameters. It is
similar to the Power method for determining ... | 8,011 | false | 0.17399 | median | middle | code | normalized |
ion of classical parital dependence plots. Vertical dispersion of the
data points represents interaction effects. Grey ticks along the y-axis are data
points where the feature's value was NaN.
Note that if you want to change the data being displayed you can update the
shap_values.display_features attri... | 8,172 | false | 0.190695 | median | middle | code | normalized |
"
self.config = config
def check_name_availability(
self, name, custom_headers=None, raw=False, **operation_config):
"""Checks that the storage account name is valid and is not already in
use.
:param name: The storage account name.
:type name: str
:para... | 8,144 | true | 0.356598 | median | positive | code | normalized |
.get(id=worker_id)
StudentComplain.objects.select_for_update().filter(id=iid).\
update(worker_id=w, status=1)
url = '/complaint/caretaker/worker_id_know_more/'+wid;
complainer_details = StudentComplain.objects.get(id=iid)
complaint_system_notif(reques... | 8,107 | false | 0.167317 | median | middle | code | normalized |
IN THE
# SOFTWARE.
from __future__ import absolute_import
import functools
import itertools
import operator
import sys
import types
__author__ = "Benjamin Peterson <benjamin@python.org>"
__version__ = "1.10.0"
# Useful for very coarse version differentiation.
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[... | 8,241 | false | 0.067897 | median | negative | code | normalized |
_rt = bad / float(bad_freq)
non_target_rt = good / float(good_freq)
if float(bad) != 0.0 and bad / float(bad + good) != 1.0:
woe = math.log(float(target_rt / non_target_rt))
elif target_rt == 0.0:
woe = -99999999.0
elif bad / float(bad + good) == 1.0:
woe = 99999999.0
else:
... | 8,328 | false | 0.125267 | median | negative | code | normalized |
as api_hunt
from grr_response_server.gui.api_plugins import metadata as api_metadata
from grr_response_server.gui.api_plugins import osquery as api_osquery
from grr_response_server.gui.api_plugins import timeline as api_timeline
from grr_response_server.gui.api_plugins import user as api_user
from grr_response_server.... | 8,233 | false | 0.169719 | median | middle | code | normalized |
time'.format(query, count))
return ('Errored', cnx)
def fetching_all_query_results(Q, conn, cnx, db, query, count):
count+=1
while count < 15:
if Q is not None and Q != 'Errored':
try:
hits = Q.fetchall()
return hits
except sqlite3.Databa... | 7,946 | true | 0.279824 | median | positive | code | normalized |
os,re,sys
from generator import *
from common_codegen import *
# LayerFactoryGeneratorOptions - subclass of GeneratorOptions.
#
# Adds options used by LayerFactoryOutputGenerator objects during factory
# layer generation.
#
# Additional members
# prefixText - list of strings to prefix generated header with
# (u... | 8,446 | false | 0.086532 | median | negative | code | normalized |
number,
or the string unchanged otherwise.
'''
if text.isdigit():
return decimal.Decimal(text)
try:
postPrefixes = {'K': '10E3', 'M': '10E6', 'G': '10E9', 'T': '10E12', 'P': '10E15', 'E': '10E18', 'Z': '10E21', 'Y': '10E24'}
if text[-1] in postPrefixes.keys():
v = d... | 8,077 | false | 0.075594 | median | negative | code | normalized |
REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
ObjectIdentity, Gauge32, MibIdentifier, Counter32, Bits, MibScalar, M... | 8,358 | false | 0.215801 | median | middle | code | normalized |
.constants import DEFAULT_LEDGER
from aea.connections.base import ConnectionStates
from aea.helpers.exception_policy import ExceptionPolicyEnum
from aea.identity.base import Identity
from aea.mail.base import AEAConnectionError, Envelope, EnvelopeContext
from aea.multiplexer import AsyncMultiplexer, InBox, Multiplexer,... | 7,968 | false | 0.142056 | median | negative | code | normalized |
_workaround,
_unwrap_arrow_serialization_workaround,
)
from ray.data.impl.delegating_block_builder import DelegatingBlockBuilder
from ray.data.impl.arrow_block import ArrowRow
from ray.data.impl.block_list import BlockList
from ray.data.impl.lazy_block_list import LazyBlockList
from ray.data.impl.plan import Execut... | 8,371 | false | 0.15699 | median | middle | code | normalized |
, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTI... | 8,317 | false | 0.181419 | median | middle | code | normalized |
# ###########################################################################*/
"""This module provides a manager to compute and display profiles.
"""
__authors__ = ["V. Valls"]
__license__ = "MIT"
__date__ = "28/06/2018"
import logging
import weakref
from silx.gui import qt
from silx.gui import colors
from silx.gui... | 8,188 | false | 0.115271 | median | negative | code | normalized |
from google.cloud.securitycenter_v1p1beta1.types import finding
from google.cloud.securitycenter_v1p1beta1.types import finding as gcs_finding
from google.cloud.securitycenter_v1p1beta1.types import notification_config
from google.cloud.securitycenter_v1p1beta1.types import (
notification_config as gcs_notification... | 7,971 | true | 0.234632 | median | positive | code | normalized |
ConstraintsUnion")
dnOS, = mibBuilder.importSymbols("DELL-REF-MIB", "dnOS")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
NotificationType, ObjectIdentity, Integer32, Unsigned32, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleI... | 8,403 | true | 0.222799 | median | positive | code | normalized |
NT, then we must be
# consistent across buckets (legacy/vex/evex, opcode,map). This is
# only relevant for fields that would be used in the "dynamic decode
# part 1".
# EASZ is only rarely modified in experimental extensions.
_token_2_module = {'EOSZ':ild_eosz, 'EASZ':ild_easz}
_find_fn_pfx = 'xed3_phash_find'
def ... | 7,995 | false | 0.073323 | median | negative | code | normalized |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.