id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
6,800
test word count
#!/usr/bin/env python # --!-- coding: utf8 --!-- """Tests for functions""" import re from manuskript import functions as F def METHOD_NAME(): assert F.wordCount("In the beginning was the word.") == 6 assert F.wordCount("") == 0 def test_convert(): # toInt assert F.toInt("9") == 9 assert F.toInt...
6,801
move forward
# -*- coding: utf-8 -*- """ Created on Fri Aug 6 16:52:49 2021 @author: Hera """ from nplab.instrument.serial_instrument import SerialInstrument from nplab.instrument import Instrument from nplab.utils.notified_property import NotifiedProperty from nplab.ui.ui_tools import QuickControlBox def bytes_to_binary(bytear...
6,802
test get sendable message excess
"""Tests sopel.tools""" from __future__ import annotations import re from sopel import tools TMP_CONFIG = """ [core] owner = testnick nick = TestBot enable = coretasks """ def test_get_sendable_message_default(): initial = 'aaaa' text, excess = tools.get_sendable_message(initial) assert text == initi...
6,803
is get deprecated
# -*- 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 server. # # This program is free software: you can redistribute it and/or # modify it und...
6,804
start feeds
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot) # Copyright (c) 2023 Drakkar-Software, All rights reserved. # # OctoBot 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 ...
6,805
test no short cutting
########################################################################## # # Copyright (c) 2011, John Haddon. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of so...
6,806
enqueue tick
import asyncio import sys import threading from asyncio import events import System.Windows.Forms as WinForms from System import Action from System.Threading.Tasks import Task class WinformsProactorEventLoop(asyncio.ProactorEventLoop): def run_forever(self, app_context): """Set up the asyncio event loop,...
6,807
test same pauli traces clifford
# pylint: disable=wrong-or-nonexistent-copyright-notice import numpy as np import pytest import cirq import examples.direct_fidelity_estimation as dfe def test_direct_fidelity_estimation_no_noise_clifford(): qubits = cirq.LineQubit.range(3) circuit = cirq.Circuit(cirq.Z(qubits[0]), cirq.X(qubits[1]), cirq.X(q...
6,808
test write bytes read bytes
# # This file is part of the PyMeasure package. # # Copyright (c) 2013-2023 PyMeasure Developers # # 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 limit...
6,809
test assemble xml file write
############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # Copyright (c), 2013-2023, John McNamara, jmcnamara@cpan.org # import unittest from io import StringIO from ..helperfunctions import _xml_to_list from ...worksheet import...
6,810
clean inputs
# This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Copyright the Hypothesis Authors. # Individual contributors are listed in AUTHORS.rst and the git log. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the...
6,811
addr imm
from __future__ import print_function import sys import logging def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) console = logging.StreamHandler() logger = logging.getLogger() logger.addHandler(console) logger.setLevel(logging.ERROR) labels = {} program = [] imm_expr = [] imm_dict = {} im...
6,812
hello logging job type fixture
import json import logging import os import pytest from dagster import ( String, _seven as seven, execute_job, job, logger, reconstructable, ) from dagster._core.test_utils import instance_for_test from dagster._utils import safe_tempfile_path from dagstermill.examples.repository import hello_l...
6,813
configure loader modules
""" :codeauthor: Jayesh Kariya <jayeshk@saltstack.com> """ import pytest import salt.states.mysql_user as mysql_user import salt.utils.data from tests.support.mock import MagicMock, patch @pytest.fixture def METHOD_NAME(): return {mysql_user: {}} def test_present(): """ Test to ensure that the nam...
6,814
tokenize
#!/usr/bin/env python3 import re import sys import os import inspect import nltk.corpus import nltk.METHOD_NAME from collections import defaultdict def is_hyphen(s): return s in ("-", "–") def no_hyphens(ws): return tuple(w for w in ws if not is_hyphen(w)) def get_text(node): result = [] def vis...
6,815
test artifactpriority detail api method delete
import urllib.parse from django.contrib.auth.models import User from django.test import TestCase from dfirtrack_artifacts.models import Artifactpriority class ArtifactpriorityAPIViewTestCase(TestCase): """artifactpriority API view tests""" @classmethod def setUpTestData(cls): # create object ...
6,816
catch std outputs
import os import sys import threading import collections import websocket import json from datetime import datetime from openpype.lib import Logger from openpype_modules.webserver.host_console_listener import MsgAction log = Logger.get_logger(__name__) class StdOutBroker: """ Application showing console in ...
6,817
test yields
from recipe_scrapers._grouping_utils import IngredientGroup from recipe_scrapers.halfbakedharvest import HalfBakedHarvest from tests import ScraperTest class TestHalfBakedHarvestScraper(ScraperTest): scraper_class = HalfBakedHarvest test_file_name = "halfbakedharvest_groups" def test_host(self): ...
6,818
write length
# # Copyright (c) 2014-2015 Sylvain Peyrefitte # # This file is part of rdpy. # # rdpy 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. ...
6,819
serialize
# Copyright 2018-2023 contributors to the OpenLineage project # SPDX-License-Identifier: Apache-2.0 import json import os import textwrap from enum import Enum from unittest import mock import attr import pytest from openlineage.client import set_producer from openlineage.common.provider.dbt.local import DbtLocalArti...
6,820
test unary abs
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
6,821
asana task to amundsen data issue
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 import asana import logging from typing import Any, Dict, List from amundsen_application.base.base_issue_tracker_client import BaseIssueTrackerClient from amundsen_application.models.data_issue import DataIssue, Priority from amun...
6,822
connect
import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras import backend as K from tensorflow.keras.layers import Dense from spektral.layers import ops from spektral.layers.pooling.src import SRCPool class DMoNPool(SRCPool): r""" The DMoN pooling layer from the paper > [Graph...
6,823
assert dict equal
# Stubs for unittest.case (Python 3.5) # # NOTE: This dynamically typed stub was automatically generated by stubgen. from typing import Any import logging from collections import namedtuple DIFF_OMITTED = ... # type: Any class SkipTest(Exception): ... class _ShouldStop(Exception): ... class _UnexpectedSuccess(Excep...
6,824
set up
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################### # # Copyright 2006 - 2021, Tomas Babej, Paul Beckingham, Federico Hernandez. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated d...
6,825
instruction duration validation
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
6,826
macaddr dtype
from __future__ import annotations import warnings import hypothesis as h import hypothesis.extra.pandas as past import hypothesis.extra.pytz as tzst import hypothesis.strategies as st import ibis import ibis.expr.datatypes as dt import ibis.expr.schema as sch from ibis.common.temporal import IntervalUnit # Strateg...
6,827
kill running benchmark instances
# SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. # Licensed to Elasticsearch B.V. under one ...
6,828
test run spots common mistake
# This file is part of Checkbox. # # # Copyright 2012 Canonical Ltd. # Written by: # Zygmunt Krynicki <zygmunt.krynicki@canonical.com> # # Checkbox is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, # as published by the Free Software Foundation. ...
6,829
mock ldclient
""" This file sets up the "globals" we need for our tests namely, it creates the Avrae instance and overrides its http and gateway handlers and defines a bunch of helper methods """ import asyncio import json import logging import os import pathlib import random import pytest # setup bot from dbot import bot # here ...
6,830
get corr rval
""" This file contains the utilities for generating random numbers in gulpy. """ import logging from math import sqrt import numpy as np from numba import njit from scipy.stats import norm logger = logging.getLogger(__name__) GROUP_ID_HASH_CODE = np.int64(1543270363) EVENT_ID_HASH_CODE = np.int64(1943272559) HASH...
6,831
name
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
6,832
test user keywords
import unittest from pathlib import Path from robot.errors import DataError from robot.utils import Importer from robot.utils.asserts import assert_equal, assert_raises, assert_true from robot.running import TestSuite, TestSuiteBuilder DATADIR = (Path(__file__).parent / '../../atest/testdata/misc').resolve() def b...
6,833
test residual scaling
import os import numpy as np from pytacs_analysis_base_test import PyTACSTestCase from tacs import pytacs, elements, constitutive, functions """ This is the same test cases as `test_shell_plate_quad.py`, but the plate is been rotated about the y-axis by 45 degrees, so that it lies in a slant in the xz plane. This te...
6,834
test sorter dtype mismatch
# Copyright 2022 NVIDIA Corporation # # 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 wr...
6,835
translators
from unittest.mock import patch import pytest from django.http import HttpResponse from django.shortcuts import render from pontoon.test.factories import UserFactory def _get_sorted_users(): return sorted(UserFactory.create_batch(size=3), key=lambda u: u.email) @pytest.fixture def METHOD_NAME(): return _...
6,836
create placeholder
# Copyright (c) Princeton University. # This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory of this source tree. # Authors: # - Alexander Raistrick: AssetFactory, make_asset_collection # - Lahav Lipson: quickly_resample import typing import bpy import mathuti...
6,837
is armed
############################################################################# # Celestica Seastone2 # # Watchdog contains an implementation of SONiC Platform Base API # ############################################################################# import os import time try: from sonic_platform_base.watchdog_base im...
6,838
chainer local training job
# 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...
6,839
content
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
6,840
create trash folder
from errno import ENOTEMPTY from os import W_OK, access, mkdir, rmdir, stat, statvfs, walk from os.path import getsize, isdir, join, realpath, split from time import time from enigma import eBackgroundFileEraser, eLabel, iRecordableService, pNavigation from Components.config import config from Components.GUIComponent...
6,841
type
# 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__ ...
6,842
get api token
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # # # REQUIREMENTS: # 1. sudo apt-get install chromium-chromedriver # 2. pip install selenium # 3. ../secrets/creds.json with buyers email/password and account client_id/secret # HOW TO USE: # python paypal_transaction_generator.py - will generate 3 transa...
6,843
test clone
import os import subprocess from pathlib import Path from tempfile import TemporaryDirectory import pytest from repo2docker.contentproviders import Mercurial from repo2docker.contentproviders.mercurial import args_enabling_topic SKIP_HG = os.environ.get("REPO2DOCKER_SKIP_HG_TESTS", "").lower() not in { "", "...
6,844
test float
# 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")...
6,845
object create
from __future__ import unicode_literals from ..conversions import * from ..func_utils import * from ..base import is_data_descriptor import six def Object(this, args): val = get_arg(args, 0) if is_null(val) or is_undefined(val): return args.space.NewObject() return to_object(val, args.space) def...
6,846
registration view
from django.shortcuts import redirect from django.template.loader import render_to_string from django.template.response import TemplateResponse from django.utils.translation import gettext_lazy as _ from oioioi.base.utils.query_helpers import Q_always_true from oioioi.base.utils.redirect import safe_redirect from oioi...
6,847
configure loader modules
import pytest import salt.fileserver.roots as roots from salt.utils.odict import OrderedDict from tests.support.mock import patch pytestmark = [ pytest.mark.windows_whitelisted, ] @pytest.fixture(scope="function") def METHOD_NAME(minion_opts): return {roots: {"__opts__": minion_opts}} # nox -e pytest-zero...
6,848
apply rst
#!/usr/bin/env python # encoding: utf-8 # Jérôme Carretero, 2013 (zougloub) """ reStructuredText support (experimental) Example:: def configure(conf): conf.load('rst') if not conf.env.RST2HTML: conf.fatal('The program rst2html is required') def build(bld): bld( features = 'rst', type = 'rst2htm...
6,849
update message flags
from typing import List, Optional from django.http import HttpRequest, HttpResponse from django.utils.translation import gettext as _ from zerver.actions.message_flags import ( do_mark_all_as_read, do_mark_stream_messages_as_read, do_update_message_flags, ) from zerver.lib.exceptions import ErrorCode, Jso...
6,850
state name
import socket from pyroute2.netlink.nfnetlink.nfctsocket import ( IP_CT_TCP_FLAG_TO_NAME, IPSBIT_TO_NAME, TCP_CONNTRACK_TO_NAME, NFCTAttrTuple, NFCTSocket, ) class NFCTATcpProtoInfo(object): __slots__ = ( 'state', 'wscale_orig', 'wscale_reply', 'flags_orig', ...
6,851
run
import logging from abc import abstractmethod from typing import Dict, List, Optional, Tuple, Any from haystack.nodes.base import BaseComponent, Document logger = logging.getLogger(__name__) DEFAULT_LANGUAGES = ["en", "de", "es", "cs", "nl"] class BaseDocumentLanguageClassifier(BaseComponent): """ Abstrac...
6,852
datetime never
# -*- coding: utf-8 # utility # ******* # # Utility Functions import re import uuid from datetime import datetime, timedelta from twisted.internet import reactor from twisted.internet.defer import Deferred def get_distribution_codename(): try: with open("/etc/os-release", "r") as fd: for...
6,853
test num data
import pytest import numpy as np import numpy.testing as npt import copy import unittest from lenstronomy.Data.imaging_data import ImageData import lenstronomy.Util.util as util class TestData(object): def setup_method(self): self.numPix = 10 kwargs_data = { "image_data": np.zeros((se...
6,854
run model
from runtime.segmented_run.prepare_config import HighLevelConfig from runtime.segmented_run.api import create, append from runtime.steppers.radiation import RadiationStepper from runtime.types import State import cftime import yaml import xarray as xr import numpy as np import pytest import dataclasses import os @dat...
6,855
run
# Copyright 2021-2023 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 """ Load example input data for an scd2 template test. """ from vdk.api.job_input import IJobInput __author__ = "VMware, Inc." __copyright__ = ( "Copyright 2019 VMware, Inc. All rights reserved. -- VMware Confidential" ) def METHOD_NAME(jo...
6,856
upload ccache
#!/usr/bin/env python3 import logging import time import sys import os import shutil from pathlib import Path import requests from compress_files import decompress_fast, compress_fast DOWNLOAD_RETRIES_COUNT = 5 def dowload_file_with_progress(url, path): logging.info("Downloading from %s to temp path %s", url,...
6,857
ready to be validate
from django.db import models from django.core.mail import send_mail from django.conf import settings from django.template.loader import render_to_string from django.contrib.sites.models import Site from django.urls import reverse class AbstractValidation(models.Model): """Simple Abstract Validation model """ ...
6,858
remove listener
import asyncio import logging import random import threading import time import uuid from typing import Awaitable, Callable, Dict, List, Optional from antarest.core.interfaces.eventbus import Event, EventType, IEventBus from antarest.eventbus.business.interfaces import IEventBusBackend logger = logging.getLogger(__na...
6,859
languages get
# coding: utf-8 """ LanguagesApi.py Copyright 2015 SmartBear Software 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...
6,860
set tr
# Created By: Virgil Dupras # Created On: 2010-06-23 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-...
6,861
anonymize external immatriculation
from collections import defaultdict import numpy as np from faker import Faker class DataAnonymizer(object): __faker = Faker("FR") def __init__(self, data_type: str = "cfr"): self.__cfr_dict = defaultdict(self.make_fake_cfr) self.__external_immatriculation_dict = defaultdict( se...
6,862
is observation task present
# pylint:disable=protected-access # pylint:disable=redefined-outer-name # pylint:disable=unused-argument from collections.abc import AsyncIterator from unittest.mock import AsyncMock import pytest from fastapi import FastAPI from pytest_mock.plugin import MockerFixture from pytest_simcore.helpers.utils_envs import En...
6,863
assert changes produce expected model
import asyncio from collections.abc import Sequence from typing import Any from jsonpointer import set_pointer import reactpy from reactpy.core.layout import Layout from reactpy.core.serve import serve_layout from reactpy.core.types import LayoutUpdateMessage from reactpy.testing import StaticEventHandler from tests....
6,864
test delete job
# 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 turbogears.database import session from bkr.inttest import data_s...
6,865
get literal string
import collections from _typeshed import Incomplete from types import TracebackType from typing import Any from typing_extensions import Literal def encode_text(s: str) -> bytes: ... PDFDocEncoding: dict[int, str] def decode_text(b: bytes) -> str: ... class PdfFormatError(RuntimeError): ... def check_format_condit...
6,866
unset verbose files
# -*- coding: utf-8 -*- r""" Verbosity System and Logging in SageMath Howto: Logging ============== Using Python's Logging Module ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Import it:: sage: import logging sage: logging.basicConfig() # only needed once Setting the level:: sage: logging.getLogger().setLevel(loggin...
6,867
check
import numpy as np import pyarrow as pa import numpy as np import sys, os import tempfile import random from numpy.testing import assert_array_equal # ************************************************************************** # # Data generators # # *********...
6,868
library
import pytest from align.schema.model import Model from align.schema.instance import Instance from align.schema.subcircuit import Circuit from align.schema.types import set_context, List @pytest.fixture() def METHOD_NAME(): METHOD_NAME = List[Model]() with set_context(METHOD_NAME): model = Model( ...
6,869
connect
# ------------------------------------------------------------------------------------------------- # Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved. # https://nautechsystems.io # # Licensed under the GNU Lesser General Public License Version 3.0 (the "License"); # You may not use this file ex...
6,870
test array of array
# -*- coding: utf-8 -*- import copy import datetime import pytest from bravado_core.exception import SwaggerMappingError from bravado_core.spec import Spec from bravado_core.unmarshal import unmarshal_array @pytest.fixture def int_array_spec(): return { 'type': 'array', 'items': { 't...
6,871
spec for sensitive tests
# don't import any costly modules import sys import os is_pypy = '__pypy__' in sys.builtin_module_names def warn_distutils_present(): if 'distutils' not in sys.modules: return if is_pypy and sys.version_info < (3, 7): # PyPy for 3.6 unconditionally imports distutils, so bypass the warning ...
6,872
main
#!/usr/bin/env python from __future__ import absolute_import from __future__ import division from __future__ import print_function import re import shutil import sys import pwnlib.args pwnlib.args.free_form = False from pwn import * from pwnlib.commandline import common parser = common.parser_commands.add_parser( ...
6,873
alternative id
###################################################################################################################### # Copyright (C) 2017-2023 Spine project consortium # This file is part of Spine Toolbox. # Spine Toolbox is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser Gen...
6,874
test non doi uri to doi
# -*- coding: utf-8 -*- import unittest from .DataTestTemplate import _DataTest from owmeta_core.graph_object import IdentifierMissingException from owmeta.document import (Document, _doi_uri_to_doi, WormbaseRetrievalException) import pytest class DocumentTest...
6,875
get oauth client
import logging from collections.abc import Collection from typing import Any, NamedTuple from airflow.exceptions import AirflowSkipException from airflow.models import Variable from requests_oauthlib import OAuth2Session log = logging.getLogger(__name__) class OauthProvider(NamedTuple): """Representation of th...
6,876
getsize
"""Simple class to read IFF chunks. An IFF chunk (used in formats such as AIFF, TIFF, RMFF (RealMedia File Format)) has the following structure: +----------------+ | ID (4 bytes) | +----------------+ | size (4 bytes) | +----------------+ | data | | ... | +----------------+ The ID is a 4-byte s...
6,877
get settings
from .utils import NamespacedClient, query_params, _make_path class ClusterClient(NamespacedClient): @query_params('level', 'local', 'master_timeout', 'timeout', 'wait_for_active_shards', 'wait_for_nodes', 'wait_for_relocating_shards', 'wait_for_status') def health(self, index=None, params=None...
6,878
validate
# Copyright (c) 2017, Frappe Technologies and contributors # License: MIT. See LICENSE import json import frappe import frappe.utils from frappe import _ from frappe.model.document import Document from frappe.utils.jinja import validate_template from frappe.utils.weasyprint import download_pdf, get_html class Print...
6,879
parse kv
import os import pathlib import subprocess import sys import urllib from typing import Dict, List, Optional, Tuple # Path component is a node in a tree. # It's the equivalent of a short file/directory name in a file system. # In our abstraction, it's represented as arbitrary bag of attributes TestPathComponent = Dict[...
6,880
forward in
import struct import logging import asyncio from amaranth import * from ....support.bits import * from ....support.logging import * from ....support.endpoint import * from ....gateware.pads import * from ....database.jedec import * from ....arch.jtag import * from ... import * from ..jtag_probe import JTAGProbeBus c...
6,881
remove tmp file
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2017, Alejandro Gomez <alexgomez2202@gmail.com> # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later from __future__ import absolute_import, division, pri...
6,882
test checkout customer attach by id
import graphene from .....checkout.error_codes import CheckoutErrorCode from ....tests.utils import assert_no_permission, get_graphql_content CHECKOUT_CUSTOMER_ATTACH_MUTATION = """ mutation checkoutCustomerAttach($checkoutId: ID, $token: UUID) { checkoutCustomerAttach(checkoutId: $checkoutId, token: $tok...
6,883
parse x name
# -*- coding: utf-8 -*- # """*********************************************************************************************""" # FileName [ dataset.py ] # Synopsis [ the phone dataset ] # Author [ S3PRL ] # Copyright [ Copyleft(c), Speech Lab, NTU, Taiwan ] """***********************************...
6,884
visualize
import glob import itertools import math from copy import deepcopy from itertools import combinations import cv2 import numpy as np import pandas as pd from joblib import Parallel, delayed from numba import jit, prange from scipy.spatial import ConvexHull class EgocentricalAlignmentFeaturizer(object): def __init...
6,885
download xbuildenv
import json import shutil import subprocess from pathlib import Path from urllib.error import HTTPError from urllib.request import urlopen, urlretrieve from pyodide_lock import PyodideLockSpec from . import build_env from .common import exit_with_stdio from .create_pypa_index import create_pypa_index from .logger imp...
6,886
sanitize text
import os import logging from hashlib import sha1 from babel import Locale from gettext import translation from threading import local from typing import cast, Dict, Any, List, Optional, TypeVar, Union, Sequence from normality import stringify from normality.cleaning import compose_nfc from normality.cleaning import r...
6,887
list
# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRe...
6,888
name
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
6,889
split lora model
# Convert LoRA to different rank approximation (should only be used to go to lower rank) # This code is based off the extract_lora_from_models.py file which is based on https://github.com/cloneofsimo/lora/blob/develop/lora_diffusion/cli_svd.py # Thanks to cloneofsimo import argparse import math import os import torch ...
6,890
test log prob
# Copyright 2020 The GPflow Contributors. 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...
6,891
finalize options
"""distutils.command.bdist_dumb Implements the Distutils 'bdist_dumb' command (create a "dumb" built distribution -- i.e., just an archive to be unpacked under $prefix or $exec_prefix).""" import os from distutils.core import Command from distutils.util import get_platform from distutils.dir_util import remove_tree, ...
6,892
should pre quantize
# Copyright 2019 Xilinx Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
6,893
get range func
""" Base class for integrators. """ # Third-party import numpy as np # This project from gala.units import UnitSystem, DimensionlessUnitSystem __all__ = ["Integrator"] class Integrator(object): def __init__( self, func, func_args=(), func_units=None, progress=False, ...
6,894
test generate thumbnail more than one given
from django.test import tag from django.http import QueryDict from tests.BaseTestWithDB import BaseTestWithDB from tests.resources.ResourcesTestDataGenerator import ResourcesTestDataGenerator from tests.resources.BareResourceGenerator import BareResourceGenerator, BareResourceGeneratorWithCopies from unittest.mock impo...
6,895
invalid test parameters
from common import Protocols from providers import S2N from global_flags import get_flag, S2N_FIPS_MODE def to_bytes(val): return bytes(str(val).encode('utf-8')) def to_string(val: bytes): return val.decode(encoding="ascii", errors="backslashreplace") def get_expected_s2n_version(protocol, provider): ...
6,896
internal nodes in cell
#------------------------------------------------------------------------------- # NestedGridNeighbor #------------------------------------------------------------------------------- from PYB11Generator import * from Neighbor import * from NeighborAbstractMethods import * @PYB11template("Dimension") class NestedGridNe...
6,897
test boto3 yaml validate template url successful
import json import boto3 import botocore import pytest from moto import mock_cloudformation, mock_s3 from tests import EXAMPLE_AMI_ID json_template = { "AWSTemplateFormatVersion": "2010-09-09", "Description": "Stack 1", "Resources": { "EC2Instance1": { "Type": "AWS::EC2::Instance", ...
6,898
test has local classes
import jpyutil import unittest def some_function(x): return x * x def some_function2(x): return x * x * x class TheContext: def __init__(self, amount): self.amount = amount def plus(self, other): return self.amount + other # Note: all jpy unit testing should go in this class for now, due to # IDS-4...
6,899
long running task
"""Test class for Notifications API :Requirement: Notifications :CaseAutomation: Automated :CaseLevel: Acceptance :CaseComponent: Notifications :Team: Endeavour :TestType: Functional :CaseImportance: High :Upstream: No """ from mailbox import mbox from re import findall from tempfile import mkstemp import pyte...