id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
11,700
problem update
import errno import os from typing import Optional from django.conf import settings from django.contrib.flatpages.models import FlatPage from django.core.cache import cache from django.core.cache.utils import make_template_fragment_key from django.db import transaction from django.db.models.signals import m2m_changed,...
11,701
dlrm wrap
import torch from dlrm_s_pytorch import DLRM_Net # type: ignore[import] import numpy as np # type: ignore[import] from dlrm_data_pytorch import CriteoDataset, collate_wrapper_criteo_offset # type: ignore[import] import zipfile import os class SparseDLRM(DLRM_Net): """The SparseDLRM model is a wrapper around th...
11,702
get workstation config iam policy output
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload fr...
11,703
get function
import logging import hypothesis.strategies as hst import numpy as np import pytest from hypothesis import given, settings from pytest import LogCaptureFixture from qcodes.parameters import Parameter from qcodes.validators import Numbers from .conftest import MemoryParameter def test_step_ramp(caplog: LogCaptureFi...
11,704
tpl rule10
# Leo colorizer control file for tpl mode. # This file is in the public domain. # Properties for tpl mode. properties = { "commentEnd": "-->", "commentStart": "<!--", } # Attributes dict for tpl_main ruleset. tpl_main_attributes_dict = { "default": "null", "digit_re": "", "escape": "", "highli...
11,705
quit
#!/usr/bin/env python -i # preceding line should have path for Python on your machine # vizplotgui_vmd.py # Purpose: viz running LAMMPS simulation via VMD with plot and GUI # Syntax: vizplotgui_vmd.py in.lammps Nfreq compute-ID # in.lammps = LAMMPS input script # Nfreq = plot data point and viz shap...
11,706
interpolate
# # This file is part of Dragonfly. # (c) Copyright 2007, 2008 by Christo Butcher # 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 L...
11,707
to stitch groups
# Authors: see git history # # Copyright (c) 2010 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. from math import atan2, degrees, radians from inkex import CubicSuperPath, Path, Transform from ..commands import is_command_symbol from ..i18n import _ from ..svg.path impo...
11,708
test construct failure
import pickle import pytest from praw.exceptions import ClientException from praw.models import Submission from ... import UnitTest class TestSubmission(UnitTest): @pytest.mark.filterwarnings("error", category=UserWarning) def test_additional_fetch_params_warning(self, reddit): with pytest.raises(U...
11,709
create pool
# 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...
11,710
handle profile
#!/usr/bin/python3 import argparse import asyncio import logging import os import shutil import sys import time import tempfile # We use f-strings from python >= 3.6. assert sys.version_info >= (3, 6) from ruamel.yaml import YAML yaml = YAML(typ='safe') from sis import classes, enrollments, student, terms from ucbh...
11,711
test segments recursive crawl
"""Tests for the segments module.""" import pytest from sqlfluff.core.linter.linter import Linter from sqlfluff.core.parser.segments.raw import RawSegment from sqlfluff.utils.functional import segments import sqlfluff.utils.functional.segment_predicates as sp seg1 = RawSegment("s1") seg2 = RawSegment("s2") seg3 = Raw...
11,712
control flow helper
""" Check that GDB helpers work as expected. This is meant to be "the" big test that checks all aspects of GDB helpers: Langkit-defined commands, pretty-printers, etc. To achieve this in a simple way (i.e. not creating a big realistic language spec) we just create dummy properties that implement the control-flow we wa...
11,713
test auto batch size no max no
import unittest from typing import Union import pkg_resources from hydra import initialize_config_dir from hydra.core.global_hydra import GlobalHydra from hydra import compose from omegaconf import OmegaConf, open_dict, DictConfig from super_gradients import Trainer, init_trainer from super_gradients.common.registry.r...
11,714
java single jar
# 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, softw...
11,715
main
#!/usr/bin/env python # # Copyright (C) 2017 Inventec, Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This p...
11,716
main
""" Copyright (c) 2021 The Orbit Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. """ from absl import app from core.orbit_e2e import E2ETestSuite from test_cases.connection_window import FilterAndSelectFirstProcess, ConnectToStadiaInstanc...
11,717
get ai by ai name
from __future__ import annotations from typing import TYPE_CHECKING from game.world.managers.objects.ai.BasicCreatureAI import BasicCreatureAI from game.world.managers.objects.ai.CreatureAI import CreatureAI from game.world.managers.objects.ai.CritterAI import CritterAI from game.world.managers.objects.ai.GuardAI imp...
11,718
test ubyte plus
# A lot of failures in these tests on Mac OS X. # Byte order related? import unittest from ctypes import * from ctypes.test import need_symbol import _ctypes_test class CFunctions(unittest.TestCase): _dll = CDLL(_ctypes_test.__file__) def S(self): return c_longlong.in_dll(self._dll, "last_tf_arg_s")...
11,719
get pose3d
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...
11,720
test outcome with score score
""" Tests for the LTI outcome service handlers, both in outcomes.py and in tasks.py """ from unittest.mock import MagicMock, patch import ddt from django.test import TestCase from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator import lms.djangoapps.lti_provider.tasks as tasks from common.djangoapps...
11,721
test step context
# Copyright The Lightning AI team. # # 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 wri...
11,722
piecewise fun builder
import json import re import struct import zipfile import vtk from .synchronizable_serializer import arrayTypesMapping METHODS_RENAME = { "AddTexture": "SetTexture", "SetUseGradientOpacity": None, "SetRGBTransferFunction": "SetColor", } WRAP_ID_RE = re.compile(r"instance:\${([^}]+)}") ARRAY_TYPES = { ...
11,723
check
# Copyright (c) 2019, Sean Vig. All rights reserved. # # 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, modify, mer...
11,724
convertlevels
from redbot.core import commands from redbot.core.utils import AsyncIter from redbot.core.utils.predicates import MessagePredicate from leveler.abc import MixinMeta from .basecmd import DBConvertersBaseCMD class MeeSix(MixinMeta): """Mee6 leveling converter""" lvlconvert = getattr(DBConvertersBaseCMD, "lvl...
11,725
parse
import datetime import re import unicodedata from city_scrapers_core.constants import COMMISSION from city_scrapers_core.items import Meeting from city_scrapers_core.spiders import CityScrapersSpider from w3lib.html import remove_tags class ChiSsa8Spider(CityScrapersSpider): name = "chi_ssa_8" agency = "Chic...
11,726
test convert class attributes
from django.test import SimpleTestCase from debug.utils_for_tests import todict class TestToDictFunction(SimpleTestCase): def test_convert_instance_variables(self): class TestClass: def __init__(self, instance_attribute_variable=2): self.instance_attribute_variable = instance_...
11,727
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...
11,728
run
from .core.protocol import Location from .core.protocol import LocationLink from .core.protocol import Request from .core.registry import get_position from .core.registry import LspTextCommand from .core.sessions import Session, method_to_capability from .core.typing import List, Optional, Union from .core.views import...
11,729
folderitem
# -*- 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...
11,730
test scrape console log lines
"""Unit tests for perfkitbenchmarker.linux_packages.linux_boot module. Tests mostly focusing on parsing logic of extracting information from systemd and dmesg and converting into sample.Sample objects. Test data files stored in perfkitbenchmarker/tests/data/linux_boot. """ import datetime import os import unittest f...
11,731
stats
"""Defines the LintedDir class. This stores the idea of a collection of linted files at a single start path """ from typing import Any, Dict, List, Optional, Union, overload from typing_extensions import Literal from sqlfluff.core.errors import CheckTuple from sqlfluff.core.linter.linted_file import LintedFile fro...
11,732
test file with missing final nl
""" Test script for the 'cmd' module Original by Michael Schneider """ import cmd import sys import re import unittest import io from test import support class samplecmdclass(cmd.Cmd): """ Instance the sampleclass: >>> mycmd = samplecmdclass() Test for the function parseline(): >>> mycmd.parseli...
11,733
dump commit list
"""Export the initial list of PRs associated with a `develop` merge to `master`. """ import os import re from pathlib import Path from subprocess import DEVNULL from milc import cli cache_timeout = 7 * 86400 fix_expr = re.compile(r'fix', flags=re.IGNORECASE) clean1_expr = re.compile(r'\[(develop|keyboard|keymap|core|...
11,734
destroy
# oxAuth is available under the MIT License (2008). See http://opensource.org/licenses/MIT for full text. # Copyright (c) 2019, Janssen # # Author: Yuriy Mochan # # from io.jans.model.custom.script.type.owner import ResourceOwnerPasswordCredentialsType from io.jans.as.server.service import AuthenticationService, Sessi...
11,735
test saverdict
""" Tests for dbserialize module """ from collections import defaultdict, deque from django.test import TestCase from evennia.objects.objects import DefaultObject from evennia.utils import dbserialize from parameterized import parameterized class TestDbSerialize(TestCase): """ Database serialization operati...
11,736
test load module should succeed for already
# -*- 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 #...
11,737
minimum trail opacity
""" The MIT License (MIT) Copyright (c) 2012-2014 Alexander Turkin Copyright (c) 2014 William Hallatt Copyright (c) 2015 Jacob Dawid Copyright (c) 2016 Luca Weiss Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal ...
11,738
create
from __future__ import annotations from unittest.mock import Mock import pytest from kombu import Connection, Producer, pools from kombu.connection import ConnectionPool from kombu.utils.collections import eqhash class test_ProducerPool: Pool = pools.ProducerPool class MyPool(pools.ProducerPool): ...
11,739
visit ellipsis
"""Find all subexpressions of an AST node.""" from __future__ import annotations from mypy.nodes import ( AssertTypeExpr, AssignmentExpr, AwaitExpr, CallExpr, CastExpr, ComparisonExpr, ConditionalExpr, DictExpr, DictionaryComprehension, Expression, GeneratorExpr, IndexE...
11,740
delete
# --- BEGIN COPYRIGHT BLOCK --- # Copyright (C) 2016, William Brown <william at blackhats.net.au> # Copyright (C) 2023 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). # See LICENSE for details. # --- END COPYRIGHT BLOCK --- from lib389.idm.user import nsUserAccount, nsUserAccoun...
11,741
drop invalid neo arguments before version 0
from pathlib import Path from typing import Union import numpy as np import probeinterface as pi from .neobaseextractor import NeoBaseRecordingExtractor, NeoBaseSortingExtractor def METHOD_NAME(neo_kwargs): # Temporary function until neo version 0.13.0 is released from packaging.version import parse as par...
11,742
rm
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import os import shutil from typing import List, Optional logger = logging.getLogger(__file__) try:...
11,743
fake asgi connection
from __future__ import annotations from contextlib import contextmanager from http.cookiejar import CookieJar from typing import TYPE_CHECKING, Any, Generator, Generic, Mapping, TypeVar, cast from warnings import warn from anyio.from_thread import BlockingPortal, start_blocking_portal from litestar.connection import...
11,744
main
# /*########################################################################## # # Copyright (c) 2017-2021 European Synchrotron Radiation Facility # # 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 Sof...
11,745
derive otu information
from asyncio import to_thread import datetime import json import os from pathlib import Path from typing import List, Optional, Tuple, Union import aiofiles import arrow import dictdiffer from virtool_core.models.enums import HistoryMethod from virtool.config import get_config_from_app def calculate_diff(old: dict,...
11,746
called from setup
from distutils.errors import DistutilsArgError import inspect import glob import platform import distutils.command.install as orig import setuptools from ..warnings import SetuptoolsDeprecationWarning, SetuptoolsWarning # Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for # now. See https://gi...
11,747
massive
import os import shutil import tempfile import unittest import numpy as np from nose.tools import assert_raises from numpy.testing import assert_array_equal, assert_equal from yt.data_objects.data_containers import YTDataContainer from yt.data_objects.particle_filters import particle_filter from yt.testing import ( ...
11,748
check eval text
#!/usr/bin/env python #-*- coding:utf-8 -*- """ This file is part of OpenSesame. OpenSesame is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version....
11,749
test check initial model
import unittest from unittest.mock import patch from fedn.clients.reducer.restservice import ReducerRestService class TestInit(unittest.TestCase): @patch('fedn.clients.reducer.control.ReducerControl') def test_discover_host(self, mock_control): CONFIG = { 'discover_host': 'TEST_HOST', ...
11,750
compute intensity features
"""Compute intensity features in labeled image.""" import numpy as np def METHOD_NAME( im_label, im_intensity, num_hist_bins=10, rprops=None, feature_list=None): """Calculate intensity features from an intensity image. Parameters ---------- im_label : array_like A labeled mask...
11,751
test to dot
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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 a...
11,752
launch ptipython
"""Utility and helper methods for tmuxp. tmuxp.shell ~~~~~~~~~~~ """ import logging import os import pathlib import typing as t logger = logging.getLogger(__name__) if t.TYPE_CHECKING: from typing_extensions import Literal, TypeAlias CLIShellLiteral: TypeAlias = Literal[ "best", "pdb", "code", "pti...
11,753
setup cleanup on exit
import signal import subprocess import sys from time import sleep from typing import Optional, Tuple import wandb import yaml from kubernetes import client, config, watch from wandb.apis.public import Api def run_cmd(command: str) -> None: subprocess.Popen(command.split(" ")).wait() def run_cmd_async(command: ...
11,754
make cache key
import logging # pylint: disable=C0302 from flask.globals import request from sqlalchemy import and_, or_ from src.models.tracks.track import Track from src.queries.query_helpers import ( get_users_by_id, get_users_ids, paginate_query, populate_track_metadata, ) from src.utils import helpers from src...
11,755
scan dataset db
"""Contains the scan group of the commands for fides.""" import rich_click as click from fides.cli.options import ( aws_access_key_id_option, aws_region_option, aws_secret_access_key_option, connection_string_option, coverage_threshold_option, credentials_id_option, manifests_dir_argument,...
11,756
tau3 param
#!/bin/env python """ plot a an hdf bank file based on background binning """ import sys import argparse import h5py import numpy import matplotlib; matplotlib.use('Agg') import pylab import inspect import pycbc.events, pycbc.pnutils, pycbc.conversions, pycbc.results import pycbc.version from itertools import cycle c...
11,757
check manager interrupt
"""Scanner used for host connection discovery.""" import re import tempfile from functools import cache from multiprocessing import Value from pathlib import Path import yaml from ansible.parsing.utils.addresses import parse_address from ansible.plugins.inventory import detect_range, expand_hostname_range from django...
11,758
pyramid request
from unittest.mock import sentinel import pytest from lms.product.plugin.grouping import GroupError from lms.views.api.sync import sync from tests import factories from tests.conftest import TEST_SETTINGS @pytest.mark.usefixtures("application_instance_service") class TestSync: def test_it_with_sections( ...
11,759
generator
# This file is Copyright 2019 Volatility Foundation and licensed under the Volatility Software License 1.0 # which is available at https://www.volatilityfoundation.org/license/vsl-v1.0 # import logging from typing import List, Optional, Type from volatility3.framework import renderers, interfaces, constants, exceptio...
11,760
write values
from __future__ import print_function import sys, os, optparse, re, json import ROOT, xmlrpclib SERVER_URL = "http://pccmsdqm04.cern.ch/runregistry/xmlrpc" ONLINE_DATASET = '/Global/Online/ALL' # FOLDER UNDER EvInfo NAME SUMMARY VALUE IN EvInfo FOLDERS = { 'reportSummaryContents': ( 'DQM', 'report...
11,761
lstm
# 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...
11,762
rel path
import os import dronecan import errno import em import math import copy def get_empy_env_request(msg): assert msg.kind == msg.KIND_SERVICE msg_underscored_name = msg.full_name.replace('.','_')+'_req' msg_resp_underscored_name = msg.full_name.replace('.','_')+'_res' return { 'msg_underscored_na...
11,763
test unknown charset
import unittest from email import _encoded_words as _ew from email import errors from test.test_email import TestEmailBase class TestDecodeQ(TestEmailBase): def _test(self, source, ex_result, ex_defects=[]): result, defects = _ew.decode_q(source) self.assertEqual(result, ex_result) self.a...
11,764
publish minions
import logging import threading import salt.netapi import salt.utils.json log = logging.getLogger(__name__) class SaltInfo: """ Class to handle processing and publishing of "real time" Salt upates. """ def __init__(self, handler): """ handler is expected to be the server side end o...
11,765
construct
from .ParallelVolumeEngine import * class VolumeEngine(g4.G4VUserDetectorConstruction, gate.EngineBase): """ Engine that will create all G4 elements for the hierarchy of volumes. Correspond to the G4VUserDetectorConstruction (inherit) Also manage the list of parallel worlds. """ def __init__(...
11,766
test skip transaction with unverified payment method
# Copyright (c) 2015 Presslabs SRL # # 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 writ...
11,767
used in
import hashlib import json import uuid from copy import deepcopy from functools import partial from typing import TYPE_CHECKING, List, Tuple from django.conf import settings from django.core.exceptions import ValidationError from django.db import models, transaction from django.urls import reverse from django.utils.fu...
11,768
pending mulligans
import unittest from spellsource.behaviour import * from spellsource.context import Context from spellsource.gamestatevaluebehaviour import GameStateValueBehaviour from spellsource.playrandombehaviour import PlayRandomBehaviour from .decks import * class BasicTest(unittest.TestCase): def test_start_jvm(self): ...
11,769
set up class
# Copyright 2009-2011 by Eric Talevich. All rights reserved. # Revisions copyright 2009-2013 by Peter Cock. All rights reserved. # Revisions copyright 2013 Lenna X. Peterson. All rights reserved. # Revisions copyright 2020 Joao Rodrigues. All rights reserved. # # Converted by Eric Talevich from an older unit test cop...
11,770
test unicode nfc and nfd decomposition equality
import unittest import re from robot.utils import safe_str, prepr, DotDict from robot.utils.asserts import assert_equal, assert_true class TestSafeStr(unittest.TestCase): def METHOD_NAME(self): import unicodedata text = 'Hyv\xe4' assert_equal(safe_str(unicodedata.normalize('NFC', text)),...
11,771
parse flags
import subprocess import sys import time from _typeshed import ReadableBuffer, SizedBuffer from builtins import list as _list # conflicts with a method named "list" from collections.abc import Callable from datetime import datetime from re import Pattern from socket import socket as _socket from ssl import SSLContext,...
11,772
needs update
#!/usr/bin/env python3 # This file is part of the libopencm3 project. # # Copyright (C) 2012 chrysn <chrysn@fsfe.org> # # This library 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...
11,773
test get schema from query other schema
from __future__ import annotations from datetime import date from operator import methodcaller import pandas as pd import pandas.testing as tm import pytest import sqlalchemy as sa from pytest import param from sqlalchemy.dialects import mysql import ibis import ibis.expr.datatypes as dt from ibis.util import gen_na...
11,774
g
import sys import unittest import io import atexit from test import support ### helpers def h1(): print("h1") def h2(): print("h2") def h3(): print("h3") def h4(*args, **kwargs): print("h4", args, kwargs) def raise1(): raise TypeError def raise2(): raise SystemError class GeneralTest(uni...
11,775
run
# 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...
11,776
p
''' Contains all the auxillary functions to do linear secret sharing (LSS) over an access structure. Mainly, we represent the access structure as a binary tree. This could also support matrices for representing access structures. ''' from charm.core.math.pairing import ZR from charm.toolbox.policytree import * class ...
11,777
test image sweep settings to rest
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- from itertools import product from typing import Optional import pytest from azure.ai.ml._restclient.v2023_04_01_preview.models import Ba...
11,778
adelete
from collections.abc import Collection, Iterable, Sequence from typing import Any, ClassVar, Final, TypeVar from django.core.checks.messages import CheckMessage from django.core.exceptions import MultipleObjectsReturned as BaseMultipleObjectsReturned from django.core.exceptions import ObjectDoesNotExist, ValidationErr...
11,779
shutdown
import logging import os import queue import typing as t import uuid from concurrent.futures import Future from globus_compute_common.messagepack.message_types import ( EPStatusReport, TaskTransition, ) from globus_compute_endpoint.engines.base import ( GlobusComputeEngineBase, ReportingThread, ) from ...
11,780
test load testcase file
import os import unittest from httprunner import exceptions, loader class TestLoader(unittest.TestCase): def METHOD_NAME(self): path = "examples/postman_echo/request_methods/request_with_variables.yml" testcase_obj = loader.load_testcase_file(path) self.assertEqual( testcase_o...
11,781
test create basic
# -*- coding: utf-8 -*- # Copyright 2017 Google Inc. 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 require...
11,782
test message
import sys from _pydev_bundle._pydev_saved_modules import thread import pycompletionserver import socket from urllib.parse import quote_plus start_new_thread = thread.start_new_thread BUILTIN_MOD = 'builtins' def send(s, msg): s.send(bytearray(msg, 'utf-8')) import unittest class TestCPython(unittest.TestCa...
11,783
test trait list object copies
# (C) Copyright 2005-2023 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only under # the conditions described in the aforementioned license. The license # is also available online at...
11,784
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...
11,785
log num triplets
# # DeepLabCut Toolbox (deeplabcut.org) # © A. & M.W. Mathis Labs # https://github.com/DeepLabCut/DeepLabCut # # Please see AUTHORS for contributors. # https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS # # Licensed under GNU Lesser General Public License v3.0 # from functools import partial from PySide6 impo...
11,786
test remote bifurcation angle
# Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...
11,787
compiled callable
# ./python/air/backend/cpu_backend.py -*- Python -*- # # Copyright (C) 2023, Advanced Micro Devices, Inc. # SPDX-License-Identifier: MIT import torch import torch_mlir.ir from torch_mlir.dynamo import make_simple_dynamo_backend import air.mlir.ir import air.mlir.passmanager from torch_mlir_e2e_test.linalg_on_tensors...
11,788
test properties describe training job response
# Copyright Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
11,789
checkout
"""General-purpose Git utilities.""" from collections import namedtuple import logging import os from git import Repo logger = logging.getLogger(__name__) # namedtuple takes a git log diff status and its accompanying text. GitDiffLog = namedtuple("GitDiffLog", ["status", "text"]) # 'A' and 'D' status are swapped b...
11,790
read unpacked
"""PEP 656 support. This module implements logic to detect if the currently running Python is linked against musl, and what musl version is used. """ import contextlib import functools import operator import os import re import struct import subprocess import sys from typing import IO, Iterator, NamedTuple, Optional,...
11,791
post operations
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
11,792
build fields
# # This source file is part of the EdgeDB open source project. # # Copyright 2008-present MagicStack Inc. and the EdgeDB 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...
11,793
get file
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
11,794
typename
#!/usr/bin/python3 # -*- coding: utf-8 -*- class FantlvException(Exception): def __init__(self, message='fantlverror', code=-100): err = 'errcode: {0} message:{1}'.format(code, message) Exception.__init__(self, err) self.code = code self.message = message class fan_tlv(): HEAD...
11,795
doc idx
import os import struct import shutil from itertools import accumulate import numpy as np import torch dtypes = { 1: np.uint8, 2: np.int8, 3: np.int16, 4: np.int32, 5: np.int64, 6: np.float32, 7: np.double, 8: np.uint16 } def code(dtype): for k in dtypes.keys(): if dtype...
11,796
after create object
from flask.globals import g from flask_rest_jsonapi import ResourceDetail, ResourceList from sqlalchemy.orm.exc import NoResultFound from app.api.helpers.db import get_count, safe_query_kwargs, save_to_db from app.api.helpers.errors import ConflictError, ForbiddenError, UnprocessableEntityError from app.api.helpers.pa...
11,797
callback clicked
#* 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/lgpl-2.1.html import sys ...
11,798
test flow serve cli creates deployment
import datetime import pytest from prefect.client.orchestration import PrefectClient from prefect.testing.cli import invoke_and_assert from prefect.testing.utilities import AsyncMock from prefect.utilities.asyncutils import run_sync_in_worker_thread class TestFlowServe: """ These tests ensure that the `pref...
11,799
test placement group delete
"""Tests for google3.third_party.py.perfkitbenchmarker.tests.providers.gcp.gce_placement_group.""" import json import unittest from absl import flags import mock from perfkitbenchmarker import benchmark_spec from perfkitbenchmarker import errors from perfkitbenchmarker import placement_group from perfkitbenchmarker i...