id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
9,600
package info
import os from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import cross_building from conan.tools.files import apply_conandata_patches, copy, chdir, export_conandata_patches, get, rmdir from conan.tools.gnu import Autotools, AutotoolsToolchain from conan.tools.layou...
9,601
test recursive repr
"""Unit tests for collections.defaultdict.""" import os import copy import pickle import tempfile import unittest from test import support from collections import defaultdict def foobar(): return list class TestDefaultDict(unittest.TestCase): def test_basic(self): d1 = defaultdict() self.as...
9,602
test rx tx max id
#!/usr/bin/env python """ This module is testing the serial interface. Copyright: 2017 Boris Wenzlaff """ import unittest from unittest.mock import patch import can from can.interfaces.serial.serial_can import SerialBus from .config import IS_PYPY from .message_helper import ComparingMessagesTestCase # Mentioned ...
9,603
level moderation
from __future__ import absolute_import from __future__ import division from common.models import Student, Class from django.shortcuts import render from portal.templatetags import app_tags import game.messages as messages import game.permissions as permissions from game.forms import LevelModerationForm from game.mode...
9,604
test dict redirect
import sys import unittest from unittest.mock import Mock from ..utils import ( build_absolute_uri, partial_pipeline_data, sanitize_redirect, slugify, user_is_active, user_is_authenticated, ) from .models import TestPartial PY3 = sys.version_info[0] == 3 class SanitizeRedirectTest(unittest.T...
9,605
is vertical
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2021 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it a...
9,606
draw
# -*- coding: utf-8 -*- # ##### BEGIN GPL LICENSE BLOCK ##### # # 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. # # ...
9,607
test install restart
""" Test the win_wusa execution module """ import pytest import salt.modules.win_wusa as win_wusa from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch pytestmark = [ pytest.mark.windows_whitelisted, pytest.mark.skip_unless_on_windows, ] @pytest.fixture def confi...
9,608
get entropy
"""Calculation of free energy of one-electronic states.""" # Copyright (C) 2018 Atsushi Togo # All rights reserved. # # This file is part of phonopy. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributio...
9,609
write data
# pywws - Python software for USB Wireless Weather Stations # http://github.com/jim-easterbrook/pywws # Copyright (C) 2008-20 pywws contributors # 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;...
9,610
test gil released inside lifted loop
import ctypes import ctypes.util import os import sys import threading import warnings import numpy as np import unittest from numba.core.compiler import compile_isolated, Flags from numba import jit from numba.core import errors from numba.tests.support import TestCase, tag # This CPython API function is a portabl...
9,611
jsemit suite node
"""Templetor extension to support javascript templates. During AJAX development, there will be need to generate HTML and update some part of the DOM. It it clumsy to do that in javascript. Even though there are some javascript template engines, it often ends up in duplication because of writing a Python template and a...
9,612
test phaseplot set ylim
import os import shutil import tempfile import unittest import pytest import yt from yt.testing import assert_allclose_units, fake_random_ds from yt.visualization.api import PhasePlot class TestPhasePlotAPI: @classmethod def setup_class(cls): cls.ds = fake_random_ds( 16, fields=("density...
9,613
create response
from pubnub.endpoints.file_operations.file_based_endpoint import FileOperationEndpoint from pubnub.crypto import PubNubFileCrypto from pubnub.enums import HttpMethod, PNOperationType from pubnub.models.consumer.file import PNSendFileResult from pubnub.endpoints.file_operations.publish_file_message import PublishFileMe...
9,614
flatten aggregations
from copy import deepcopy from enum import Enum from typing import List, Union from urllib.parse import urlparse import pandas as pd from elasticsearch import Elasticsearch from pandas.io.json import json_normalize from pydantic import BaseModel, Field, SecretStr from toucan_connectors.common import nosql_apply_param...
9,615
get learning rate
"""Training algorithm track submission functions for LibriSpeech.""" import functools from typing import Dict, Iterator, List, Tuple from absl import logging from flax import jax_utils import jax from jax import lax import jax.numpy as jnp import numpy as np import optax from algorithmic_efficiency import spec _GRAD...
9,616
test pre phase
import pytest import rules from adhocracy4.projects.enums import Access from adhocracy4.test.helpers import freeze_phase from adhocracy4.test.helpers import freeze_post_phase from adhocracy4.test.helpers import freeze_pre_phase from adhocracy4.test.helpers import setup_phase from adhocracy4.test.helpers import setup_u...
9,617
test get
from typing import List import pytest @pytest.mark.apitest class TestFind: async def test_find(self, fake2, snapshot, spawn_client): """ Test that a ``GET /labels`` return a complete list of labels. """ client = await spawn_client(authorize=True, administrator=True) labe...
9,618
pyinit
#------------------------------------------------------------------------------- # GSPHHydroBase #------------------------------------------------------------------------------- from PYB11Generator import * from GenericRiemannHydro import * from RestartMethods import * @PYB11template("Dimension") @PYB11module("Spheral...
9,619
test pickle named sharding
# Copyright 2021 The JAX 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 wri...
9,620
dispatch msc
#!/usr/bin/python # -*- coding: utf-8; -*- # # (c) 2012 Mandriva, http://www.mandriva.com/ # # This file is part of Pulse 2, http://pulse2.mandriva.org # # Pulse 2 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 Foundatio...
9,621
init state
"""ScorerInterface implementation for CTC.""" import numpy as np import torch from espnet.nets.ctc_prefix_score import CTCPrefixScore, CTCPrefixScoreTH from espnet.nets.scorer_interface import BatchPartialScorerInterface class CTCPrefixScorer(BatchPartialScorerInterface): """Decoder interface wrapper for CTCPre...
9,622
connect
import pytest import datetime as dt from typing import Any, Dict import psycopg from psycopg.conninfo import conninfo_to_dict from . import dbapi20 from . import dbapi20_tpc @pytest.fixture(scope="class") def with_dsn(request, session_dsn): request.cls.connect_args = (session_dsn,) @pytest.mark.usefixtures("w...
9,623
get parent
# -*- coding: utf-8 -*- # # ast_input_block.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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...
9,624
get supported forks
""" Utilities for the EVM tools """ import json import logging import sys from typing import Any, Callable, Dict, Optional, Tuple, TypeVar import coincurve from ethereum.base_types import U64, U256, Uint from ethereum.crypto.hash import Hash32 from ..forks import Hardfork W = TypeVar("W", Uint, U64, U256) EXCEPTI...
9,625
draw phil object
from __future__ import absolute_import, division, print_function from wx.lib.agw import customtreectrl import wx from libtbx.utils import Sorry import re class PhilTreeCtrl(customtreectrl.CustomTreeCtrl): def __init__(self, *args, **kwds): kwds = dict(kwds) kwds['agwStyle'] = wx.TR_HAS_VARIABLE_ROW_HEIGHT|w...
9,626
test get running rhel containers both ok
import pytest from mock.mock import patch from insights.core.context import HostContext from insights.core.exceptions import SkipComponent from insights.parsers.docker_list import DockerListContainers from insights.parsers.podman_list import PodmanListContainers from insights.specs.datasources.container import runnin...
9,627
prepare
""" ArgumentEffects computes write effect on arguments. """ from pythran.analyses.aliases import Aliases from pythran.analyses.intrinsics import Intrinsics from pythran.analyses.global_declarations import GlobalDeclarations from pythran.passmanager import ModuleAnalysis from pythran.tables import MODULES from pythran....
9,628
get formula error
""" This module defines what sandbox functions are made available to the Node controller, and starts the grist sandbox. See engine.py for the API documentation. """ import os import random import sys sys.path.append('thirdparty') # pylint: disable=wrong-import-position import logging import marshal import functools i...
9,629
app
import contextlib import datetime import functools import itertools import os import random import signal as stdlib_signal import string import uuid import aiopg import psycopg2 import pytest from psycopg2 import sql from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT from procrastinate import aiopg_connector ...
9,630
get open data params schema
# The MIT License (MIT) # Copyright (c) 2023 by the xcube team and contributors # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the right...
9,631
time einsum i ij j
from .common import Benchmark, get_squares_, get_indexes_rand, TYPES1 import numpy as np class Eindot(Benchmark): def setup(self): self.a = np.arange(60000.0).reshape(150, 400) self.ac = self.a.copy() self.at = self.a.T self.atc = self.a.T.copy() self.b = np.arange(240000....
9,632
test data review cascades
# # This file is part of HEPData. # Copyright (C) 2020 CERN. # # HEPData 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. # # HEPData is...
9,633
all classes
from GangaCore.Utility.logging import getLogger from GangaCore.Core.exceptions import GangaValueError logger = getLogger() class PluginManagerError(GangaValueError): def __init__(self, x): super(PluginManagerError, self).__init__(self, x) # Simple Ganga Plugin Mechanism # # Any object may be registered ...
9,634
link or merge
from __future__ import annotations from typing import Any, Generator, List, Optional, Set, Tuple, Union from astroid import Break, Continue, NodeNG, Raise, Return class ControlFlowGraph: """A graph representing the control flow of a Python program.""" start: CFGBlock end: CFGBlock # The unique id o...
9,635
create event with body inner
import json import os from pytest import fixture from hypothesis import settings, HealthCheck from chalice.app import Chalice # From: # http://hypothesis.readthedocs.io/en/latest/settings.html#settings-profiles # On travis we'll have it run through more iterations. from chalice.deploy import models settings.registe...
9,636
ballot item retrieve view
# apis_v1/views/views_ballot.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from ballot.controllers import all_ballot_items_retrieve_for_api, ballot_item_highlights_retrieve_for_api, \ ballot_item_options_retrieve_for_api, ballot_items_search_retrieve_for_api from candidate.controllers import cand...
9,637
visit alternate type
#!/usr/bin/env python3 # # QAPI parser test harness # # Copyright (c) 2013 Red Hat Inc. # # Authors: # Markus Armbruster <armbru@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. # import argparse import difflib import os impo...
9,638
test deserialize
from pathlib import Path import pytest import yaml from azure.ai.ml import Input, load_job from azure.ai.ml._restclient.v2023_04_01_preview.models import InputDeliveryMode, JobOutputType, OutputDeliveryMode from azure.ai.ml._schema import SparkJobSchema from azure.ai.ml.constants._common import BASE_PATH_CONTEXT_KEY ...
9,639
query list versions
# Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS from __future__ import annotations from typing import Dict, Tuple import triopg from parsec._parsec import DateTime, DeviceID, OrganizationID, RealmID, VlobID from parsec.backend.postgresql.utils import ( Q, q_device, q_...
9,640
test bosch hale d d he3p
# bluemira is an integrated inter-disciplinary design tool for future fusion # reactors. It incorporates several modules, some of which rely on other # codes, to carry out a range of typical conceptual fusion reactor design # activities. # # Copyright (C) 2021-2023 M. Coleman, J. Cook, F. Franza, I.A. Maione, S. McInto...
9,641
test signmessage
# This file is part of the Trezor project. # # Copyright (C) 2012-2021 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distrib...
9,642
create user
from __future__ import annotations import functools import secrets from typing import TYPE_CHECKING, List, Optional from aiohttp import ClientResponseError from iambic.core.context import ctx from iambic.core.logger import log from iambic.core.models import ProposedChange, ProposedChangeType from iambic.core.utils i...
9,643
url parameters
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
9,644
test top k zeros
# 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...
9,645
list books by author
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Purpose Shows how to implement routing for a lending library REST API that uses AWS Chalice. Book, patron, and lending data is accessed through a serverless Amazon Aurora database. This file is deployed to ...
9,646
test copy kms
# # 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 us...
9,647
draw buttons
# This file is part of project Sverchok. It's copyrighted by the contributors # recorded in the version control history of the file, available from # its original location https://github.com/nortikin/sverchok/commit/master # # SPDX-License-Identifier: GPL3 # License-Filename: LICENSE from typing import List, Dict imp...
9,648
reflection added
from ....model.util.HelperModule import get_partial_index # imports for type hinting in PyCharm -- DO NOT DELETE from ....model.DioptasModel import DioptasModel from ....widgets.integration import BatchWidget from ....widgets.plot_widgets.ImgWidget import IntegrationImgWidget class PhaseInBatchController(object): ...
9,649
add custom teardown
import json import logging from contextlib import contextmanager from typing import TYPE_CHECKING, Callable, Optional import aws_cdk as cdk from typing_extensions import Self from localstack.testing.aws.util import is_aws_cloud if TYPE_CHECKING: from mypy_boto3_s3 import S3Client from localstack.aws.api.cloudfo...
9,650
close event
# 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...
9,651
test attempt update nonexistent user
from __future__ import annotations import uuid from random import randint from test.plugins.v0_1_0.azure_ad.test_utils import ( # noqa: F401 # intentional for mocks MockAzureADOrganization, azure_ad_organization, ) import pytest from aiohttp import ClientResponseError from iambic.plugins.v0_1_0.azure_ad.use...
9,652
die flat
# --- # jupyter: # jupytext: # cell_metadata_filter: -all # custom_cell_magics: kql # text_representation: # extension: .py # format_name: percent # format_version: '1.3' # jupytext_version: 1.11.2 # kernelspec: # display_name: base # language: python # name: python3 ...
9,653
convert dict
# © 2017 Akretion (http://www.akretion.com) # Sébastien BEAU <sebastien.beau@akretion.com> # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). from collections import OrderedDict from odoo import fields, models from odoo.tools import ormcache def partition(line, accessor): """Partition a record...
9,654
test replace
# Copyright (c) 2017 LINE Corporation # These sources are released under the terms of the MIT license: see LICENSE from unittest import mock import requests from django.test import override_settings from django.urls import reverse from promgen import models, tests, views TEST_SETTINGS = tests.Data("examples", "prom...
9,655
test mandatory outvol
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os import pytest from looseversion import LooseVersion from nipype.testing.fixtures import create_files_in_directory from nipype.interfaces import freesurfer from nipype.interfaces.freesurfer impor...
9,656
test case
# !/usr/bin/env python3 import os # This is the regression test base module used for all test cases. # There are two different schemes that differ from the executable path. # The first one is calling Python script by CTest, such as test_0d_regression_test. # The other one is calling Python script directly manually. # ...
9,657
test boto wait for certificate validation
import pytest from moto import settings as moto_settings from moto.ec2 import utils as ec2_utils from localstack.aws.accounts import get_aws_account_id from localstack.testing.aws.util import is_aws_cloud from localstack.testing.pytest import markers from localstack.utils.aws import aws_stack from localstack.utils.str...
9,658
package info
from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.files import get, copy, rmdir from conan.tools.scm import Version import os required_conan_version ...
9,659
test backup current hour
from django.test import TestCase from mock import patch, call from datetime import datetime, timedelta from model_mommy import mommy from backup.tasks import make_databases_backup from backup.models import Snapshot, BackupGroup from dbaas.tests.helpers import DatabaseHelper, InfraHelper, PlanHelper from physical.mode...
9,660
make one
from Acquisition import aq_parent from plone.base.interfaces import ILoginSchema from plone.registry.interfaces import IRegistry from Products.CMFCore.tests.base.dummy import DummyContent from Products.CMFCore.tests.base.dummy import DummyFolder from Products.CMFCore.tests.base.dummy import DummySite from zope.componen...
9,661
supports range index
""" AutoARIMA --------- """ from typing import Optional from pmdarima import AutoARIMA as PmdAutoARIMA from darts.logging import get_logger, raise_if from darts.models.forecasting.forecasting_model import ( FutureCovariatesLocalForecastingModel, ) from darts.timeseries import TimeSeries logger = get_logger(__na...
9,662
uuid
import os import shutil import yaml from dataclasses import dataclass, field from jinja2 import Template from mage_ai.data_preparation.models.block import Block from mage_ai.data_preparation.models.constants import ( BLOCK_LANGUAGE_TO_FILE_EXTENSION, BlockColor, BlockLanguage, BlockType, ) from mage_ai....
9,663
handle login
# Copyright (c) 2021, NVIDIA CORPORATION. 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...
9,664
test stack requires circular ref
"""Tests for runway.cfngin.stack.""" # pyright: basic import unittest from typing import Any from mock import MagicMock from runway.cfngin.lookups.registry import ( register_lookup_handler, unregister_lookup_handler, ) from runway.cfngin.stack import Stack from runway.config import CfnginConfig from runway.co...
9,665
read magnet
""" The MIT License (MIT) Copyright (c) 2013, 2014 Damien P. George 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 to use, copy, modi...
9,666
upgrade func
import pytz from monitorrent.db import UTCDateTime from monitorrent.plugins import upgrade, get_current_version from monitorrent.plugins.status import Status from sqlalchemy import Column, Integer, String, Boolean, MetaData, Table from sqlalchemy_enum34 import EnumType from sqlalchemy.orm import Session, sessionmaker, ...
9,667
test invalid block value
# Licensed under a 3-clause BSD style license - see LICENSE.rst import numpy as np import pytest from astropy.nddata import block_reduce, block_replicate, reshape_as_blocks class TestReshapeAsBlocks: def test_1d(self): data = np.arange(16) reshaped = reshape_as_blocks(data, 2) assert res...
9,668
main
#!/usr/bin/env python """ This script copies a restart file of a MALI simulation and re-calculates missing state variables for a missing time level and writes them to an updated restart file. """ import argparse import os import shutil import xarray as xr import numpy as np def METHOD_NAME(): parser = argparse...
9,669
test patron transactions type
# -*- coding: utf-8 -*- # # RERO ILS # Copyright (C) 2019 RERO # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that...
9,670
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...
9,671
reenable disabled for session
from .logging import debug from .logging import exception_log from .logging import printf from .types import ClientConfig from .typing import Generator, List, Optional, Set, Dict, Deque from .workspace import enable_in_project, disable_in_project from abc import ABCMeta from abc import abstractmethod from collections i...
9,672
monkeypatch
# This file is a part of IntelOwl https://github.com/intelowlproject/IntelOwl # See the file 'LICENSE' for copying permission. import logging import time import requests from django.utils.functional import cached_property from api_app.analyzers_manager.classes import ObservableAnalyzer from api_app.analyzers_manager...
9,673
client get blue zones
""" ttfpdf v1.4.3 May 30 2020 provides support for the proofpdf script, for working with OpenType/TTF fonts. Provides an implementation of the fontpdf font object. Cannot be run alone. """ __copyright__ = """Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/). All Rights Reserved. """ from fontTools.pen...
9,674
test let as subexpr
# 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...
9,675
append bytes
# -*- coding: utf-8 -*- """ Module to manage SeedLinkConnection state. Part of Python implementation of libslink of Chad Trabant and JSeedLink of Anthony Lomax :copyright: The ObsPy Development Team (devs@obspy.org) & Anthony Lomax :license: GNU Lesser General Public License, Version 3 (https://www.gnu.or...
9,676
test formatted logger
# -*- 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.apache.org/licenses/LICENSE-...
9,677
get window
import unittest with_alazar = True def get_pulse(): from qupulse.pulses import TablePulseTemplate as TPT, SequencePulseTemplate as SPT, RepetitionPulseTemplate as RPT ramp = TPT(identifier='ramp', channels={'out', 'trigger'}) ramp.add_entry(0, 'start', channel='out') ramp.add_entry('duration', 'stop...
9,678
get enthalpy
import numpy as np import stdc.utils.params as p import re LENGTH_UNITS = ['M', 'CM', 'MM', 'MICROM', 'NM', 'A', 'A0'] TIME_UNITS = ['S', 'MIN', 'H', 'MICROS', 'NS'] MASS_UNITS = ['KG', 'T', 'DG', 'G', 'MG', 'MICROG', 'AMU'] TEMPERATURE_UNITS = ['K', 'C', 'F'] MOLE_UNITS = ['MOL', '#', 'KMOL'] ENERGY_UNITS = ['J', 'K...
9,679
test float type print
import sys import pytest import numpy as np from numpy.testing import assert_, assert_equal, IS_MUSL from numpy.core.tests._locales import CommaDecimalPointLocale from io import StringIO _REF = {np.inf: 'inf', -np.inf: '-inf', np.nan: 'nan'} @pytest.mark.parametrize('tp', [np.float32, np.double, np.longdouble]) ...
9,680
main
""" Run all examples in a row. This script should be executed from inside the haddock3/examples/ folder. This script runs the `*-test.cfg` files. These test cases are not fetched automatically. If you want to add/remove cases you need to edit this script. The HADDOCK3 team has defined here only those test cases that ...
9,681
test clear viewport
import pytest import arcade def create(ctx, width, height, components=4, layers=1, dtype='f1'): layers = [ctx.texture((width, height), components=components, dtype=dtype) for _ in range(layers)] return ctx.framebuffer(color_attachments=layers) def test_properties(ctx): """Test framebuffers""" fb = c...
9,682
pause
"""Support for audio input and output over digital buses The `audiobusio` module contains classes to provide access to audio IO over digital buses. These protocols are used to communicate audio to other chips in the same circuit. It doesn't include audio interconnect protocols such as S/PDIF. All classes change hardw...
9,683
send message sync model to client
import logging import numpy as np from .message_define import MyMessage from .utils import transform_tensor_to_list from ....core.distributed.fedml_comm_manager import FedMLCommManager from ....core.distributed.communication.message import Message class FedNovaServerManager(FedMLCommManager): def __init__( ...
9,684
test correct num calls
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -*- coding: utf-8 -*- """ Test the synthetic data. """ import pytest import time @pytest.fixture(scope="module", au...
9,685
test capture cmd no capture fail
""" Tests for repo2docker/utils.py """ import os import platform import subprocess import tempfile import pytest import traitlets from repo2docker import utils def test_capture_cmd_no_capture_success(): # This should succeed for line in utils.execute_cmd(["/bin/bash", "-c", "echo test"]): pass def...
9,686
disable rule
# # This file is part of Dragonfly. # (c) Copyright 2018-2022 by Dane Finlay # Licensed under the LGPL. # # Dragonfly 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 Licens...
9,687
test action and comma
# SPDX-License-Identifier: GPL-3.0 # Copyright (c) 2014-2023 William Edwards <shadowapex@gmail.com>, Benjamin Bean <superman2k5@gmail.com> """ yes, these results are wacky, but they are here for regression testing """ import unittest from tuxemon.script.parser import ( parse_action_string, parse_condition_s...
9,688
test fake quantize dense
# 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...
9,689
bsz load v1 lcsr
import numpy as np import json import pkgutil from flavio.classes import Parameter from flavio.statistics.probability import MultivariateNormalDistribution FFs = ["A0", "A1", "A12", "V", "T1", "T2", "T23"] ai = ["a0", "a1", "a2"] ff_a = [(ff, a) for ff in FFs for a in ai] a_ff_string = [a + '_' + ff for ff in FFs for...
9,690
context
""" Unit test for MicroBatchHandler class. """ import json import random import sys from pathlib import Path import pytest from torchvision.models.resnet import ResNet18_Weights from ts.torch_handler.image_classifier import ImageClassifier from ts.torch_handler.unit_tests.test_utils.mock_context import MockContext fr...
9,691
session
"""Provider implementation based on boto library for AWS-compatible clouds.""" import logging import boto3 from botocore.client import Config from cloudbridge.base import BaseCloudProvider from cloudbridge.base.helpers import get_env from .services import AWSComputeService from .services import AWSDnsService from ....
9,692
include table
from functools import partial import attr from alembic.migration import MigrationContext def get_migration_context(connection, table_names=None): opts = {'compare_type': True} if table_names: opts['include_name'] = partial(include_name, table_names) opts['include_object'] = partial(include_ob...
9,693
recv raw
import asyncio import concurrent import hashlib import struct import base58 from configured_logger import logger from messages import schema from messages.crypto import PublicKey, Signature from messages.network import (EdgeInfo, GenesisId, Handshake, PeerChainInfoV2, PeerMessage, Routed...
9,694
test scatter ellipsis value
""" Unit tests of Ellipsis (...) in __getitem__ """ import numpy as np import holoviews as hv from holoviews.element.comparison import ComparisonTestCase class TestEllipsisCharts(ComparisonTestCase): def test_curve_ellipsis_slice_x(self): sliced = hv.Curve([(i,2*i) for i in range(10)])[2:7,...] ...
9,695
test no access
# pylint: disable=missing-docstring from smtplib import SMTPException from unittest import mock import pytest import ddt from django.db import IntegrityError from django.test import TestCase from openedx.core.djangoapps.api_admin.models import ApiAccessConfig, ApiAccessRequest from openedx.core.djangoapps.api_admin...
9,696
test docstring copy
# Test case for property # more tests are in test_descr import sys import unittest from test.test_support import run_unittest class PropertyBase(Exception): pass class PropertyGet(PropertyBase): pass class PropertySet(PropertyBase): pass class PropertyDel(PropertyBase): pass class BaseClass(object...
9,697
read
from __future__ import print_function, division, absolute_import import os import numpy as np from astropy.io import fits from RMS.Formats.FFStruct import FFStruct def METHOD_NAME(directory, filename, array=False, full_filename=False): """ Read a FF structure from a FITS file. Arguments: d...
9,698
test panel ols
from itertools import product import pickle import numpy as np from numpy.testing import assert_allclose import pandas as pd import pytest from linearmodels.panel.data import PanelData from linearmodels.panel.model import AmbiguityError, PanelOLS from linearmodels.panel.utility import AbsorbingEffectError from linear...
9,699
collect gaussian
# 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...