id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
1,500
test get path xdg yaml
""" author: deadc0de6 (https://github.com/deadc0de6) Copyright (c) 2017, deadc0de6 basic unittest for the install function """ # pylint: disable=R0903 # pylint: disable=W0231 # pylint: disable=W0212 import os import unittest from unittest.mock import patch from dotdrop.options import Options, Logger from dotdrop.exce...
1,501
run test
#!/usr/bin/env python3 # Copyright (c) 2014-2022 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test RPCs that retrieve information from the mempool.""" from test_framework.test_framework import Bit...
1,502
mean normed
# # Annulus toy log pdf. # # This file is part of PINTS (https://github.com/pints-team/pints/) which is # released under the BSD 3-clause license. See accompanying LICENSE.md for # copyright notice and full license details. # import numpy as np import scipy from . import ToyLogPDF class AnnulusLogPDF(ToyLogPDF): ...
1,503
dq
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import uuid from cryptography.exceptions import InvalidSignature from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.asymmetric...
1,504
run test
#!/usr/bin/env python3 # Copyright (c) 2017-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test debug logging.""" import os from test_framework.test_framework import BitcoinTestFramework from ...
1,505
npc on target crit hit
import arcemu from arcemu import Unit def npc_onCombatStart( unit, event, target ): unit.sendChatMessage( arcemu.CHAT_MSG_MONSTER_YELL, arcemu.LANG_UNIVERSAL, "I am going to kill you " + target.getName() + "!" ) def npc_onCombatStop( unit, event, target ): unit.sendChatMessage( arcemu.CHAT_MSG_MONSTER_SAY, arcemu....
1,506
test extract daily
from pathlib import Path import pandas as pd from antarest.study.storage.rawstudy.model.filesystem.matrix.date_serializer import ( AnnualMatrixSerializer, DailyMatrixSerializer, HourlyMatrixSerializer, MonthlyMatrixSerializer, WeeklyMatrixSerializer, rename_unnamed, ) def test_extract_hourly...
1,507
run
# -*- coding: utf-8 -*- #Copyright (C) Fiz Vazquez vud1@sindominio.net # Modified by dgranda #This program is free software; you can redistribute it and/or #modify it under the terms of the GNU General Public License #as published by the Free Software Foundation; either version 2 #of the License, or (at your option) ...
1,508
comp avg seg dur
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import numpy as np import os.path as op import re from tabulate import tabulate from collections import Counter def comp_purity(p_xy, axis):...
1,509
test quotes
from io import BytesIO from translate.convert import csv2po, test_convert from translate.storage import csvl10n, po from translate.storage.test_base import first_translatable, headerless_len def test_replacestrings(): """Test the _replacestring function""" assert ( csv2po.replacestrings("Test one two...
1,510
set done
import datetime import collections from uuid import uuid4 class Job: """Job related to specific host name. Data must contain everything needed to finish the job. """ # Remove done jobs each n days to clear memory keep_in_memory_days = 3 def __init__(self, host_name, data, job_id=None, create...
1,511
get objects
"""Sync LDAP Users and groups into authentik""" from typing import Any, Generator from django.conf import settings from django.db.models.base import Model from django.db.models.query import QuerySet from ldap3 import DEREF_ALWAYS, SUBTREE, Connection from structlog.stdlib import BoundLogger, get_logger from authentik...
1,512
config file
# This file is part of the MapProxy project. # Copyright (C) 2011 Omniscale <http://omniscale.de> # # 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...
1,513
type
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
1,514
test set control vars with constants
import numpy as np from pysd.py_backend.components import Time, Components from pysd import read_vensim class TestComponents(): def test_load_components(self, _root): test_model = _root.joinpath("test-models/samples/teacup/teacup.mdl") test_model_py = _root.joinpath("test-models/samples/teacup/te...
1,515
cmd add header ext stdio
#!/usr/bin/env python3 # # Manipulations with qcow2 image # # Copyright (C) 2012 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your op...
1,516
next
"""Miscellaneous WSGI-related Utilities""" import posixpath __all__ = [ 'FileWrapper', 'guess_scheme', 'application_uri', 'request_uri', 'shift_path_info', 'setup_testing_defaults', ] class FileWrapper: """Wrapper to convert file-like objects to iterables""" def __init__(self, filelike, blksize=819...
1,517
test bubble
# -*- coding: utf-8 -*- from pytest import raises from discopy.cat import * from discopy.utils import AxiomError def test_main(): x, y, z = Ob('x'), Ob('y'), Ob('z') f, g, h = Box('f', x, y), Box('g', y, z), Box('h', z, x) assert Id(x) >> f == f == f >> Id(y) assert (f >> g).dom == f.dom and (f >> g...
1,518
tear down
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. from tests import TestCase, run_gtk_loop from quodlibet.util import con...
1,519
reverse bytes
from migen import * from migen.genlib.misc import timeline from misoc.interconnect import wishbone from misoc.interconnect.csr import AutoCSR, CSRStorage, CSRStatus _FAST_READ = 0x0b _DIOFR = 0xbb _QIOFR = 0xeb def _format_cmd(cmd, spi_width): """ `cmd` is the read instruction. Since everything is transmit...
1,520
bond sort
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding:utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 fileencoding=utf-8 # # MDAnalysis --- https://www.mdanalysis.org # Copyright (c) 2006-2017 The MDAnalysis Development Team and contributors # (see the file AUTHORS for the full list of names) #...
1,521
async generator
# -*- coding: utf-8 -*- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
1,522
test cloudwatch log group with kms key
from unittest import mock from boto3 import client, session from moto import mock_logs from prowler.providers.aws.lib.audit_info.models import AWS_Audit_Info from prowler.providers.common.models import Audit_Metadata AWS_REGION = "us-east-1" AWS_ACCOUNT_NUMBER = "123456789012" class Test_cloudwatch_log_group_kms_e...
1,523
copy to
from typing import ContextManager import os import io import shutil import urllib import urllib.request from urllib.parse import urlparse import requests from datetime import datetime from functools import partial from tqdm.auto import tqdm from rastervision.pipeline.file_system import (FileSystem, NotReadableError, ...
1,524
zero points
# Copyright (c) 2023 PaddlePaddle 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
1,525
get path
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import os import numpy as np from fairseq import utils from fairseq.data import ( ConcatSentencesDataset, Dictionary, ...
1,526
run gpu benchmark
# Released under the MIT License. See LICENSE for details. # """Benchmark/Stress-Test related functionality.""" from __future__ import annotations import random from typing import TYPE_CHECKING import babase import bascenev1 if TYPE_CHECKING: from typing import Any, Sequence def run_cpu_benchmark() -> None: ...
1,527
get raw point
import abc import numpy import pyresample from scipy.interpolate import interp1d import data.geo as geo class Model(metaclass=abc.ABCMeta): """Abstract base class for models.""" def __init__(self, nc_data): self.nc_data = nc_data @property @abc.abstractmethod def depths(self) -> numpy....
1,528
render
import typing as t from ast import literal_eval from ast import parse from itertools import chain from itertools import islice from types import GeneratorType from . import nodes from .compiler import CodeGenerator from .compiler import Frame from .compiler import has_safe_repr from .environment import Environment fro...
1,529
test weight stream
# 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...
1,530
echo
import os import base64 import click import appdirs import ipaddress import typing import uuid from colorama import init, Fore, Style from vantage6.common.globals import STRING_ENCODING # init colorstuff init() def logger_name(special__name__: str): """ Return the name of the logger. Parameters -...
1,531
commit
# -*- coding: utf-8 -*- # # This file is part of SENAITE.CORE. # # SENAITE.CORE is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation, version 2. # # This program is distributed in the hope that it will be useful, bu...
1,532
test defer makes the correct request
# coding: utf-8 # # Copyright 2020 The Oppia 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://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
1,533
parse opt
# Copyright (c) 2019 PaddlePaddle 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
1,534
rotate local
#!/usr/bin/env python3 # Copyright (c) Meta Platforms, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from typing import List, Optional import magnum as mn import numpy as np from habitat_sim.agent.controls.control...
1,535
read conm2
from __future__ import annotations from typing import TYPE_CHECKING import numpy as np import h5py from ..h5_utils import read_basic_element if TYPE_CHECKING: # pragma: no cover from pyNastran.bdf.bdf import BDF def METHOD_NAME(name: str, group: h5py._hl.dataset.Dataset, geom_model: BDF) -> None: #('EID', 'G'...
1,536
handler
# -*- coding: utf-8 -*- import threading import socket import time import pytest import requests from tests.testserver.server import Server class TestTestServer: def test_basic(self): """messages are sent and received properly""" question = b"success?" answer = b"yeah, success" ...
1,537
domain return ok
import sys from _typeshed import StrPath from collections.abc import Iterable, Iterator, Sequence from http.client import HTTPResponse from re import Pattern from typing import ClassVar, TypeVar, overload from urllib.request import Request __all__ = [ "Cookie", "CookieJar", "CookiePolicy", "DefaultCook...
1,538
open tle
""" Satellite TLE (two-line element) Loading ---------------------------------------- """ from __future__ import absolute_import, print_function import datetime import re import os from functools import cmp_to_key import ephem TLE_ENTRY_RE = ( r"^([1])(\s+)([%(NUMBER)s%(CLASSIFICATION)s]+)(\s+)" r"([%(INTL_DE...
1,539
check error msg
import random import numpy as np from numba.tests.support import TestCase, captured_stdout from numba import njit, literally from numba.core import types from numba.cpython.unsafe.tuple import tuple_setitem, build_full_slice_tuple from numba.np.unsafe.ndarray import to_fixed_tuple, empty_inferred from numba.core.unsaf...
1,540
ip found
import ipaddress import logging import random import socket import re import struct from abc import ABCMeta, abstractmethod from typing import Iterable, List, Tuple logger = logging.getLogger(__name__) class InvalidNetworkRangeError(Exception): """Raise when invalid network range is provided""" class NetworkRa...
1,541
test create arr
# pylint: disable=missing-function-docstring, missing-module-docstring, reimported import numpy as np from pyccel.epyccel import epyccel def test_single_return_var_assign(language): def single_return_var_assign(): y = 3 return y epyc_single_return_var_assign = epyccel(single_return_var_assign, ...
1,542
check ping
import time import re import random from virttest import error_context from virttest import utils_test from virttest import utils_net from virttest import utils_misc @error_context.context_aware def run(test, params, env): """ Test failover by team driver 1) Boot a vm with 4 nics. 2) inside guest, c...
1,543
convert monster to win10 json
import json import random from herders.models import MonsterInstance, BuildingInstance from .rune_optimizer_mapping import * def export_win10(summoner): # Fake storage building storage_bldg_id = 1234567890 buildings = [ { 'building_master_id': 25, 'building_id': storage_bl...
1,544
async io
# -*- coding: utf-8 -*- ########################################################################## # Copyright 2013-2021 Aerospike, 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 copy of the License at # # ...
1,545
write generic log event
import csv from datetime import datetime, timedelta from itertools import chain from django.contrib.auth.models import User from django.db.models import ForeignKey, Min import attr from dimagi.utils.parsing import string_to_datetime from corehq.apps.users.models import Invitation, WebUser from corehq.util.models im...
1,546
get minimum across quotas
""" Rate limiter and quota system. Framework-independent rate limiting mechanism that provides: * IP address and token-based accounting * customizable quotas based on IP address and token * late limiting based on resource usage (time spent on API calls) * bucketing based on day, week, month * stati...
1,547
test derived without base attrs
# stdlib from time import time from typing import Callable from typing import Optional # third party from pydantic import BaseModel # syft absolute import syft as sy from syft.serde.serializable import serializable def get_fqn_for_class(cls): return f"{cls.__module__}.{cls.__name__}" # -----------------------...
1,548
create dagster daemon cli
import os import sys from typing import Optional import click from dagster import __version__ as dagster_version from dagster._cli.utils import get_instance_for_cli from dagster._cli.workspace.cli_target import ( ClickArgMapping, ClickArgValue, get_workspace_load_target, workspace_target_argument, ) f...
1,549
upsample
import tensorflow as tf def conv_pass( fmaps_in, kernel_size, num_fmaps, num_repetitions, activation="relu", name="conv_pass", ): """Create a convolution pass:: f_in --> f_1 --> ... --> f_n where each ``-->`` is a convolution followed by a (non-linear) activation function...
1,550
list
from django.conf import settings from django.db.models.query_utils import Q from django_filters import rest_framework as filters from djqscsv import render_to_csv_response from dry_rest_permissions.generics import DRYPermissions from rest_framework import filters as rest_framework_filters from rest_framework import mix...
1,551
insights segments
from warnings import warn from twilio.rest.flex_api.FlexApiBase import FlexApiBase from twilio.rest.flex_api.v1.assessments import AssessmentsList from twilio.rest.flex_api.v1.channel import ChannelList from twilio.rest.flex_api.v1.configuration import ConfigurationList from twilio.rest.flex_api.v1.flex_flow import Fl...
1,552
get information
# *************************************************************************** # * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
1,553
get config
from keras_core import backend from keras_core.api_export import keras_core_export from keras_core.layers.preprocessing.tf_data_layer import TFDataLayer from keras_core.utils import backend_utils @keras_core_export("keras_core.layers.CategoryEncoding") class CategoryEncoding(TFDataLayer): """A preprocessing layer...
1,554
output logical id
""" Date type classes for companion stacks """ import posixpath import re from typing import Optional from samcli.lib.utils.hash import str_checksum class CompanionStack: """ Abstraction class for the companion stack Companion stack name will be generated by this class. """ _parent_stack_nam...
1,555
make message
# Based on https://github.com/ziglang/zig-pypi/blob/de14cf728fa35c014821f62a4fa9abd9f4bb560e/make_wheels.py # MIT from __future__ import annotations import os import sys from email.message import EmailMessage from pathlib import Path from typing import Sequence from zipfile import ZIP_DEFLATED, ZipInfo from wheel.wh...
1,556
get app engine service iam policy output
# 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 copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload fr...
1,557
test nonstationary mutator
import json from pathlib import Path import pytest from nni.common.framework import get_default_framework, set_default_framework from nni.nas.space import StationaryMutator, Mutator, MutationSampler, GraphModelSpace, ModelStatus, MutatorSequence from nni.nas.space.mutator import _RandomSampler from nni.nas.space.graph...
1,558
test 3 tensorflow mnist targeted
# MIT License # # Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020 # # 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 # r...
1,559
reddy chatterji register
import logging import numpy as np from skimage.filters import difference_of_gaussians, window from skimage.transform import rotate, warp_polar from aspire.numeric import fft from aspire.utils.coor_trans import grid_2d logger = logging.getLogger(__name__) __cache = dict() def _phase_cross_correlation(img0, img1): ...
1,560
db resource
# ruff: isort: skip_file from dagster import ResourceDefinition, graph, job # start_resource_example from dagster import resource class ExternalCerealFetcher: def fetch_new_cereals(self, start_ts, end_ts): pass @resource def cereal_fetcher(init_context): return ExternalCerealFetcher() # end_res...
1,561
test q data stream protocol pack unpack
import asyncio import json import struct from contextlib import asynccontextmanager, closing from socket import socketpair import pytest from hypothesis import example, given, settings from hypothesis import strategies as st from server.protocol import ( DisconnectedError, QDataStreamProtocol, SimpleJsonP...
1,562
guide
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 r""" Example: Toy Mixture Model with Discrete Enumeration ==================================================== A toy mixture model to provide a simple example for implementing discrete enumeration:: (A) -> [B] -> (C) ``A`` is an...
1,563
get input output texts
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # Copyright 2020 The HuggingFace Team. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www....
1,564
is program valid
# Copyright (c) 2021 PaddlePaddle 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
1,565
synchronize
"""This module contains all OpenCL specific kernel_tuner functions""" from __future__ import print_function import time import numpy as np from kernel_tuner.backends.backend import GPUBackend from kernel_tuner.observers.opencl import OpenCLObserver # embedded in try block to be able to generate documentation try: ...
1,566
test gridcur serialize
""" tests for code that reads teh old gridcur format """ from pathlib import Path from datetime import datetime import numpy as np import pytest from gnome.environment.environment_objects import (GridCurrent, FileGridCurrent, ...
1,567
sanitize id
#!/usr/bin/env python3 # License: GPLv3 Copyright: 2019, Kovid Goyal <kovid at kovidgoyal.net> import re from base64 import standard_b64decode from collections import OrderedDict from itertools import count from typing import Callable, Dict, Optional from .constants import is_macos, logo_png_file from .fast_data_type...
1,568
fn matches
""" pygments.formatters ~~~~~~~~~~~~~~~~~~~ Pygments formatters. :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re import sys import types import fnmatch from os.path import basename from pygments.formatters._mapping import F...
1,569
close
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
1,570
update access token
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # from typing import Any, List, Mapping, Optional, Tuple import pendulum import requests from airbyte_cdk.logger import AirbyteLogger from airbyte_cdk.sources import AbstractSource from airbyte_cdk.sources.streams import Stream from airbyte_cdk.sources.stream...
1,571
fetch
import requests from waste_collection_schedule import Collection # type: ignore[attr-defined] from waste_collection_schedule.service.ICS import ICS from bs4 import BeautifulSoup import re TITLE = "Abfallwirtschaftsbetrieb LK Mainz-Bingen" DESCRIPTION = "Source for Abfallwirtschaftsbetrieb LK Mainz-Bingen." URL = "ht...
1,572
root cmakelists dir
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import re from spack.package import * class RocmDebugAgent(CMakePackage): """Radeon Open Compute (ROCm) debug agent...
1,573
copy
# Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """This module defines the data structures used to represent a grammar. These are a bit arcane because they are derived from the data structures used by Python's 'pgen' parser generator. There's also ...
1,574
main
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Plot all mean/std per point for a subject or population json file from tractometry-flow. WARNING: For population, the displayed STDs is only showing the variation of the means. It does not account intra-subject STDs. """ import argparse import itertools import json ...
1,575
test build with debug
""" Tests CQGI functionality Currently, this includes: Parsing a script, and detecting its available variables Altering the values at runtime defining a build_object function to return results """ from cadquery import cqgi from tests import BaseTest import textwrap TESTSCRIPT = textwrap....
1,576
dump flags
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
1,577
get source model
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
1,578
is unlisted addons reviewer
from olympia import amo def match_rules(rules, app, action): """ This will match rules found in Group. """ for rule in rules.split(','): rule_app, rule_action = rule.split(':') if rule_app == '*' or rule_app == app: if rule_action == '*' or rule_action == action or action =...
1,579
tags
# 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 copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload fr...
1,580
test unknown
############################################################################### # # The MIT License (MIT) # # Copyright (c) typedef int GmbH # # 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 ...
1,581
test and condition and short circuit
from unittest.mock import Mock import pytest from nucypher.policy.conditions.base import AccessControlCondition from nucypher.policy.conditions.lingo import AndCompoundCondition, OrCompoundCondition @pytest.fixture(scope="function") def mock_conditions(): condition_1 = Mock(spec=AccessControlCondition) cond...
1,582
test single event logdir
# Copyright 2019 The TensorFlow 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://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
1,583
tags
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
1,584
test custom eval
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. from parlai.scripts.display_data import display_data as display, setup_args from parlai.agents.repeat_label.repeat_label ...
1,585
matrix for control state
# This code is part of Qiskit. # # (C) Copyright IBM 2017. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
1,586
get dbtests
""" Run time data storage and retrieval. """ import time import datetime import json import socket import os.path import shutil from processor.helper.config.config_utils import config_value, framework_currentdata, get_cache_data, \ set_cache_data, TESTS, DBTESTS, DBVALUES, SNAPSHOT from processor.helper.json.json_u...
1,587
postprocess predictions
import os import argparse import collections import numpy as np import torch def process_files(args): all_predictions = collections.OrderedDict() all_labels = collections.OrderedDict() all_uid = collections.OrderedDict() for path in args.paths: path = os.path.join(path, args.prediction_name) ...
1,588
test verify ld proofs not verified unsigned
from asynctest import TestCase from aries_cloudagent.wallet.key_type import ED25519 from ..ed25519_signature_2020 import Ed25519Signature2020 from ...crypto.wallet_key_pair import WalletKeyPair from ...ld_proofs import sign, verify from ...purposes.assertion_proof_purpose import AssertionProofPurpose from ....tests.da...
1,589
find node
""" Functions that communicate with OBS API and work with related XML data. """ import xml.sax.saxutils from xml.etree import ElementTree as ET def get(apiurl, path, query=None): """ Send a GET request to OBS. :param apiurl: OBS apiurl. :type apiurl: str :param path: URL path segments. :ty...
1,590
widgets
''' conv_star.py Copyright (C) 2020, 2021, 2022 Phillip A Carter Copyright (C) 2020, 2021, 2022 Gregory D Carl This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (...
1,591
get default category name
import re from typing import Any, Callable, Dict, List, Optional import sqlalchemy as sa from szurubooru import config, db, errors, model, rest from szurubooru.func import cache, serialization, util DEFAULT_CATEGORY_NAME_CACHE_KEY = "default-tag-category" class TagCategoryNotFoundError(errors.NotFoundError): p...
1,592
inner test
#!/usr/bin/env python3 # Test remapping of topic name for incoming message from mosq_test_helper import * def write_config(filename, port1, port2, protocol_version): with open(filename, 'w') as f: f.write("port %d\n" % (port2)) f.write("allow_anonymous true\n") f.write("\n") f.wri...
1,593
register
# This file is part of Korman. # # Korman is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Korman is distributed i...
1,594
seed life
import gc import time import random from stellar import StellarUnicorn from picographics import PicoGraphics, DISPLAY_STELLAR_UNICORN, PEN_P8 from ulab import numpy """ A randomly-seeded game-of-life cellular automata effect. Experiment with the values below to change the effect. Press "A" to manually re-seed. """ #...
1,595
tear down
from datetime import date from django.shortcuts import reverse from django.test import TestCase from autoemails.forms import GenericEmailScheduleForm from autoemails.models import EmailTemplate, RQJob, Trigger from autoemails.tests.base import FakeRedisTestCaseMixin import autoemails.views from workshops.models impor...
1,596
resolve from mibs
# (C) Datadog, Inc. 2010-2019 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) from collections import defaultdict from typing import DefaultDict, Dict, List, Optional, Tuple # noqa: F401 from .models import OID # noqa: F401 from .pysnmp_types import MibViewController # noqa: F401 from ....
1,597
test conversion between intf
""" Copyright 2013 Steven Diamond 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...
1,598
id
# 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 copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload fr...
1,599
open connection
from contextlib import contextmanager, suppress from typing import Any, AnyStr, ClassVar, Iterator, Optional, Sequence, List import snowflake.connector as snowflake_lib from dlt.common.destination import DestinationCapabilitiesContext from dlt.destinations.exceptions import DatabaseTerminalException, DatabaseTransien...