id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
13,200
verify
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. """Esri 2020 Land Cover Dataset.""" import glob import os from typing import Any, Callable, Optional import matplotlib.pyplot as plt from rasterio.crs import CRS from .geo import RasterDataset from .utils import download_u...
13,201
remove articles
# Copyright (c) Microsoft Corporation # All rights reserved. # # MIT License # # 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...
13,202
called collect apis
from typing import ClassVar, Dict, Optional, List from attrs import define, field from resoto_plugin_aws.resource.base import AwsResource, GraphBuilder, AwsApiSpec from resoto_plugin_aws.resource.kms import AwsKmsKey from resotolib.baseresources import ModelReference from resotolib.graph import Graph from resotolib.j...
13,203
test dictfirst on some column with label
# This file is a part of the AnyBlok project # # Copyright (C) 2015 Jean-Sebastien SUZANNE <jssuzanne@anybox.fr> # Copyright (C) 2015 Denis VIVIÈS <dvivies@geoblink.com> # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the MPL was not distributed with this fi...
13,204
test delete local user
import json import globus_sdk import pytest from globus_sdk._testing import get_last_request, load_response, load_response_set def test_filter_rules(run_line, go_ep1_id, go_ep2_id): """ Submits two --exclude and two --include options on a transfer, confirms they show up the correct order in --dry-run out...
13,205
test glob lexer
#!/usr/bin/env python2 """ glob_test.py: Tests for glob.py """ from __future__ import print_function import re import unittest from frontend import match from osh import glob_ class GlobEscapeTest(unittest.TestCase): def testEscapeUnescape(self): esc = glob_.GlobEscape unesc = glob_.GlobUnescape...
13,206
last modified time
# 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...
13,207
sessions rejected count
from marshmallow_jsonapi import fields from marshmallow_jsonapi.flask import Schema from sqlalchemy import distinct, func from app.api.helpers.cache import cache from app.api.helpers.utilities import dasherize from app.models.session import Session from app.models.speaker import Speaker from app.models.sponsor import ...
13,208
make test data
# (c) Copyright IBM Corp. 2010, 2017. All Rights Reserved. from __future__ import print_function import pytest import resilient class TestPatch: def test_patch(self): existing = {"a": 1, "properties": {"b": 2}, "vers": 99} patch = resilient.Patch(existing) patch.add_value("a", 5) ...
13,209
test issues maintainer response duration
#SPDX-License-Identifier: MIT import pytest import pandas as pd from augur.api.metrics.issue import * def test_issues_new(): #repo_id assert issues_new(1, 1 , period='year').iloc[0]['issues'] > 0 #repo_group_id assert issues_new(10, period='year').iloc[1]['issues'] > 0 #begin_date & end_date ...
13,210
edit t4c model
# SPDX-FileCopyrightText: Copyright DB Netz AG and the capella-collab-manager contributors # SPDX-License-Identifier: Apache-2.0 from collections import abc import fastapi from fastapi import status from sqlalchemy import exc, orm from capellacollab.core import database from capellacollab.core.authentication import ...
13,211
ruby packages version check
#!/usr/bin/env python3 import sys __version__ = '0.2' __home__ = 'blackarch.org' to_release = '' # get current version def get_current_version(name): with open('../packages/{name}/PKGBUILD'.format(name=name), 'r', encoding='utf-8') as file: for line in file: if 'pkgver' in line: ...
13,212
test convert x
# -*- coding: utf-8 -*- import numpy as np import pytest from aeon.base import BaseCollectionEstimator from aeon.utils.validation.collection import COLLECTIONS_DATA_TYPES from aeon.utils.validation.tests.test_collection import ( EQUAL_LENGTH_UNIVARIATE, UNEQUAL_LENGTH_UNIVARIATE, get_type, ) @pytest.mark...
13,213
test50
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2022 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it a...
13,214
publish telemetry
import datetime import logging import sys import threading from typing import TYPE_CHECKING, Any, List, Optional, TypeVar if sys.version_info >= (3, 8): from typing import Protocol, runtime_checkable else: from typing_extensions import Protocol, runtime_checkable if TYPE_CHECKING: from typing import Deque...
13,215
set up
from collections import namedtuple from textwrap import dedent from django.test import TestCase from django.template import Context, Template from zds.utils.templatetags.emarkdown import shift_heading class EMarkdownTest(TestCase): def METHOD_NAME(self): self.content = "# Titre 1\n\n## Titre **2**\n\n##...
13,216
compute bic
#!/usr/bin/env python """Class that implements X-means.""" import argparse import numpy as np import time import pylab as plt import scipy.cluster.vq as vq from scipy.spatial import distance class XMeans: def __init__(self, X, init_K=2, plot=False): self.X = X self.init_K = init_K self.pl...
13,217
model fn
# Copyright 2018 The TensorFlow Hub 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 app...
13,218
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 __all__ =...
13,219
report status to configured job
# Copyright Contributors to the Packit project. # SPDX-License-Identifier: MIT import logging from typing import Optional, List, Set, Dict, Callable from ogr.abstract import GitProject from packit.config import JobType, PackageConfig, JobConfig from packit_service.config import ServiceConfig from packit_service.mode...
13,220
validate docker installation
import logging import os import posixpath import shutil import subprocess import tempfile import urllib.parse import urllib.request import docker from mlflow import tracking from mlflow.environment_variables import MLFLOW_TRACKING_URI from mlflow.exceptions import ExecutionException from mlflow.projects.utils import M...
13,221
url
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
13,222
run pr create
#!/usr/bin/env python3 """Prepares a new proposal file and PR.""" __copyright__ = """ Part of the Carbon Language project, under the Apache License v2.0 with LLVM Exceptions. See /LICENSE for license information. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """ import argparse import os import re import s...
13,223
test check team membership returns false if
from unittest.mock import patch from backend.models.postgis.statuses import ( TeamJoinMethod, TeamMemberFunctions, TeamRoles, ) from backend.services.team_service import ( TeamService, MessageService, TeamServiceError, ) from tests.backend.base import BaseTestCase from tests.backend.helpers.tes...
13,224
prop descriptions
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Line(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "indicator.gauge.threshold" _path_str = "indicator.gauge.threshold.line" _valid_props = {"color...
13,225
connection
# # ovirt-engine-setup -- ovirt engine setup # # Copyright oVirt Authors # SPDX-License-Identifier: Apache-2.0 # # """Cinderlib connection plugin.""" import gettext from otopi import constants as otopicons from otopi import plugin from otopi import transaction from otopi import util from ovirt_engine_setup.cinder...
13,226
quad model
import numpy as np from SCFTVEMModel2d import SCFTVEMModel2d, scftmodel2d_options from fealpy.functionspace.vem_space import VirtualElementSpace2d from fealpy.mesh.StructureQuadMesh import StructureQuadMesh from fealpy.mesh import Quadtree, QuadrangleMesh, HalfEdgeMesh2d from fealpy.mesh import TriangleMesh, TriangleMe...
13,227
set test params
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Copyright (c) DeFi Blockchain Developers # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. """Test Loan.""" from test_framework.test_framework import Def...
13,228
response is error
#!/usr/bin/env python3 # # linearize-hashes.py: List blocks in a linear, no-fork version of the chain. # # Copyright (c) 2013-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. # from http.client imp...
13,229
tear down
# # Copyright (C) 2023 by frePPLe bv # # 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, merge, publish, # d...
13,230
put object
import enum import time from uuid import uuid4 import boto3 from django.conf import settings from django.db import models from care.facility.models import FacilityBaseModel from care.users.models import User from care.utils.csp import config as cs_provider class FileUpload(FacilityBaseModel): """ Stores dat...
13,231
home dir
import os import platform import csv from typing import TYPE_CHECKING from xdg import ( xdg_cache_home, xdg_config_dirs, xdg_config_home, xdg_data_dirs, xdg_data_home, xdg_runtime_dir, xdg_state_home, ) from tackle.settings import settings if TYPE_CHECKING: from tackle.models import Co...
13,232
get
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: # # Copyright 2022 The NiPreps Developers <nipreps@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may...
13,233
load json string
""" NOTE: Need to update contentcuration/static/js/edit_channel/utils/number_parser.js too --- NUMBER REGULAR EXPRESSIONS --- VALID_NUMBER: [MIXED_NUMBER | FRACTION | DECIMAL | PERCENTAGE | INTEGER] DECIMAL: INTEGER.UNFORMATTED_INT PERCENTAGE: [DECIMAL | MIXED_NUMBER | FRACTION]% MIXED_NUMBER: INTEGER FRACTION FRACTIO...
13,234
log project published
from django.conf import settings from django.dispatch import receiver from django.utils import translation from django.utils.translation import gettext as _ from adhocracy4.dashboard import signals as a4dashboard_signals from . import models @receiver(a4dashboard_signals.module_component_updated) def log_module_com...
13,235
processed dir
import os import os.path as osp from typing import Callable, List, Optional import torch from torch_geometric.data import Data, InMemoryDataset, download_url class RelLinkPredDataset(InMemoryDataset): r"""The relational link prediction datasets from the `"Modeling Relational Data with Graph Convolutional Ne...
13,236
validate consensus
from lamden.storage import BlockStorage from contracting.db.driver import ContractDriver from lamden.logger.base import get_logger from lamden.crypto.block_validator import verify_block import threading VALIDATION_HEIGHT = '__validation_height' class ValidateChainHandler: def __init__(self, block_storage: BlockS...
13,237
test update
import uuid from datetime import datetime, timedelta from typing import Any import pytz from pypika.terms import Function from tests.testmodels import ( DatetimeFields, DefaultUpdate, Event, IntFields, JSONFields, SmallIntFields, Tournament, UUIDFields, ) from tortoise.contrib import t...
13,238
test bleed channel
""" Unit tests for bleed trail implementation. """ import unittest import numpy as np import galsim import imsim class BleedTrailTestCase(unittest.TestCase): "Bleed trail TestCase subclass" def setUp(self): self.nypix = 2000 self.sky_level = 800 self.full_well = int(1e5) self.r...
13,239
test is fs uuid fail 1
# -*- coding: utf-8 -*- # # This file is part of OpenMediaVault. # # @license http://www.gnu.org/licenses/gpl.html GPL Version 3 # @author Volker Theile <volker.theile@openmediavault.org> # @copyright Copyright (c) 2009-2023 Volker Theile # # OpenMediaVault is free software: you can redistribute it and/or modify #...
13,240
resource connection string
# 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__ ...
13,241
websocket client
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ # ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃ # ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃ # ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄...
13,242
test pyrochem subsetters
import unittest import numpy as np import pandas as pd import pyrolite.geochem from pyrolite.comp.codata import renormalise from pyrolite.geochem.norm import get_reference_composition from pyrolite.util.synthetic import normal_frame, normal_series # [print("# " + i) for i in dir(df.pyrochem) if "__" not in i and not...
13,243
set object
from git.util import ( LazyMixin, IterableObj, ) from .symbolic import SymbolicReference, T_References # typing ------------------------------------------------------------------ from typing import Any, Callable, Iterator, Type, Union, TYPE_CHECKING # NOQA from git.types import Commit_ish, PathLike, _T # N...
13,244
sleep
# Copyright 2016 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 accompa...
13,245
attempt to fit
from __future__ import division from builtins import range from past.utils import old_div import numpy as np import scipy.ndimage.filters as imf import scipy.optimize as spo """ Author: jpg66 October 2018 This script is for auto detecting and fitting sparse, high SNR peaks form spectra with a flat background. It is...
13,246
heading
"""Compare performance of mypyc-compiled mypy between one or more commits/branches. Simple usage: python misc/perf_compare.py my-branch master ... What this does: * Create a temp clone of the mypy repo for each target commit to measure * Checkout a target commit in each of the clones * Compile mypyc in each of...
13,247
print event5
#!/usr/bin/env python3 # # USAGE: test_usdt2.py # # Copyright 2017 Facebook, Inc # Licensed under the Apache License, Version 2.0 (the "License") from __future__ import print_function from bcc import BPF, USDT from unittest import main, TestCase from subprocess import Popen, PIPE from tempfile import NamedTemporaryFil...
13,248
delete
from django.db import transaction from django.db.models import Count from baserow_premium.admin.workspaces.exceptions import CannotDeleteATemplateGroupError from baserow_premium.admin.workspaces.handler import WorkspacesAdminHandler from baserow_premium.api.admin.views import AdminListingView from baserow_premium.lice...
13,249
close
# 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...
13,250
get merge cmd tmpl
import filecmp import os import subprocess import shlex import sys import tempfile from shutil import rmtree, copyfile import sublime from GitSavvy.core.git_command import mixin_base from ...common import util class MergeMixin(mixin_base): def launch_tool_for_file(self, fpath): """ Given the re...
13,251
create table
""" .. versionadded:: 2014.7.0 This is the default local master event queue built on sqlite. By default, an sqlite3 database file is created in the `sqlite_queue_dir` which is found at:: /var/cache/salt/master/queues It's possible to store the sqlite3 database files by setting `sqlite_queue_dir` to another loca...
13,252
get backend timeout
""" RedisCache with a fallback cache to prevent denial of service if Redis is down Freely inspired by django-cache-fallback Credits: - https://github.com/Kub-AT/django-cache-fallback/ """ import logging from django.conf import settings from django.core.cache import caches from django.core.cache.backe...
13,253
clone repo
""" Interaction with Mercurial repositories ======================================= Before using hg over ssh, make sure the remote host fingerprint already exists in ~/.ssh/known_hosts, and the remote host has this host's public key. .. code-block:: yaml https://bitbucket.org/example_user/example_repo: h...
13,254
transform file output
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
13,255
set up
# Copyright (c) 2021 The Regents of the University of Michigan # All rights reserved. # This software is licensed under the BSD 3-Clause License. import os import subprocess import sys from tempfile import TemporaryDirectory import pytest import signac import flow class ExitCodeError(RuntimeError): pass class...
13,256
add options
#!/usr/bin/env python3 # Copyright (c) 2014-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet accounts properly when there are cloned transactions with malleated scriptsigs.""" fro...
13,257
every n inner iters
# Copyright (c) OpenMMLab. All rights reserved. # Copyright (c) Alibaba, Inc. and its affiliates. from functools import wraps from modelscope.utils.constant import TrainerStages from modelscope.utils.import_utils import is_method_overridden from .priority import Priority class Hook: """ The Hook base class o...
13,258
get filter params
from __future__ import annotations from typing import Any, Mapping from rest_framework.request import Request from rest_framework.response import Response from sentry_sdk import Scope from sentry.api.base import Endpoint from sentry.api.exceptions import ProjectMoved, ResourceDoesNotExist from sentry.api.helpers.env...
13,259
resource req op
import time from dagster import Int, Output, RetryRequested, VersionStrategy, job from dagster._core.definitions.decorators import op from dagster._core.definitions.output import Out from dagster._core.test_utils import nesting_graph from dagster_celery import celery_executor # test_execute jobs @op def simple(_): ...
13,260
rpms upgrade
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # @starlark-rust: allow_string_literals_in_type_expr load("//antlir/antlir2/bzl:build_phase.bzl", "BuildPhase") load("//antlir/antlir2/bzl:...
13,261
plot
""" Benchmark hyperparameters of GapEncoder on traffic_violations dataset """ from utils import default_parser, find_result, monitor from time import perf_counter import numpy as np import pandas as pd from skrub.datasets import fetch_traffic_violations from sklearn.model_selection import train_test_split from sklearn...
13,262
addgif
import asyncio, discord, time, random, warnings, re, giphypop from operator import itemgetter from discord.ext import commands from Cogs import Utils, GetImage, Message, DisplayName def setup(bot): # Add the bot and deps settings = bot.get_cog("Settings") bot.add_cog(Giphy(bot, settings)) class Giphy(command...
13,263
test opts
""" tests for the cli-to-spec command """ import pscheduler import unittest class CliToSpecTest(pscheduler.TestCliToSpecUnitTest): name = 'latencybg' def METHOD_NAME(self): #dest-only self.assert_arg_map({ "dest": { "val": "10.0.0.2" }, }) ...
13,264
parent pass
# Owner(s): ["module: inductor"] from typing import Any, Callable import torch from torch._inductor.fx_passes.pre_grad import ( linear_permute_fusion, linear_transpose, permute_linear_fusion, permute_matmul_fusion, sink_cat_after_pointwise, transpose_linear, transpose_matmul, ) from torch.f...
13,265
get ceiling altitude
# -*- coding: utf-8 -*- """ mslib.msui.aircrafts ~~~~~~~~~~~~~~~~~~~~ This module provides aircrafts definitions This file is part of MSS. :copyright: Copyright 2016-2017 Joern Ungermann :copyright: Copyright 2016-2023 by the MSS team, see AUTHORS. :license: APACHE-2.0, see LICENSE for d...
13,266
get result value
from collections import OrderedDict from django.http import Http404, JsonResponse from django.conf import settings from django.shortcuts import render from django.core import signing from django.core.signing import BadSignature from django.contrib.auth.mixins import LoginRequiredMixin from django.contrib.contenttypes...
13,267
teardown class
from builtins import object ############################################################################### # lazyflow: data flow based lazy parallel computation framework # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; ...
13,268
evaluate utilization
import pandas as pd import plotly.graph_objs as go from plotly.offline import plot import cea.plots.thermal_networks from cea.plots.variable_naming import NAMING, LOGO, COLOR from cea.constants import HOURS_IN_YEAR __author__ = "Lennart Rogenhofer" __copyright__ = "Copyright 2018, Architecture and Building System...
13,269
compilers minimum version
from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import ( apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_f...
13,270
is configured
from sentry.integrations import FeatureDescription, IntegrationFeatures from sentry.plugins.bases.notify import NotifyPlugin from sentry.utils.http import absolute_uri from sentry_plugins.base import CorePluginMixin from sentry_plugins.utils import get_secret_field_config from .client import PagerDutyPluginClient cl...
13,271
add connection
# bluemira is an integrated inter-disciplinary design tool for future fusion # reactors. It incorporates several modules, some of which rely on other # codes, to carry out a range of typical conceptual fusion reactor design # activities. # # Copyright (C) 2021-2023 M. Coleman, J. Cook, F. Franza, I.A. Maione, S. McInto...
13,272
prepare data
""" Creates data loaders for contrastive learning Each record is features from main record X - is feature_arrays, samples of event sequences Y - is Id of main record, not used Input: -> Output dict of arrays -> X, Y client_1 -> client_1_features, client_1_id client_2 ->...
13,273
test render tile
# -*- coding: utf-8 -*- from castle.cms.tests.utils import render_tile import json import unittest from castle.cms.testing import CASTLE_PLONE_INTEGRATION_TESTING from castle.cms.tiles.dynamic import CACHE_KEY from castle.cms.tiles.dynamic import FIELD_TYPE_MAPPING from castle.cms.tiles.dynamic import get_tile_manager...
13,274
qualify
from _typeshed import Incomplete from collections.abc import Generator from .error import CDefError as CDefError, VerificationError as VerificationError, VerificationMissing as VerificationMissing from .lock import allocate_lock as allocate_lock Q_CONST: int Q_RESTRICT: int Q_VOLATILE: int def METHOD_NAME(quals, rep...
13,275
get work file
# 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...
13,276
set lock
# ========================================================================== # # Copyright NumFOCUS # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org...
13,277
test process no raw disk found
import logging import os import sys from mock import ( Mock, patch ) from pytest import ( raises, fixture ) from ..test_helper import argv_kiwi_tests import kiwi from kiwi.tasks.image_resize import ImageResizeTask from kiwi.exceptions import ( KiwiImageResizeError, KiwiSizeError, KiwiConfigFileNo...
13,278
set up
#!/usr/bin/env python3 # Copyright 2022 Daniel Estevez <daniel@destevez.net> # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # from gnuradio import gr, gr_unittest, blocks, digital import pmt class qa_crc(gr_unittest.TestCase): def METHOD_NAME(self): """Common part of al...
13,279
create layout
# See LICENSE for licensing information. # # Copyright (c) 2016-2023 Regents of the University of California and The Board # of Regents for the Oklahoma Agricultural and Mechanical College # (acting for and on behalf of Oklahoma State University) # All rights reserved. # from openram import debug from openram.base impo...
13,280
test api error
import pickle import unittest from betfairlightweight import exceptions class ExceptionsTest(unittest.TestCase): def test_betfair_error(self): with self.assertRaises(exceptions.BetfairError): raise exceptions.BetfairError("test") # pickle error = exceptions.PasswordError("test...
13,281
stub set desired capacity
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Stub functions that are used by the Amazon EC2 Auto Scaling unit tests. """ from test_tools.example_stubber import ExampleStubber class AutoScalingStubber(ExampleStubber): """ A class that implemen...
13,282
retrieve dcv session url
# Copyright 2019 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.txt" file accom...
13,283
read repeatable single database atomic transaction
from django.db.transaction import Atomic from cachalot.api import cachalot_disabled from psycopg2 import sql from baserow.core.db import IsolationLevel, transaction_atomic def METHOD_NAME( database_id: int, ) -> Atomic: """ If you want to safely read the contents of a Baserow database inside of a single...
13,284
test get frame
import typing as tp import numpy as np from hypothesis import given from hypothesis import settings as hypo_settings from static_frame import Frame from static_frame import Index from static_frame import IndexHierarchy from static_frame import Series from static_frame import TypeBlocks from static_frame.core.util imp...
13,285
downgrade
"""reduce experience and config duplication Revision ID: 317e6197c76a Revises: b8248ce6b8a1 Create Date: 2023-06-05 23:24:43.174826 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = "317e6197c76a" down_revision = "b8248ce...
13,286
get scope map
# 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...
13,287
bytes to iq
from collections import OrderedDict from multiprocessing import Array from multiprocessing.connection import Connection import numpy as np from urh.dev.native.Device import Device from urh.dev.native.lib import hackrf class HackRF(Device): DEVICE_LIB = hackrf ASYNCHRONOUS = True DEVICE_METHODS = Device....
13,288
predict and assert
# 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...
13,289
initialize configuration
#!/usr/bin/env python3 import time from smbus2 import SMBus from collections import namedtuple from typing import List # https://datasheets.maximintegrated.com/en/ds/MAX98089.pdf AmpConfig = namedtuple('AmpConfig', ['name', 'value', 'register', 'offset', 'mask']) EQParams = namedtuple('EQParams', ['K', 'k1', 'k2', 'c...
13,290
set up
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. # 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 right...
13,291
return ok expires
import sys from _typeshed import StrPath from collections.abc import Iterable, Iterator, Sequence from http.client import HTTPResponse from re import Pattern from typing import ClassVar, TypeVar, overload from urllib.request import Request __all__ = [ "Cookie", "CookieJar", "CookiePolicy", "DefaultCook...
13,292
test mo init
# Owner(s): ["module: dynamo"] import dataclasses import unittest.mock import torch import torch._dynamo.test_case import torch._dynamo.testing from torch._dynamo.testing import same try: from transformers import modeling_outputs from transformers.configuration_utils import PretrainedConfig from transfor...
13,293
generate dropout mask
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
13,294
restart
from enigma import eTimer from os.path import isfile from Screens.MessageBox import MessageBox from Components.ActionMap import HelpableActionMap from Components.config import ConfigSelection, config from Components.ScrollLabel import ScrollLabel from Components.Sources.StaticText import StaticText from Components.Sys...
13,295
top k
""" Copyright 2022-2023 Advanced Micro Devices 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...
13,296
start
import ctypes import logging import sys from winreg import HKEY_LOCAL_MACHINE, KEY_ALL_ACCESS, REG_EXPAND_SZ, REG_MULTI_SZ, CloseKey, CreateKeyEx, SetValueEx from lib.api.process import Process from lib.common.abstracts import Package from lib.common.common import check_file_extension from lib.common.defines import AD...
13,297
show welcome
from PySide6 import QtWidgets from src.Controller.GUIController import WelcomeWindow, OpenPatientWindow, \ MainWindow, PyradiProgressBar, FirstTimeWelcomeWindow, ImageFusionWindow, \ BatchWindow, OpenPTCTPatientWindow class Controller: # Initialisation function that creates an instance of each window ...
13,298
get local process group
# Copyright (c) Facebook, Inc. and its affiliates. """ This file contains primitives for multi-gpu communication. This is useful when doing distributed training. """ import functools import numpy as np import torch import torch.distributed as dist _LOCAL_PROCESS_GROUP = None _MISSING_LOCAL_PG_ERROR = ( "Local pro...
13,299
test hermitian two wires identity expectation with
# Copyright 2018-2023 Xanadu Quantum Technologies 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...