id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
10,700 | test learn2learn training strategies | # Copyright The PyTorch Lightning 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 i... |
10,701 | sigmask | import gdb
from .cmd import SimpleCommand, AutoCompleteMixin
from .struct import enum, cstr, GdbStructMeta, ProgramCounter, TailQueue
from .utils import func_ret_addr, local_var, TextTable
from .ctx import Context
def sigpend(v):
return '{:08x}'.format(int(v['sp_set']['__bits']) << 1)
def METHOD_NAME(v):
r... |
10,702 | test assert python failure | """Unittests for test.script_helper. Who tests the test helper?"""
import subprocess
import sys
from test import script_helper
import unittest
from unittest import mock
class TestScriptHelper(unittest.TestCase):
def test_assert_python_ok(self):
t = script_helper.assert_python_ok('-c', 'import sys; sys.... |
10,703 | forward | # Copyright (c) Glow Contributors. See CONTRIBUTORS file.
#
# 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 ... |
10,704 | plot phase space with | import matplotlib.pyplot as plt
import numpy as np
# Plotting frequency and amplitudes against densities
def METHOD_NAME(
densities,
theory_frequency,
sim_frequency,
theory_amplitude,
sim_amplitude,
PLOT_FIGURE=True,
SAVE_FIGURE=False,
):
fig = plt.figure(figsize=(20, 8), frameon=True... |
10,705 | replace expand | from Tkinter import *
from idlelib import SearchEngine
from idlelib.SearchDialogBase import SearchDialogBase
import re
def replace(text):
root = text._root()
engine = SearchEngine.get(root)
if not hasattr(engine, "_replacedialog"):
engine._replacedialog = ReplaceDialog(root, engine)
dialog = ... |
10,706 | refresh calltip event | """Pop up a reminder of how to call a function.
Call Tips are floating windows which display function, class, and method
parameter and docstring information when you type an opening parenthesis, and
which disappear when you type a closing parenthesis.
"""
import __main__
import inspect
import re
import sys
import text... |
10,707 | groupids created by | import sqlalchemy as sa
from h.models import Group, User
from h.models.group import ReadableBy
from h.util import group as group_util
class GroupService:
def __init__(self, session, user_fetcher):
"""
Create a new groups service.
:param session: the SQLAlchemy session object
:par... |
10,708 | make segment | #!/usr/bin/env python3
import argparse
import math
import os
import sys
"""Generate segments according to label."""
class LabelInfo(object):
def __init__(self, start, end, label_id):
self.label_id = label_id
self.start = start
self.end = end
class SegInfo(object):
def __init__(self)... |
10,709 | setup network | #!/usr/bin/env python3
# allow imports from parent directory
# source: https://stackoverflow.com/a/11158224
import os, sys
import rlp
sys.path.insert(1, os.path.join(sys.path[0], '..'))
import eth_utils
import os
import time
from eth_utils import keccak, decode_hex
import eth_abi
from conflux.config import DEFAULT... |
10,710 | properties | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
10,711 | filters | # 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... |
10,712 | test health check servicer multiple clients one | from unittest.mock import MagicMock, call, patch
import pytest
from grpc.health.v1 import health_pb2
from kaskada.health.health_check_servicer import HealthCheckServicer
@patch("kaskada.health.health_check_client.HealthCheckClientFactory")
@patch("kaskada.health.health_check_client.HealthCheckClient")
def test_heal... |
10,713 | is zip archive | import logging
import time
from archinfo.arch_soot import ArchSoot, SootAddressDescriptor, SootMethodDescriptor
from cle.backends.backend import Backend
from cle.errors import CLEError
try:
import pysoot
from pysoot.lifter import Lifter
except ImportError:
pysoot = None
Lifter = None
log = logging.g... |
10,714 | test get tool usage by name | import pytest
from unittest.mock import MagicMock, patch
from fastapi import HTTPException
from superagi.apm.tools_handler import ToolsHandler
from sqlalchemy.orm import Session
from superagi.models.agent_config import AgentConfiguration
from datetime import datetime
import pytz
@pytest.fixture
def organisation_id():... |
10,715 | direction | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ ... |
10,716 | cf policy exemptions | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
10,717 | migrate endpoints | # Generated by Django 3.1.14 on 2022-04-12 07:39
import common.db.fields
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import uuid
from django.conf import settings
def METHOD_NAME(apps, schema_editor):
Endpoint = apps.get_model("terminal", "Endpoint")
... |
10,718 | get default engine version | # Copyright 2022 PerfKitBenchmarker 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... |
10,719 | clear addrs | from abc import abstractmethod
from typing import Any, List, Sequence
from multiaddr import Multiaddr
from libp2p.crypto.keys import KeyPair, PrivateKey, PublicKey
from .addrbook_interface import IAddrBook
from .id import ID
from .peerinfo import PeerInfo
from .peermetadata_interface import IPeerMetadata
class IPe... |
10,720 | ralphad | # -*- coding: utf-8 -*-
# Copyright (C) 2011-2012 Quang-Cuong Pham <cuong.pham@normalesup.org>
#
# 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.... |
10,721 | keydiff | #!/usr/bin/env python
#
# Copyright 2018 Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
10,722 | mfbucket | class MultiFieldSolverInterfaceMapping:
def METHOD_NAME(self, key="", value="", **kwargs):
"""Turns a bucket search on or off.
APDL Command: MFBUCKET
Parameters
----------
key
Bucket search key:
ON - Activates a bucket search (default).
... |
10,723 | number | # 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... |
10,724 | create token type ids from sequences | # coding=utf-8
# Copyright 2020 The Google AI Language Team Authors, Allegro.pl, Facebook Inc. and the HuggingFace Inc. 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://ww... |
10,725 | print on master | import functools
import os
from contextlib import contextmanager
import torch.distributed as dist
from torch.distributed import ProcessGroup
from colossalai.context.singleton_meta import SingletonMeta
class DistCoordinator(metaclass=SingletonMeta):
"""
This class is used to coordinate distributed training. ... |
10,726 | on cont message | import json
import logging
from threading import RLock, Thread, current_thread
from typing import Any, Dict, List, Optional, Tuple, Union
from urllib.parse import unquote_plus, urlparse
from certifi import where as certify_where
from websocket import ABNF, STATUS_NORMAL, WebSocketApp, enableTrace # type: ignore[impor... |
10,727 | find count col | # Copyright (c) 2015 Institute of the Czech National Corpus
# Copyright (c) 2015 Tomas Machalek <tomas.machalek@gmail.com>
#
# 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; version 2
# dated Jun... |
10,728 | slugify | import io
import os
import re
import time
from datetime import date, datetime
from typing import Any, Dict, List, Optional, Union
def pretty_size(size: Union[int, float]) -> str:
"""
Converts a size in bytes to its string representation (e.g. 1024 -> 1KiB)
:param size: Size in bytes
"""
size = flo... |
10,729 | validate config | import json
import os
import jsone
import jsonschema
import yaml
COMMON_CONTEXT = {
"WORK_DIR": "",
"ARTIFACTS_DIR": "",
"VERBOSE": "true",
"PUBLIC_IP": "0.0.0.0",
"PASSWORDS_PATH": "",
"APPLE_NOTARIZATION_CREDS_PATH": "",
"SSL_CERT_PATH": "",
"SIGNTOOL_PATH": "",
"DMG_PATH": "",
... |
10,730 | test jsons | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... |
10,731 | check track dynamic | from test import support, seq_tests
import gc
import pickle
class TupleTest(seq_tests.CommonTest):
type2test = tuple
def test_constructors(self):
super().test_constructors()
# calling built-in types without argument must return empty
self.assertEqual(tuple(), ())
t0_3 = (0, 1,... |
10,732 | test custom description text lang specified | from django.test.utils import override_settings
import pytest
from rest_framework.test import APIRequestFactory
from olympia import amo
from olympia.amo.tests import TestCase, addon_factory
from olympia.discovery.models import DiscoveryItem
from olympia.discovery.serializers import DiscoverySerializer
from olympia.tr... |
10,733 | process | # ##### 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.
#
# This program is distrib... |
10,734 | is read only | import urllib.parse
from logging import getLogger
from tkinter import messagebox
from typing import Any, Dict, List, Optional
from thonny.languages import tr
from thonny.misc_utils import levenshtein_distance
from thonny.plugins.micropython import LocalMicroPythonProxy, MicroPythonProxy
from thonny.plugins.pip_gui imp... |
10,735 | get by label |
# all the crap that is stored on the rhn side of stuff
# updating/fetching package lists, channels, etc
from up2date_client import up2dateAuth
from up2date_client import up2dateErrors
from up2date_client import config
from up2date_client import rhnserver
import gettext
t = gettext.translation('rhn-client-tools', fal... |
10,736 | format missing translations msg | from collections import defaultdict
from typing import TYPE_CHECKING
from pyxform import aliases
from pyxform import constants as const
from pyxform.errors import PyXFormError
if TYPE_CHECKING:
from typing import Dict, List, Optional, Sequence, Set, Union
SheetData = List[Dict[str, Union[str, Dict]]]
War... |
10,737 | test many files | # -*- coding: utf-8 -*-
#
# Copyright 2010 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 ... |
10,738 | assert cachalot cache queryset count of | from time import time
from django.conf import settings
from django.core.cache import caches
from django.test import override_settings
from django.urls import reverse
import pytest
from cachalot.settings import cachalot_settings
from baserow.contrib.database.fields.handler import FieldHandler
from baserow.contrib.dat... |
10,739 | fit | """A transformer that encodes categorical features into target encodings."""
import warnings
import pandas as pd
from evalml.pipelines.components.transformers.encoders.onehot_encoder import (
OneHotEncoderMeta,
)
from evalml.pipelines.components.transformers.transformer import Transformer
from evalml.utils import... |
10,740 | test simple image stim | from psychopy import visual, event, info
import pytest
import numpy as np
import shutil, os
from tempfile import mkdtemp
from psychopy.tests import utils
# Testing for memory leaks in PsychoPy classes (experiment run-time, not Builder, Coder, etc)
# The tests are too unstable to include in travis-ci at this point.
... |
10,741 | do wrap | from __future__ import annotations
import sys
import warnings
from collections.abc import Callable
from functools import wraps
from types import ModuleType
from typing import TYPE_CHECKING, ClassVar, TypeVar
import attr
if TYPE_CHECKING:
from typing_extensions import ParamSpec
ArgsT = ParamSpec("ArgsT")
Re... |
10,742 | put | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:para... |
10,743 | get test requester balance | #!/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 unittest
import shutil
import os
import tempfile
import time
import pytest
from mephisto.operations.config_handl... |
10,744 | pg create db | # mypy: ignore-errors
import time
from ... import exc
from ... import inspect
from ... import text
from ...testing import warn_test_suite
from ...testing.provision import create_db
from ...testing.provision import drop_all_schema_objects_post_tables
from ...testing.provision import drop_all_schema_objects_pre_tables
... |
10,745 | css | import json as jsonlib
from urllib.parse import urljoin
from django.conf import settings
from django.forms import CheckboxInput
from django.template import Library, defaultfilters, loader
from django.templatetags.static import static
from django.urls import reverse
from django.utils.encoding import smart_str
from djan... |
10,746 | calculations | import pandas as pd
import numpy as np
from sysquant.fitting_dates import fitDates
class Estimate:
def subset(self, subset_of_asset_names: list):
raise NotImplementedError
def assets_with_missing_data(self) -> list:
raise NotImplementedError
def list_in_key_order(self, list_of_keys: list... |
10,747 | get base mac | #!/usr/bin/env python
#
# Name: chassis.py, version: 1.0
#
# Description: Module contains the definitions of SONiC platform APIs
#
try:
import os
import re
import collections
from sonic_platform_base.chassis_base import ChassisBase
from sonic_platform.eeprom import Eeprom
from .fan_drawer impo... |
10,748 | set sample rate | #
# Copyright 2008 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr
from gnuradio import blocks
import sys
import math
from . import fft_python as fft
from . import fft_vfc, fft_vcc
from .fft_python import window
try:
from... |
10,749 | processed dir | import os
import os.path as osp
import pickle
import shutil
from typing import Callable, List, Optional
import torch
from tqdm import tqdm
from torch_geometric.data import (
Data,
InMemoryDataset,
download_url,
extract_zip,
)
class ZINC(InMemoryDataset):
r"""The ZINC dataset from the `ZINC datab... |
10,750 | test string with soft space | import unittest
import sys
from io import StringIO
from test import support
NotDefined = object()
# A dispatch table all 8 combinations of providing
# sep, end, and file.
# I use this machinery so that I'm not just passing default
# values to print, I'm either passing or not passing in the
# arguments.
dispatch = {
... |
10,751 | test play with pre tasks | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... |
10,752 | worker type | from typing import List, Union
from ...driver.billing_manager import ProductVersions
from ...instance_config import InstanceConfig
from .resource_utils import family_worker_type_cores_to_gcp_machine_type, gcp_machine_type_to_parts
from .resources import (
GCPComputeResource,
GCPDynamicSizedDiskResource,
GC... |
10,753 | set up | #!/usr/bin/env python3
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... |
10,754 | append | ################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
#############################################################################... |
10,755 | test substitute variables errors | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""Tests of miscellaneous stuff."""
from __future__ import annotations
import sys
from unittest import mock
import pytest
from coverage.exceptions import Covera... |
10,756 | test readonly extract | import pytest
from ...constants import * # NOQA
from ...helpers import EXIT_ERROR
from ...locking import LockFailed
from ...remote import RemoteRepository
from .. import llfuse
from . import cmd, create_src_archive, RK_ENCRYPTION, read_only, fuse_mount
def test_readonly_check(archiver):
cmd(archiver, "rcreate",... |
10,757 | set control vars | """
Model components and time managing classes.
"""
from warnings import warn
import os
import random
import inspect
import importlib.util
import numpy as np
from pysd._version import __version__
class Component(object):
def __init__(self):
self.namespace = {}
self.dependencies = {}
def a... |
10,758 | prob boltz | #!/usr/bin/python
###############
# wormlike2.py
#
# Copyright David Baddeley, 2012
# d.baddeley@auckland.ac.nz
#
# 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... |
10,759 | run | import logging
from functools import partial
from avocado.utils import memory
from virttest import utils_misc
from virttest import qemu_monitor
from provider import backup_utils
from provider import blockdev_base
LOG_JOB = logging.getLogger('avocado.test')
class BlockdevIncreamentalBackupTest(blockdev_base.Block... |
10,760 | dumps | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in complia... |
10,761 | rotate | # -*- coding: utf-8 -*-
"""
This module implements a kaeldioscope effect renderer.
"""
from __future__ import division
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from builtins import range
from math import sin, cos, pi, atan2
from asciimatics.re... |
10,762 | send request | # 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 ... |
10,763 | test admin display | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name
import html
from http import HTTPStatus
from django.conf import settings
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from tcms.tests import LoggedInTestCase
from tcms.tests.factories import UserFactory
class TestAdmin... |
10,764 | to device list | from typing import Dict, List, Optional, Union
import torch
from torch._C._distributed_rpc import _TensorPipeRpcBackendOptionsBase
from . import constants as rpc_contants
DeviceType = Union[int, str, torch.device]
__all__ = ["TensorPipeRpcBackendOptions"]
def _to_device(device: DeviceType) -> torch.device:
dev... |
10,765 | spawn pf handler | # Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Test UFFD related functionality when resuming from snapshot."""
import os
import re
import stat
from subprocess import TimeoutExpired
import pytest
import requests
from framework.utils import Timeout, U... |
10,766 | test buzhash | # Note: these tests are part of the self test, do not use or import pytest functionality here.
# See borg.selftest for details. If you add/remove test methods, update SELFTEST_COUNT
from io import BytesIO
from ..chunker import ChunkerFixed, Chunker, get_chunker, buzhash, buzhash_update
from ..constants import *... |
10,767 | get job step | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
10,768 | print exception | import sys
from _typeshed import SupportsGetItem, SupportsItemAccess, Unused
from builtins import list as _list, type as _type
from collections.abc import Iterable, Iterator, Mapping
from email.message import Message
from types import TracebackType
from typing import IO, Any, Protocol
from typing_extensions import Self... |
10,769 | test match images | from typing import Any, Dict, List, Set, Tuple
import numpy as np
from opensfm import bow
from opensfm import config
from opensfm import matching
from opensfm import pairs_selection
from opensfm import pyfeatures
from opensfm.synthetic_data import synthetic_dataset
def compute_words(features: np.ndarray, bag_of_word... |
10,770 | test redis stream backend expires | from __future__ import annotations
import asyncio
from datetime import timedelta
from typing import AsyncGenerator, cast
import pytest
from _pytest.fixtures import FixtureRequest
from redis.asyncio.client import Redis
from litestar.channels import ChannelsBackend
from litestar.channels.backends.memory import MemoryC... |
10,771 | auth0 dataset | from typing import Any, Dict, Generator
import pydash
import pytest
import requests
from sqlalchemy.orm import Session
from starlette.status import HTTP_204_NO_CONTENT
from fides.api.cryptography import cryptographic_util
from fides.api.db import session
from fides.api.models.connectionconfig import (
AccessLevel... |
10,772 | throw error | import json
from typing import List, Any, Callable
import pytest
from expungeservice.crawler.crawler import Crawler
from expungeservice.models.case import Case
from tests.endpoints.endpoint_util import EndpointShared
from tests.factories.crawler_factory import CrawlerFactory
from expungeservice.record_creator import ... |
10,773 | compute repeat | # Copyright 2016 Antonio Espinosa <antonio.espinosa@tecnativa.com>
# Copyright 2014-2017 Tecnativa - Pedro M. Baeza <pedro.baeza@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl
from odoo import _, api, fields, models
class AeatModelExportConfigLine(models.Model):
_name = "aeat.model.... |
10,774 | test booleans b alias | import unittest
import os
import shutil
from tempfile import mkdtemp
from subprocess import Popen, PIPE
class SepolicyTests(unittest.TestCase):
def assertDenied(self, err):
self.assert_('Permission denied' in err,
'"Permission denied" not found in %r' % err)
def assertNotFound(s... |
10,775 | test shipping zone assign to warehouse no | import graphene
from .....warehouse.error_codes import WarehouseErrorCode
from ....tests.utils import get_graphql_content
MUTATION_ASSIGN_SHIPPING_ZONE_WAREHOUSE = """
mutation assignWarehouseShippingZone($id: ID!, $shippingZoneIds: [ID!]!) {
assignWarehouseShippingZone(id: $id, shippingZoneIds: $shippingZoneIds) {... |
10,776 | parse cmdline options | from __future__ import annotations
import shlex
import subprocess
import sys
from typing import Any
from typing import Callable
from typing import Dict
from typing import List
from typing import Mapping
from typing import Optional
from typing import Union
from .. import util
from ..util import compat
REVISION_SCRIP... |
10,777 | get archive type | import uuid
import pathlib
import zipfile
import tarfile
import mimetypes
from typing import Dict, Tuple, Any
from .types import DataFlow, Input, InputFlow, Operation
from ..operation.archive import (
make_tar_archive,
make_zip_archive,
extract_tar_archive,
extract_zip_archive,
)
from ..operation.compr... |
10,778 | test07 no package on standby | #!/usr/bin/env python3
import os
from gppylib.operations.test.regress.test_package import GppkgTestCase, unittest, skipIfNoStandby, get_host_list, ARCHIVE_PATH, run_command, skipIfSingleNode
from gppylib.operations.unix import RemoveRemoteFile, CheckRemoteFile
class CleanGppkgTestCase(GppkgTestCase):
def setUp(s... |
10,779 | test dataset attr retention | from __future__ import annotations
import pytest
import xarray
from xarray import concat, merge
from xarray.backends.file_manager import FILE_CACHE
from xarray.core.options import OPTIONS, _get_keep_attrs
from xarray.tests.test_dataset import create_test_data
def test_invalid_option_raises() -> None:
with pytes... |
10,780 | swish jit bwd | """ Activations (memory-efficient w/ custom autograd)
A collection of activations fn and modules with a common interface so that they can
easily be swapped. All have an `inplace` arg even if not used.
These activations are not compatible with jit scripting or ONNX export of the model, please use either
the JIT or bas... |
10,781 | test buffer load store | # 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... |
10,782 | write to excel | import pandas as pd
import os
# This function needs more improving with regards to formatting the excel output
# Writing the output to excel
def METHOD_NAME(comp_values):
current_dir = os.path.realpath(os.path.dirname(__file__))
df = pd.DataFrame(comp_values)
with pd.ExcelWriter(os.path.join(current_dir... |
10,783 | complexity | """
Ethereum Virtual Machine (EVM) MODEXP PRECOMPILED CONTRACT
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. contents:: Table of Contents
:backlinks: none
:local:
Introduction
------------
Implementation of the `MODEXP` precompiled contract.
"""
from ethereum.base_types import U256, Bytes, ... |
10,784 | setup dependent build environment | # Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import platform
from spack.package import *
class IbmJava(Package):
"""Binary distribution of the IBM Jav... |
10,785 | test api version 3 manual | """Tests for certbot_dns_linode._internal.dns_linode."""
import sys
import unittest
from unittest import mock
import pytest
from certbot import errors
from certbot.compat import os
from certbot.plugins import dns_test_common
from certbot.plugins import dns_test_common_lexicon
from certbot.tests import util as test_u... |
10,786 | process commandline | #!/usr/bin/python
#
# Author: Michele Bologna <michele.bologna@suse.com>
#
## language imports
from __future__ import print_function
import os
import sys
import glob
import pwd
import time
import shutil
import argparse
from certs.sslToolCli import CertExpTooShortException, \
CertExpTooLongException, InvalidC... |
10,787 | main | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
#
# Copyright (C) 2015-2016 Zhuyifei1999
#
# 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) a... |
10,788 | checkraises | # UserString is a wrapper around the native builtin string type.
# UserString instances should behave similar to builtin string objects.
import string
from test import test_support, string_tests
from UserString import UserString, MutableString
import warnings
class UserStringTest(
string_tests.CommonTest,
str... |
10,789 | convert pipette name | import re
from typing import List, Optional, Union, cast
from .dev_types import PipetteModel, PipetteName
from .types import (
PipetteChannelType,
PipetteModelType,
PipetteVersionType,
PipetteGenerationType,
PipetteModelMajorVersionType,
PipetteModelMinorVersionType,
)
from .pipette_definition i... |
10,790 | test config file | # Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import pytest
from pants.backend.build_files.fmt.black.register import BlackRequest
from pants.backend.build_files.fmt.black.register import rules as b... |
10,791 | test create group badge | """
GitLab API: https://docs.gitlab.com/ee/api/project_badges.html
GitLab API: https://docs.gitlab.com/ee/api/group_badges.html
"""
import re
import pytest
import responses
from gitlab.v4.objects import GroupBadge, ProjectBadge
link_url = (
"http://example.com/ci_status.svg?project=example-org/example-project&re... |
10,792 | verify row | # Copyright (C) 2019-2023 Zilliz. 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 applicable law or ag... |
10,793 | test 02 with smsc | # -*- coding: utf-8 -*-
#
# LinOTP - the open source solution for two factor authentication
# Copyright (C) 2010-2019 KeyIdentity GmbH
# Copyright (C) 2019- netgo software GmbH
#
# This file is part of LinOTP smsprovider.
#
# This program is free software: you can redistribute it and/or
# modify i... |
10,794 | i file | #! /usr/bin/env python
# encoding: UTF-8
# Petar Forai
# Thomas Nagy 2008-2010 (ita)
import re
from waflib import Task, Logs
from waflib.TaskGen import extension, feature, after_method
from waflib.Configure import conf
from waflib.Tools import c_preproc
"""
tasks have to be added dynamically:
- swig interface files m... |
10,795 | on tick | # Copyright 2016-2022 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from gi.repository import GLib
f... |
10,796 | is json content type | import json
from copy import deepcopy
from sentry_sdk.hub import Hub, _should_send_default_pii
from sentry_sdk.utils import AnnotatedValue
from sentry_sdk._compat import text_type, iteritems
from sentry_sdk._types import TYPE_CHECKING
if TYPE_CHECKING:
import sentry_sdk
from typing import Any
from typin... |
10,797 | charmap decode | import codecs
import sys
from _typeshed import ReadableBuffer
from collections.abc import Callable
from typing import overload
from typing_extensions import Literal, TypeAlias
# This type is not exposed; it is defined in unicodeobject.c
class _EncodingMap:
def size(self) -> int: ...
_CharMap: TypeAlias = dict[int... |
10,798 | test data iterator | import weakref
from typing import Any, Callable, Dict, List
import numpy as np
import pytest
from hypothesis import given, settings, strategies
from scipy.sparse import csr_matrix
import xgboost as xgb
from xgboost import testing as tm
from xgboost.data import SingleBatchInternalIter as SingleBatch
from xgboost.testi... |
10,799 | test get dot within notebook | #
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.