id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
5,100 | test horizontal rois |
from caffe2.python import core, workspace
from hypothesis import given
import caffe2.python.hypothesis_test_util as hu
import hypothesis.strategies as st
import numpy as np
import copy
class RoIAlignRotatedOp(hu.HypothesisTestCase):
def bbox_xywh_to_xyxy(self, boxes):
"""
Convert from [center... |
5,101 | create from axis angle | # -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# Based on the quaternion class in the visvis project.
import numpy as np
class Quaternion(object):
"""Quaternion(w=1, x=0, y=0, z=0, normalize=True)
... |
5,102 | transform | # Author: Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Jean-Remi King <jeanremi.king@gmail.com>
#
# License: BSD-3-Clause
from collections import Counter
import numpy as np
from .mixin import TransformerMixin, EstimatorMixin
from .base import _set_cv
... |
5,103 | construct extra parameters | # -*- coding: utf-8 -*-
#
# 2017-07-13 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# Add period to key uri for TOTP token
# 2016-05-21 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# urlencode token isuuer.
# 2015-07-01 Cornelius Kölbel <cornelius.koelbel@netknights.it>
# ... |
5,104 | create test sa synchronize | import rebound
import unittest
import warnings
class TestSimulationArchiveMatrix(unittest.TestCase):
pass
def runSimulation(test,tmax=40., restart=False, keep_unsynchronized=1, interval=None, safe_mode=True, integrator="ias15",G=1., testparticle=0,simulationarchive_version=3):
if restart:
if keep_unsy... |
5,105 | test zero eps | # 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 argparse
import copy
import unittest
import torch
from fairseq.criterions.cross_entropy import CrossEntropyCriterion
from fairseq.cri... |
5,106 | location | # 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,107 | boost build testing support timing rule with | #!/usr/bin/env python3
# Copyright 2005 David Abrahams
# Copyright 2008, 2012 Jurko Gospodnetic
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at
# https://www.bfgroup.xyz/b2/LICENSE.txt)
# Tests the build step timing facilities.
# TODO: Missing tests:
# 1. ... |
5,108 | get metadata | # -*- coding: utf-8 -*-
#
# Copyright (C) 2021-2023 CERN.
# Copyright (C) 2021 data-futures.
# Copyright (C) 2022 Universität Hamburg.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""IIIF Presentation API Sch... |
5,109 | streams | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import json
import logging
from abc import ABC
from typing import Any, Iterable, List, Mapping, Optional, Tuple, Union
import requests
from airbyte_cdk.models import (
AirbyteStream,
ConfiguredAirbyteCatalog,
ConfiguredAirbyteStream,
Connect... |
5,110 | test inference list subscript | from typing import List
from astroid import nodes
from hypothesis import HealthCheck, given, settings
from pytest import skip
from python_ta.transforms.type_inference_visitor import NoType
from python_ta.typecheck.base import TypeFail, TypeFailFunction
from .. import custom_hypothesis_support as cs
settings.load_pr... |
5,111 | do convert | # Copyright (c) 2022 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,112 | refine copy | # -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2021-2022, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... |
5,113 | create typed dict doc | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
5,114 | register all modules | # Copyright (c) OpenMMLab. All rights reserved.
import datetime
import logging
import os
import platform
import warnings
import cv2
import torch.multiprocessing as mp
from mmengine import DefaultScope
from mmengine.logging import print_log
from mmengine.utils import digit_version
def setup_cache_size_limit_of_dynamo... |
5,115 | test offset transformer wrapper | # -*- coding: utf-8 -
"""Test the created constraints against approved constraints.
This file is part of project oemof (github.com/oemof/oemof). It's copyrighted
by the contributors recorded in the version control history of the file,
available from its original location oemof/tests/test_solph_network_classes.py
SPD... |
5,116 | check level |
from sage.all import (
cached_function, floor, Gamma1, dimension_new_cusp_forms,
dimension_eis, dimension_cusp_forms, dimension_modular_forms)
from lmfdb.lmfdb_database import db, SQL
from .mf import MfChecker, check_analytic_conductor
from .verification import overall, slow, fast, accumulate_failures
@cache... |
5,117 | add attachment | from collections.abc import Generator, Iterator, Sequence
from email import _ParamsType, _ParamType
from email.charset import Charset
from email.contentmanager import ContentManager
from email.errors import MessageDefect
from email.policy import Policy
from typing import Any, TypeVar, overload
from typing_extensions im... |
5,118 | test timers | import os
import time
from SpiffWorkflow.task import TaskState
from SpiffWorkflow.bpmn.PythonScriptEngine import PythonScriptEngine
from SpiffWorkflow.bpmn.PythonScriptEngineEnvironment import TaskDataEnvironment
from SpiffWorkflow.bpmn.serializer.migration.exceptions import VersionMigrationError
from .BaseTestCase i... |
5,119 | get tests | import os, sys, unittest, getopt, time
use_resources = []
import ctypes
ctypes_symbols = dir(ctypes)
def need_symbol(name):
return unittest.skipUnless(name in ctypes_symbols,
'{!r} is required'.format(name))
class ResourceDenied(unittest.SkipTest):
"""Test skipped because it ... |
5,120 | on mouse move | # Copyright © 2012-2023 Forschungszentrum Jülich GmbH
# SPDX-License-Identifier: LGPL-3.0-or-later
from jupedsim_visualizer.config import ZLayers
from vtkmodules.vtkCommonCore import vtkCommand, vtkPoints
from vtkmodules.vtkCommonDataModel import (
vtkCellArray,
vtkPolyData,
vtkPolyLine,
)
from vtkmodules.v... |
5,121 | can change keyword | # -*- 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... |
5,122 | description | # 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... |
5,123 | test read imageseries non external format | import numpy as np
from pathlib import Path
import warnings
from pynwb import NWBHDF5IO, validate, TimeSeries
from pynwb.image import ImageSeries
from pynwb.testing import TestCase
class TestReadOldVersions(TestCase):
expected_warnings = {
''
'2.1.0_imageseries_non_external_format.nwb': [(
... |
5,124 | establish connection | """`Dataset` class(es) for reading data from SQLite databases."""
from typing import Any, List, Optional, Tuple, Union
import pandas as pd
import sqlite3
from graphnet.data.dataset.dataset import Dataset, ColumnMissingException
class SQLiteDataset(Dataset):
"""Pytorch dataset for reading data from SQLite databa... |
5,125 | get input output buffer | #!/usr/bin/python3
#
# SPDX-License-Identifier: Apache-2.0
#
# Copyright (C) 2019-2021 Xilinx, Inc
#
import sys
import time
import math
# Following found in PYTHONPATH setup by XRT
import pyxrt
# utils_binding.py
sys.path.append('../')
from utils_binding import *
current_micro_time = lambda: int(round(time.time() ... |
5,126 | get estimate for fitperiod with data | import datetime
import pandas as pd
from syscore.genutils import str2Bool
from syscore.constants import arg_not_supplied
from sysquant.fitting_dates import fitDates
from sysquant.estimators.correlations import (
correlationEstimate,
create_boring_corr_matrix,
modify_correlation,
)
from sysquant.estimators.g... |
5,127 | test use service supported args | # -*- coding: utf-8 -*-
import unittest
from unittest.mock import Mock
from django import test
from tcms.issuetracker import services
from tcms.issuetracker.services import IssueTrackerService
from tests import BaseCaseRun
from tests import factories as f
class TestFindService(test.TestCase):
"""Test factory m... |
5,128 | jacobian | #
# HES1 Michaelis-Menten model of regulatory dynamics.
#
# 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 pints
import scipy
from . import ToyO... |
5,129 | run | #!/usr/bin/env python
"""
Horizontal align demo with HSplit.
"""
from prompt_toolkit.application import Application
from prompt_toolkit.formatted_text import HTML
from prompt_toolkit.key_binding import KeyBindings
from prompt_toolkit.layout.containers import (
HorizontalAlign,
HSplit,
VerticalAlign,
VSp... |
5,130 | test 2019 | # python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2... |
5,131 | test post call with path setup with | import pytest
import requests
from parameterized import parameterized_class
from tests.integration.local.start_api.start_api_integ_base import StartApiIntegBaseClass
@parameterized_class(
("template_path",),
[
("/testdata/start_api/cdk/template-rest-api.yaml",),
("/testdata/start_api/cdk/temp... |
5,132 | get record | """
Match script, useful for public matches. Features verbose announcements
on IRC and a custom timer.
Commands
^^^^^^^^
* ``/timer`` starts timer *admin only*
* ``/stoptimer`` stops timer *admin only*
* ``/startrecord`` starts a fresh records *admin only*
* ``/stoprecord`` clears the current record *admin only*
* ``... |
5,133 | way | #-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frédéric Rodrigo 2018 ##
## ... |
5,134 | 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 ... |
5,135 | test load 1 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2013 Stanford University and the Authors
#
# Authors: Gregory Bowman
# Contributors: Robert McGibbon
#
# MDTraj is f... |
5,136 | test force token predictions | import pytest
import flair
from flair.embeddings import FlairEmbeddings, WordEmbeddings
from flair.models import SequenceTagger
from flair.trainers import ModelTrainer
from tests.model_test_utils import BaseModelTest
class TestSequenceTagger(BaseModelTest):
model_cls = SequenceTagger
pretrained_model = "ner-... |
5,137 | setup repository modules | # Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... |
5,138 | ignore registration fields | """
Forms for events
"""
import operator
from django.forms import (
BooleanField,
ChoiceField,
DateField,
DateInput,
Form,
ModelForm,
ValidationError,
)
from django.forms.models import fields_for_model
from django.forms.widgets import RadioSelect
from .models import Event
class EventForm... |
5,139 | write raw | """
A mixin module for USB Human Interface Device instruments
"""
import os
import struct
import time
from typing import Any, Optional
try:
import pywinusb.hid as hid # pyright: ignore[reportMissingModuleSource]
imported_hid = True
except ImportError:
# We will raise a proper error when we attempt to ins... |
5,140 | test cvm marked op stop not filter | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import time
import pytest
from tc_common import BaseTest
from test_tc_cvm import assert_instance_states
def get_tags(policy, resource):
r = dict(resource)
policy.resource_manager.source.get_resource_tag([r])
return {t['Key']:... |
5,141 | exact laplacian kernel | # Copyright 2018 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,142 | check policy exists | from core.providers.aws.boto3 import prepare_aws_client_with_given_cred
from core.providers.aws.boto3 import prepare_aws_resource_with_given_cred
import boto3
def get_iam_client(aws_auth_cred):
"""
Returns the client object for AWS IAM
Args:
aws_auth_cred (dict): AWS Auth details with region info... |
5,143 | test c1 projections | # coding: utf-8
import numpy as np
import pytest
from mpi4py import MPI
from sympde.topology.analytical_mapping import PolarMapping
from psydac.polar.c1_projections import C1Projector
from psydac.mapping.discrete import SplineMapping
from psydac.linalg.stencil import StencilVector, StencilMatrix
from psyda... |
5,144 | test spelling | import gc
import os
import tempfile
from clang.cindex import CursorKind
from clang.cindex import Cursor
from clang.cindex import File
from clang.cindex import Index
from clang.cindex import SourceLocation
from clang.cindex import SourceRange
from clang.cindex import TranslationUnitSaveError
from clang.cindex import Tr... |
5,145 | drop table from database | from __future__ import annotations
import logging
from pathlib import Path
from typing import TYPE_CHECKING
logger = logging.getLogger(__name__)
# https://stackoverflow.com/questions/39740632/python-type-hinting-without-cyclic-imports
if TYPE_CHECKING:
from .linker import Linker
class SplinkDataFrame:
"""A... |
5,146 | extract buck binary | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# @starlark-rust: allow_string_literals_in_type_expr
"""
WARNING: you probably don't actually want this
extract.bzl exists for very strippe... |
5,147 | get subparser | """
The DSL is used for RPC and resource definition. The syntax of the DSL is same
as UNIX shell.
>>> req = parse("search jaychou -s=xx")
>>> req.cmd
'search'
>>> req.cmd_args
['jaychou']
"""
import argparse
import shlex
import itertools
from typing import Optional
from feeluown.argparser import (
create_fmt_par... |
5,148 | mm | from meerk40t.core.units import MM_PER_INCH, UNITS_PER_INCH, Length
from meerk40t.svgelements import Matrix
class View:
def __init__(
self, width, height, dpi=float(UNITS_PER_INCH), dpi_x=None, dpi_y=None
):
"""
This should init the simple width and height dimensions.
The defa... |
5,149 | test remove all | import pytest
from funcy import first
from dvc.exceptions import InvalidArgumentError
from dvc.repo.experiments.exceptions import UnresolvedExpNamesError
from dvc.repo.experiments.utils import exp_refs_by_rev
def test_remove_experiments_by_ref(tmp_dir, scm, dvc, exp_stage, caplog):
queue_length = 3
ref_info_... |
5,150 | delete settings cache | from decimal import Decimal
import django
from django.core.cache import cache
from django.conf import settings as d_settings
from tendenci.apps.site_settings.models import Setting
from tendenci.apps.site_settings.cache import SETTING_PRE_KEY
def get_setting_key(items=[]):
"""
Generate a setting key string fr... |
5,151 | test rolling before analysis | import copy
import math
from unittest import TestCase
from matplotlib import pyplot as plt
from skimage.transform import rotate
from pylinac.cheese import TomoCheese, TomoCheeseResult
from tests_basic.utils import (
CloudFileMixin,
FromDemoImageTesterMixin,
FromURLTesterMixin,
FromZipTesterMixin,
... |
5,152 | test string vectorised | # Copyright Iris contributors
#
# This file is part of Iris and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Test function :func:`iris.coord_categorisation.add_categorised_coord`."""
# import iris tests first so that some things can... |
5,153 | expand rates | # Copyright (c) OpenMMLab. All rights reserved.
import copy
import numpy as np
import torch
import torch.nn as nn
from mmengine.logging import print_log
from mmengine.model import BaseModule
from torch import Tensor
from .utils import METHOD_NAME, get_single_padding
class BaseConvRFSearchOp(BaseModule):
"""Base... |
5,154 | determine pydantic field type | import copy
import string
from random import choices
from typing import (
Any,
Callable,
Dict,
List,
Optional,
Set,
TYPE_CHECKING,
Type,
Union,
cast,
)
import pydantic
from pydantic.fields import ModelField
from ormar.models.mixins.relation_mixin import RelationMixin # noqa: I... |
5,155 | visit bool op | # -*- coding: utf-8 -*-
"""
eve.io.mongo.parser
~~~~~~~~~~~~~~~~~~~
This module implements a Python-to-Mongo syntax parser. Allows the MongoDB
data-layer to seamlessly respond to a Python-like query.
:copyright: (c) 2017 by Nicola Iarocci.
:license: BSD, see LICENSE for more details.
"""
imp... |
5,156 | download video file | from googleapiclient.errors import HttpError
import cv2
import logging
from dataclasses import dataclass
from typing import Any
from google_api.sdk import youtube_videos_insert, youtube_videos_set_thumbnail
from users.client import get_users_data_by_ids_async
from temporalio import activity
from schedule.models import ... |
5,157 | name | # 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,158 | set status | # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from pypika import CustomFunction
import frappe
from frappe import _
from frappe.query_builder.functions import Avg
from frappe.utils import cint, flt
from frappe.utils.nestedset import NestedSet
fr... |
5,159 | validate files | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright European Organization for Nuclear Research (CERN) since 2012
#
# 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.apach... |
5,160 | get children | import ast as python_ast
from typing import Any, Optional, Sequence, Type, Union
from .natspec import parse_natspec as parse_natspec
from .utils import ast_to_dict as ast_to_dict
from .utils import parse_to_ast as parse_to_ast
from .utils import parse_to_ast_with_settings as parse_to_ast_with_settings
NODE_BASE_ATTRI... |
5,161 | modify existing color table | # ----------------------------------------------------------------------------
# CLASSES: nightly
#
# Test Case: colortables.py
#
# Programmer: Kathleen Biagas
# Date: March 30, 2022
#
# Modificatons:
# Justin Privitera, Wed Aug 3 19:46:13 PDT 2022
# Made changes to reflect the fact that built-in ta... |
5,162 | score partial | # 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... |
5,163 | test cash bad truncation | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from gammapy import stats
@pytest.fixture
def test_data():
"""Test data for fit statistics tests"""
test_data = dict(
mu_sig=[
0.59752422,
... |
5,164 | package | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.apple import fix_apple_shared_install_name
from conan.tools.env import VirtualBuildEnv
from conan.tools.files import copy, get, rmdir
from conan.tools.build import check_min_cppstd
from conan.tools.layout import basic_layout... |
5,165 | test adjust no op | # Copyright 2022 The KerasCV Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
5,166 | test smoke origin | # This file is part of Checkbox.
#
# Copyright 2014 Canonical Ltd.
# Written by:
# Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
#
# Checkbox is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3,
# as published by the Free Software Foundation.
#
... |
5,167 | get timed out failure event | from __future__ import annotations
import abc
from localstack.aws.api.stepfunctions import (
HistoryEventExecutionDataDetails,
HistoryEventType,
TaskScheduledEventDetails,
TaskStartedEventDetails,
TaskSucceededEventDetails,
TaskTimedOutEventDetails,
)
from localstack.services.stepfunctions.asl... |
5,168 | colormap | # Copyright (c) Facebook, Inc. and its affiliates.
"""
An awesome colormap for really neat visualizations.
Copied from Detectron, and removed gray colors.
"""
import numpy as np
import random
__all__ = ["colormap", "random_color", "random_colors"]
# fmt: off
# RGB:
_COLORS = np.array(
[
0.000, 0.447, 0.... |
5,169 | group conv1d ncw | # 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... |
5,170 | list tags | """Handles incoming cloudtrail requests, invokes methods, returns responses."""
import json
from typing import Any, Dict
from moto.core.responses import BaseResponse
from .models import cloudtrail_backends, CloudTrailBackend
from .exceptions import InvalidParameterCombinationException
class CloudTrailResponse(BaseRes... |
5,171 | lambda error to dead letter queue | import json
import logging
import uuid
from typing import Dict, List
from localstack.aws.connect import connect_to
from localstack.utils.aws import arns
from localstack.utils.aws.aws_models import LambdaFunction
from localstack.utils.strings import convert_to_printable_chars, first_char_to_upper
LOG = logging.getLogg... |
5,172 | test check timeseries scalar | '''
Basic tests for timeseries
'''
from datetime import datetime
import numpy as np
from pytest import raises
from gnome.basic_types import datetime_value_2d
from gnome.utilities.timeseries import Timeseries, TimeseriesError
from ..conftest import testdata
wind_file = testdata['timeseries']['wind_ts']
def te... |
5,173 | event loop task | """Contains the EventManager class. See :mod:`.EventManagerGlobal` for the
global eventMgr instance."""
__all__ = ['EventManager']
from direct.directnotify.DirectNotifyGlobal import directNotify
from direct.task.TaskManagerGlobal import taskMgr
from direct.showbase.MessengerGlobal import messenger
from panda3d.core... |
5,174 | reint | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
""" Tests for reshaping and reinterpretation of existing arrays. """
import dace
import numpy as np
import pytest
N = dace.symbol('N')
def test_reshape():
""" Array->View->Tasklet """
@dace.program
def reshp(A: dace.float64[2, 3,... |
5,175 | test specifications combo box enabled if item | ######################################################################################################################
# Copyright (C) 2017-2022 Spine project consortium
# This file is part of Spine Toolbox.
# Spine Toolbox is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser Gen... |
5,176 | test person birth date should be in | from pytest import mark
import re
def test_person_headshot_should_be_an_image_link(ia):
person = ia.get_person('0000206', info=['biography']) # Keanu Reeves
assert re.match(r'^https?://.*\.jpg$', person['headshot'])
def test_person_full_size_headshot_should_be_an_image_link(ia):
person = ia.get_perso... |
5,177 | zeros state | # Copyright 2020 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
5,178 | errorhandler method | import unittest
from unittest import mock
import octoprint.plugin
class BlueprintPluginTest(unittest.TestCase):
def setUp(self):
self.basefolder = "/some/funny/basefolder"
self.plugin = octoprint.plugin.BlueprintPlugin()
self.plugin._basefolder = self.basefolder
class MyAssetPlu... |
5,179 | test set max and skip runs | #!/usr/bin/env python
"""
_Mask_
Unittest for the WMCore.DataStructs.Mask class
"""
# This code written as essentially a blank for future
# Mask development
# -mnorman
import unittest
from WMCore.DataStructs.Mask import Mask
from WMCore.DataStructs.Run import Run
class MaskTest(unittest.TestCase):
"""
_... |
5,180 | test read open sink | import pipes
import os
import string
import unittest
from test.test_support import TESTFN, run_unittest, unlink, reap_children
if os.name != 'posix':
raise unittest.SkipTest('pipes module only works on posix')
TESTFN2 = TESTFN + "2"
# tr a-z A-Z is not portable, so make the ranges explicit
s_command = 'tr %s %s'... |
5,181 | source subfolder | from conans import CMake, ConanFile, tools
import os
required_conan_version = ">=1.43.0"
class LibCheckConan(ConanFile):
name = "libcheck"
description = "A unit testing framework for C"
topics = ("libcheck", "unit", "testing", "framework", "C")
license = "LGPL-2.1-or-later"
homepage = "https://gi... |
5,182 | process captcha | # -*- coding: utf-8 -*-
import base64
import json
import re
import time
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from pyload.core.network.request_factory import get_request
from pyload.core.utils.convert import to_str
from ..base.addon import BaseAddon, threaded
class DeathByCaptchaE... |
5,183 | shutdown | import logging
import argparse
import random
from torch import Tensor
from pydantic import BaseModel, Field
from typing import Optional
from energonai.model import opt_125M, opt_30B, opt_175B, opt_6B
from transformers import GPT2Tokenizer
from energonai import launch_engine, QueueFullError
from sanic import Sanic
from ... |
5,184 | rmd | import sys
from _typeshed import SupportsRead, SupportsReadline
from collections.abc import Callable, Iterable, Iterator
from socket import socket
from ssl import SSLContext
from types import TracebackType
from typing import Any, TextIO
from typing_extensions import Literal, Self
__all__ = ["FTP", "error_reply", "erro... |
5,185 | start | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 28 16:00:07 2018
@author: wmd22
"""
from __future__ import print_function
from builtins import zip
from builtins import str
from nplab.ui.ui_tools import QuickControlBox
from nplab.utils.notified_property import NotifiedProperty
from nplab.utils.gui import QtWidgets
from ... |
5,186 | regex for deprecation comments | import glob
import re
from typing import List, Pattern, Tuple, cast
import pytest
from packaging import version
from great_expectations.data_context.util import file_relative_path
UNNEEDED_DEPRECATION_WARNINGS_THRESHOLD = 7
# module level markers
pytestmark = pytest.mark.unit
@pytest.fixture
def METHOD_NAME() -> ... |
5,187 | signer state3 | '''
:Partially Blind Signature Scheme
| From: "M. Abe, T. Okamoto Provably Secure Partially Blind Signatures"
| Published in: CRYPTO 2000
| Available from: http://www.iacr.org/archive/crypto2000/18800272/18800272.pdf
* type: signature (partially blind)
* setting: integer groups
:Authors: Antonio... |
5,188 | longest common prefix length | import re
from typing import List, Optional
import numpy as np
from nltk.tokenize.treebank import TreebankWordTokenizer
from helm.benchmark.adaptation.request_state import RequestState
from helm.benchmark.adaptation.adapter_spec import AdapterSpec
from helm.benchmark.scenarios.scenario import Reference
from helm.comm... |
5,189 | 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,190 | adjust toolbar style | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
import time
from qtpy.QtCore import Qt
from qtpy.QtGui import QColor
from qtpy.QtWidgets import QToolBar
from qtpy.QtPrintSupport import QPrinter, QPrintPreviewDialo... |
5,191 | start platform svc | #!/usr/bin/env python
# Script to stop and start the respective platforms default services.
# This will be used while switching the pddf->non-pddf mode and vice versa
from sonic_py_common.general import getstatusoutput_noshell
def check_pddf_support():
return True
def stop_platform_svc():
status, output = g... |
5,192 | fsisph | from SpheralCompiledPackages import *
from spheralDimensions import spheralDimensions
dims = spheralDimensions()
def METHOD_NAME(dataBase,
W,
Q = None,
slides=None,
filter = 0.0,
cfl = 0.35,
surfaceForceCoefficient=0.0,
densityStabilizationCoefficient=0.1,
... |
5,193 | required packages | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import range, str
import logging
import os
import typing
from typing import Any
from typing import Dict
from typing import List
from typing import Optional... |
5,194 | init context | # -*- coding: utf-8 -*-
"""
hyper/tls
~~~~~~~~~
Contains the TLS/SSL logic for use in hyper.
"""
import os.path as path
from .common.exceptions import MissingCertFile
from .compat import ignore_missing, ssl
NPN_PROTOCOL = 'h2'
H2_NPN_PROTOCOLS = [NPN_PROTOCOL, 'h2-16', 'h2-15', 'h2-14']
SUPPORTED_NPN_PROTOCOLS = H2_... |
5,195 | handle | import requests
from candidates.models import Ballot
from django.core.files.base import ContentFile
from django.core.management.base import BaseCommand
from elections.models import Election
from official_documents.models import OfficialDocument
class Command(BaseCommand):
"""This command uses the ballots endpoint... |
5,196 | test prints help with incorrect flag style | #!/usr/bin/env python
#
# Copyright 2009, 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,197 | test execute for vo bad config | """ Test class for PilotLoggingAgent Agent
"""
import os
import time
import tempfile
import pytest
from unittest.mock import MagicMock, patch
# DIRAC Components
import DIRAC.WorkloadManagementSystem.Agent.PilotLoggingAgent as plaModule
from DIRAC.WorkloadManagementSystem.Agent.PilotLoggingAgent import PilotLoggingAge... |
5,198 | favicon | # 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.
import os
from flask import Response, current_app, redirect, request, send_from_directory
from werkzeug.e... |
5,199 | flex 50u l tiprack | """ProtocolEngine shared test fixtures."""
from __future__ import annotations
import pytest
from typing import TYPE_CHECKING
from decoy import Decoy
from opentrons_shared_data import load_shared_data
from opentrons_shared_data.deck import load as load_deck
from opentrons_shared_data.deck.dev_types import DeckDefiniti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.