id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
5,400 | test no user | from __future__ import annotations
from typing import Any
from unittest import mock
from sentry.integrations.discord.message_builder.base.component import (
DiscordComponentCustomIds as CustomIds,
)
from sentry.integrations.discord.requests.base import (
DiscordMessageComponentTypes,
DiscordRequestTypes,
... |
5,401 | lode angle | #!/usr/bin/env python3
#* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgp... |
5,402 | test unsecure read device certificate bad data | # Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS
from __future__ import annotations
import zlib
import pytest
from parsec._parsec import DateTime
from parsec.api.data import DataError, DeviceCertificate, RevokedUserCertificate, UserCertificate
from parsec.api.protocol import UserP... |
5,403 | get numbered param names | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... |
5,404 | list contract by code | from subprocess import Popen, PIPE
import json
import time
# Presetup some commands
query_list_code = ['secretcli', 'query', 'compute', 'list-code']
MAX_TRIES = 10
GAS_METRICS = []
STORE_GAS = '4000000'
GAS = '4000000'
def run_command(command):
"""
Will run any cli command and return its output after waitin... |
5,405 | convert length | # docbook.py: extension module
# $Id: docbook.py 8353 2009-03-17 16:57:50Z mzjn $
import sys
import string
import libxml2
import libxslt
import re
import math
# Some globals
pixelsPerInch = 96.0
unitHash = { 'in': pixelsPerInch,
'cm': pixelsPerInch / 2.54,
'mm': pixelsPerInch / 25.4,
... |
5,406 | add args | # 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 torch.optim.lr_scheduler
from . import FairseqLRScheduler, register_lr_scheduler
@register_lr_scheduler('reduce_lr_on_plateau')
clas... |
5,407 | validate single test result | import itertools
import os
import re
import logbook
from .generator_fixture import GeneratorFixture
_logger = logbook.Logger(__name__)
def validate_run(suite, run_result, expect_interruption, expect_session_errors):
if expect_interruption:
assert run_result.session.results.global_result.is_interrupted(... |
5,408 | ps nsto pn ns | #! /usr/bin/env python
"""
Version of Services/CRIC intended to be used with mock or unittest.mock
"""
from __future__ import division, print_function
from builtins import object, str, bytes
import os
import json
import re
from WMCore.WMBase import getTestBase
from RestClient.ErrorHandling.RestClientExceptions impor... |
5,409 | prepare step | # #
# Copyright 2021-2023 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (... |
5,410 | convert pred to entry | from typing import Dict, Any, Tuple, List
import datasets
from primeqa.mrc.metrics.tydi_f1.eval_utils import Span, TyDiLabel
from primeqa.mrc.metrics.tydi_f1.tydi_eval import pretty_print
from primeqa.mrc.data_models.target_type import TargetType
_DESCRIPTION = """
The F1 score is the harmonic mean of the precision... |
5,411 | configure | #!/usr/bin/env nemesis
#
# ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://g... |
5,412 | test lazy item access should fail with | # -*- coding: utf-8 -*-
"""
Tests for behave.importing.
The module provides a lazy-loading/importing mechanism.
"""
from __future__ import absolute_import
import pytest
from behave.importer import LazyObject, LazyDict, load_module, parse_scoped_name
from behave.formatter.base import Formatter
import sys
import types
#... |
5,413 | test failure 2 | import unittest
import hcl2
from checkov.terraform.checks.resource.gcp.GoogleComputeIPForward import check
from checkov.common.models.enums import CheckResult
class TestGoogleComputeIPForward(unittest.TestCase):
def test_failure(self):
hcl_res = hcl2.loads("""
resource "google_compute_insta... |
5,414 | ease in quint | #!/usr/bin/python3
"""
made with the file cjs/tweener/equations.js
Original copyright notice of the source file:
Copyright 2008 litl, LLC.
Equations
Main equations for the Tweener class
@author Zeh Fernando, Nate Chatellier
@version 1.0.2
Disclaimer for Rob... |
5,415 | test checks | import pytest
from pkgcheck import checks as checks_mod
from pkgcheck import objects, results
from ..misc import init_check
def METHOD_NAME():
"""Scan through all public checks and verify various aspects."""
for name, cls in objects.CHECKS.items():
assert cls.known_results, f"check class {name!r} doe... |
5,416 | test show with app | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
5,417 | tanh | """
mathematical functions.
Descriptions taken from:
https://raw.githubusercontent.com/micropython/micropython/master/docs/library/math.rst.
=====================================
.. module:: math
:synopsis: mathematical functions
|see_cpython_module| :mod:`python:math`.
The ``math`` module provides some basic ma... |
5,418 | test graph maximum bipartite matching | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import assert_equal
from scipy.sparse.csgraph import (reverse_cuthill_mckee,
maximum_bipartite_matching, structural_rank)
from scipy.sparse import diags, csc_matrix, csr_matrix, coo_matrix
def test_graph_rev... |
5,419 | method | # --------------------------------------------------------------------------------------------
# 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 aaz-dev-tools
# --------------------------------... |
5,420 | process request | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
5,421 | handle match | """
EscapeAll.
pymdownx.escapeall
Escape everything.
MIT license.
Copyright (c) 2017 Isaac Muse <isaacmuse@gmail.com>
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, includ... |
5,422 | test managed zone delete | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from gcp_common import BaseTest, event_data
class DnsManagedZoneTest(BaseTest):
def test_managed_zone_query(self):
project_id = 'cloud-custodian'
managed_zone_name = 'custodian'
session_factory = self.replay_f... |
5,423 | recent block slot | from __future__ import annotations
from dataclasses import dataclass
from typing import List, Set
from .solana_tx import SolPubKey
from .solana_tx_legacy import SolLegacyTx
from .constants import ADDRESS_LOOKUP_TABLE_ID
from .errors import ALTError
from .solana_alt_list_filter import ALTListFilter
from .layouts impor... |
5,424 | parse for builtin | #!/usr/bin/env python
# Copyright 2016 Andy Chu. 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
"""
bool_parse.py - Parse ... |
5,425 | on cr entity editing started | # Copyright 2020-2023 Capypara and the SkyTemple Contributors
#
# This file is part of SkyTemple.
#
# SkyTemple 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 y... |
5,426 | response hook | # Copyright The OpenTelemetry 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
5,427 | collater | # 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 collections import OrderedDict
from typing import Callable, Dict, List
import numpy as np
from . import FairseqDataset
def uniform_sa... |
5,428 | set up | #
# Copyright (C) 2010-2022 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... |
5,429 | build revision arguments |
# Copyright 2009-2012 Jaap Karssenberg <jaap.karssenberg@gmail.com>
# Copyright 2012 Damien Accorsi <damien.accorsi@free.fr>
import os
import re
import logging
from zim.plugins.versioncontrol import VCSApplicationBase
from zim.applications import Application
logger = logging.getLogger('zim.vcs.fossil')
RE_Date ... |
5,430 | add deprecations | import abc
import warnings
from typing import TYPE_CHECKING, List, Set, no_type_check
from .config_dict import ConfigDict
from .config_errors import ConfigValidationError, ConfigWarning
from .config_schema_item import SchemaItem
from .context_values import ContextList, ContextString
from .deprecation_info import Depre... |
5,431 | get batchnorm params |
#
# Copyright 2019 Xilinx 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
5,432 | get code version output | # 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... |
5,433 | make test | # Copyright (c) 2020 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... |
5,434 | validate imsi | """
Clean and validate a DataFrame column containing
International Mobile Subscriber Identity (IMSI) numbers.
"""
# pylint: disable=too-many-lines, too-many-arguments, too-many-branches, unused-argument
from typing import Any, Union
from operator import itemgetter
import dask.dataframe as dd
import numpy as np
import ... |
5,435 | kind | # 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
__all__ ... |
5,436 | match resource sub properties | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import hashlib
import json
from cfnlint.helpers import RESOURCE_SPECS
from cfnlint.rules import CloudFormationLintRule, RuleMatch
class ListDuplicatesAllowed(CloudFormationLintRule):
"""Check if duplicates e... |
5,437 | format unencoded | """
pygments.formatters.terminal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for terminal output with ANSI sequences.
:copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.token import Keywo... |
5,438 | time to ground | # Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... |
5,439 | system data | # 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 . imp... |
5,440 | start | import rospy
import threading
from math import asin, atan2, pi
from nav_msgs.msg import Odometry
def quat2Yaw(qw, qx, qy, qz):
'''
Translates from Quaternion to Yaw.
@param qw,qx,qy,qz: Quaternion values
@type qw,qx,qy,qz: float
@return Yaw value translated from Quaternion
'''
rotateZa... |
5,441 | set site | # -*- coding: utf-8 -*-
# Copyright © 2012-2023 Roberto Alsina and others.
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the
# Software without restriction, including without limitation
# the rights t... |
5,442 | save | # Copyright © 2019 Province of British Columbia
#
# 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 agr... |
5,443 | run save | from collections import namedtuple
from d20 import roll
import cogs5e.initiative as init
from cogs5e.models import embeds
from cogs5e.models.errors import InvalidArgument
from cogs5e.models.sheet.base import Skill
from utils.constants import SKILL_MAP, STAT_ABBREVIATIONS, STAT_NAMES
from utils.functions import a_or_a... |
5,444 | get data frame | # GridCal
# Copyright (C) 2022 Santiago Peñate Vera
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3 of the License, or (at your option) any later version.
#
# This pr... |
5,445 | usage | #!/usr/bin/env python3
# coding: utf-8
# Copyright (C) 1994-2021 Altair Engineering, Inc.
# For more information, contact Altair at www.altair.com.
#
# This file is part of both the OpenPBS software ("OpenPBS")
# and the PBS Professional ("PBS Pro") software.
#
# Open Source License Information:
#
# OpenPBS is free so... |
5,446 | get future | # Owner(s): ["oncall: distributed"]
import os
import torch
import torch.distributed as dist
from torch.testing._internal.common_utils import (
run_tests,
)
from torch.futures import Future
import torch.nn as nn
from torch.nn.parallel import DistributedDataParallel as DDP
import test_c10d_common
import weakref
fro... |
5,447 | test process user is set | import sys
import pytest
import salt.modules.win_status as status
from tests.support.mock import ANY, Mock, patch
from tests.support.unit import TestCase
try:
import wmi
except ImportError:
pass
@pytest.mark.skipif(status.HAS_WMI is False, reason="This test requires Windows")
class TestProcsBase(TestCase):... |
5,448 | setup | # coding=utf-8
#
# QEMU hxtool .hx file parsing extension
#
# Copyright (c) 2020 Linaro
#
# This work is licensed under the terms of the GNU GPLv2 or later.
# See the COPYING file in the top-level directory.
"""hxtool is a Sphinx extension that implements the hxtool-doc directive"""
# The purpose of this extension is ... |
5,449 | test printing the job base manifest | import yaml
from prefect.infrastructure.kubernetes import KubernetesJob
from prefect.settings import (
PREFECT_API_KEY,
PREFECT_API_URL,
PREFECT_LOGGING_SERVER_LEVEL,
)
from prefect.testing.cli import invoke_and_assert
from prefect.utilities.dockerutils import get_prefect_image_name
def test_printing_the... |
5,450 | window frame rows start end | import json
from collections.abc import Iterable, Sequence
from datetime import date, time, timedelta
from datetime import datetime as real_datetime
from decimal import Decimal
from typing import Any
from django.core.management.color import Style
from django.db.backends.base.base import BaseDatabaseWrapper
from django... |
5,451 | fetch int8 blob | import collections
from typing import Any, Dict, List, Optional, Protocol, Tuple, Union, overload
from typing_extensions import TypeAlias
import numpy as np
import google.protobuf.message
import torch
from caffe2.proto import caffe2_pb2
from . import core
# pybind11 will automatically accept either Python str or byt... |
5,452 | close | """Test fixtures."""
import copy
import lxml
import yaml
import pytest
from napalm.base.test import conftest as parent_conftest
from napalm.base.test.double import BaseTestDouble
from napalm.junos import junos
from ncclient.devices.junos import JunosDeviceHandler
@pytest.fixture(scope="class")
def set_device_para... |
5,453 | create template | # Example of video streaming simulation
from trex.astf.api import *
import argparse
class Prof1():
def __init__(self):
pass
def __setup_ip_gen(self, client_ip_range, server_ip_range):
ip_gen_c = ASTFIPGenDist(ip_range=client_ip_range, distribution="seq")
ip_gen_s = ASTFIPGenDist(ip_r... |
5,454 | prettify | #
# Copyright 2019 The FATE 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... |
5,455 | handle | import socket
from meerk40t.kernel import Module
def plugin(kernel, lifecycle=None):
if lifecycle == "register":
_ = kernel.translation
kernel.register("module/TCPServer", TCPServer)
class TCPServer(Module):
"""
TCPServer opens up a localhost server and waits. Any connection is given it... |
5,456 | test well posed external circuit differential power | #
# Tests for the Thevenin equivalant circuit model
#
from tests import TestCase
import pybamm
import unittest
class TestThevenin(TestCase):
def test_standard_model(self):
model = pybamm.equivalent_circuit.Thevenin()
model.check_well_posedness()
def test_changing_number_of_rcs(self):
... |
5,457 | has tag | # Copyright: Ankitects Pty Ltd and contributors
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
from __future__ import annotations
import copy
from typing import NewType, Sequence
import anki # pylint: disable=unused-import
import anki.cards
import anki.collection
import anki.decks
im... |
5,458 | play check | import logging
from datetime import datetime
import requests
from flask import Blueprint, request
from src.api_helpers import success_response
from src.queries.get_celery_tasks import convert_epoch_to_datetime, get_celery_tasks
from src.queries.get_db_seed_restore_status import get_db_seed_restore_status
from src.que... |
5,459 | get context | from __future__ import annotations
import contextlib
import json
from io import BytesIO
from typing import Any, AsyncGenerator, Dict, List, Optional, Union
from typing_extensions import Literal
from starlette.requests import Request
from starlette.responses import Response as StarletteResponse
from starlette.testclie... |
5,460 | test login with default | import utility as util
import os
import os.path
import time
# test oauth login with default parameters
def METHOD_NAME():
# execute the azcopy login.
output = util.Command("login").execute_azcopy_command_interactive()
if output is None:
print("error login")
print("test_login_with_default te... |
5,461 | decode image | # Copyright (c) 2020 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... |
5,462 | close | import h5py # type: ignore[import]
import numpy as np
from numpy.core.defchararray import encode, decode
from typing import Union, Dict, Any, Iterable, Optional, Tuple
# Note: I would like to replace Any here with str, float, int, np.ndarray, etc.
# However, this heterogeneous pattern causes issues with mypy ... |
5,463 | array string multi null | # pylint: disable=too-many-lines
# 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) AutoRe... |
5,464 | test run context provider registry register entrypoints | from importlib import reload
from unittest import mock
import pytest
import mlflow.tracking.context.registry
from mlflow.tracking.context.databricks_job_context import DatabricksJobRunContext
from mlflow.tracking.context.databricks_notebook_context import DatabricksNotebookRunContext
from mlflow.tracking.context.data... |
5,465 | change permissions form | from django import forms
from django.core.exceptions import PermissionDenied
from django.http import Http404
from django.utils.translation import pgettext_lazy
from ..acl import algebra
from ..acl.decorators import return_boolean
from ..admin.forms import YesNoSwitch
from .models import Category, CategoryRole, RoleCat... |
5,466 | author | # 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... |
5,467 | get port x | from __future__ import annotations
from gdsfactory.port import Port
def METHOD_NAME(port: Port) -> float:
return port.center[0]
def get_port_y(port: Port) -> float:
return port.center[1]
def sort_ports_x(ports: list[Port]) -> list[Port]:
f_key = METHOD_NAME
ports.sort(key=f_key)
return ports
... |
5,468 | solve | """Dog-leg trust-region optimization."""
from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.linalg
from ._trustregion import (_minimize_trust_region, BaseQuadraticSubproblem)
__all__ = []
def _minimize_dogleg(fun, x0, args=(), jac=None, hess=None,
*... |
5,469 | test decoder optimizations | import decimal
from io import StringIO, BytesIO
from collections import OrderedDict
from test.test_json import PyTest, CTest
class TestDecode:
def test_decimal(self):
rval = self.loads('1.1', parse_float=decimal.Decimal)
self.assertTrue(isinstance(rval, decimal.Decimal))
self.assertEqual(r... |
5,470 | rename floor | from typing import Any, List
from ... import auth
from ...api.socket.constants import GAME_NS
from ...app import app, sio
from ...db.create.floor import create_floor
from ...db.db import db
from ...db.models.floor import Floor
from ...db.models.player_room import PlayerRoom
from ...logs import logger
from ...models.ro... |
5,471 | step hyperv host list | # --------------------------------------------------------------------------
# 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 cause incor... |
5,472 | test main | # Test the module type
import unittest
import weakref
from test.support import run_unittest, gc_collect
from test.script_helper import assert_python_ok
import sys
ModuleType = type(sys)
class FullLoader:
@classmethod
def module_repr(cls, m):
return "<module '{}' (crafted)>".format(m.__name__)
class B... |
5,473 | set path | # installer.py
#
# Copyright 2022 brombinmirko <send@mirko.pm>
#
# 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, in version 3 of the License.
#
# This program is distributed in the hope that it ... |
5,474 | gen bucket policy | import datetime
import logging
import boto3
from ocs_ci.ocs import constants
from ocs_ci.ocs.bucket_utils import retrieve_verification_mode
from ocs_ci.utility import version
logger = logging.getLogger(__name__)
class HttpResponseParser(object):
"""
A simple class for parsing HTTP responses
"""
de... |
5,475 | test already existing fail | """Test the Create Index action"""
# pylint: disable=missing-function-docstring, missing-class-docstring, line-too-long
import os
from curator import IndexList
from curator.helpers.date_ops import parse_date_pattern
from curator.helpers.getters import get_indices
from . import CuratorTestCase
from . import testvars
HO... |
5,476 | test type with nested if | import unittest
from robot.model import For, If, IfBranch, TestCase, Try, TryBranch, While
from robot.utils.asserts import assert_equal
IF = If.IF
ELSE_IF = If.ELSE_IF
ELSE = If.ELSE
TRY = Try.TRY
EXCEPT = Try.EXCEPT
FINALLY = Try.FINALLY
class TestFor(unittest.TestCase):
def test_string_reprs(self):
... |
5,477 | render settings box | # This file is part of Indico.
# Copyright (C) 2002 - 2023 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask import redirect, session
from werkzeug.exceptions import Forbidden
from indico.core import sig... |
5,478 | remote shutdown | # This file is part of Buildbot. Buildbot 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, but WITHOUT
# ANY WARRANTY; without eve... |
5,479 | test scan get partitions status results parts | # -*- coding: utf-8 -*-
import pytest
from .test_base_class import TestBaseClass
class TestScanGetPartitionsStatus(TestBaseClass):
@pytest.fixture(autouse=True)
def setup(self, request, as_connection):
self.test_ns = "test"
self.test_set = "demo"
self.partition_1000_count = 0
... |
5,480 | test smoothed box prior log prob log | #!/usr/bin/env python3
import math
import unittest
import torch
from gpytorch.priors import SmoothedBoxPrior
from gpytorch.test.utils import approx_equal, least_used_cuda_device
class TestSmoothedBoxPrior(unittest.TestCase):
def test_smoothed_box_prior_to_gpu(self):
if torch.cuda.is_available():
... |
5,481 | create support tickets | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
5,482 | expiration date | # 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
__all__ ... |
5,483 | test multiplication | # -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numpy as np
from numpy.testing import assert_allclose
import pytest
import vispy.visuals.transforms as tr
from vispy.geometry import Rect
from vispy.tes... |
5,484 | 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 . imp... |
5,485 | stop ocr server process | import argparse
import multiprocessing
import pickle
from module.logger import logger
from module.webui.setting import State
process: multiprocessing.Process = None
class ModelProxy:
client = None
online = True
@classmethod
def init(cls, address="127.0.0.1:22268"):
import zerorpc
cl... |
5,486 | paths | #
# See top-level LICENSE.rst file for Copyright information
#
# -*- coding: utf-8 -*-
"""
desispec.pipeline.tasks.preproc
===============================
"""
from __future__ import absolute_import, division, print_function
import os
import re
from collections import OrderedDict
from ..defs import (task_name_sep, ... |
5,487 | assert eq | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... |
5,488 | test repo update branch |
# Copyright 2016 Battelle Energy Alliance, 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 agr... |
5,489 | parse authors | # -*- coding: utf-8 -*-
"""
# TODO: Read the TODOs carefully and remove all existing comments in this file.
This is a sample using the ChapterWithVolumeBrowserTemplate as the template.
It provides a wrapper around the GeneralBrowserTemplate that generates both
the chapter list and optionally the volume list.
Put your... |
5,490 | task | # Copyright 2021 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... |
5,491 | adapt | """ Codec for the Punicode encoding, as specified in RFC 3492
Written by Martin v. Löwis.
"""
import codecs
##################### Encoding #####################################
def segregate(str):
"""3.1 Basic code point segregation"""
base = bytearray()
extended = set()
for c in str:
if ord... |
5,492 | run self scheduler simulator | #################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES).
#
# Copyright (c) 2018-2023 by the software own... |
5,493 | test count filter group by | from tests.testmodels import Author, Book
from tortoise.contrib import test
from tortoise.functions import Avg, Count, Sum, Upper
class TestGroupBy(test.TestCase):
async def asyncSetUp(self) -> None:
await super(TestGroupBy, self).asyncSetUp()
self.a1 = await Author.create(name="author1")
... |
5,494 | initialize | """
Base module for all text based default handler.
Contains various text based utility methods
"""
import logging
import os
import re
import string
import unicodedata
from abc import ABC
import torch
import torch.nn.functional as F
from captum.attr import LayerIntegratedGradients
from torchtext.data.utils import get_... |
5,495 | get index | '''
Camera
======
Core class for acquiring the camera and converting its input into a
:class:`~kivy.graphics.texture.Texture`.
.. versionchanged:: 1.10.0
The pygst and videocapture providers have been removed.
.. versionchanged:: 1.8.0
There is now 2 distinct Gstreamer implementation: one using Gi/Gst
wo... |
5,496 | test pipeline communicate no sync | from collections import deque
from functools import partial
from typing import List
import pytest
import psycopg
from psycopg import waiting
from psycopg import pq
from psycopg.conninfo import conninfo_to_dict, make_conninfo
def test_connect_operationalerror_pgconn(generators, dsn, monkeypatch):
"""Check that w... |
5,497 | real random vector | # -*- coding: utf-8 -*-
# This file is part of the pyMOR project (https://www.pymor.org).
# Copyright pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
from pymor.core.config import config
config.require('DUNEGDT')
from numbers impo... |
5,498 | run | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
5,499 | test active stop greater than timestep | '''
Test some of the base class functionality independent of derived classes.
Just simpler to do the testing here
Tests the Process methods and the Mover's get_move
'''
from datetime import datetime, timedelta
import numpy as np
from pytest import raises
from ..conftest import sample_sc_release
from gnome.utilitie... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.