id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
13,900
test read gbq direct read with project
#!/usr/bin/env python # -*- coding: utf-8 -*- # # 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,...
13,901
main
#!/usr/bin/python # # Copyright 2011 Ytai Ben-Tsvi. All rights reserved. # # # Redistribution and use in source and binary forms, with or without modification, are # permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this list of #...
13,902
set up
############################################################################### # volumina: volume slicing and editing library # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/or # modify it und...
13,903
test all
import unittest from test import support from test.support import warnings_helper import os import sys import types try: import _multiprocessing except ModuleNotFoundError: _multiprocessing = None if support.check_sanitizer(address=True, memory=True): # bpo-46633: test___all__ is skipped because importin...
13,904
test message long
# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distrib...
13,905
parameters from shape impl
""" This file is part of the SiEPIC-EBeam-PDK Version history: Lukas Chrostowski 2023/02/19 - PCell takes an input of the waveguide type from a dropdown list Loaded from Waveguides.xml - Metal heater """ from pya import * import pya class wg_heater(pya.PCellDeclarationHelper): def __init__(self): # Imp...
13,906
k8s model from dict
import datetime import re from typing import Any, Mapping import dagster._check as check import kubernetes from dateutil.parser import parse from kubernetes.client import ApiClient def _get_k8s_class(classname): if classname in ApiClient.NATIVE_TYPES_MAPPING: return ApiClient.NATIVE_TYPES_MAPPING[classna...
13,907
run
# Copyright BigchainDB GmbH and BigchainDB contributors # SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0) # Code is Apache-2.0 and docs are CC-BY-4.0 import multiprocessing as mp from collections import defaultdict from abci import ResponseCheckTx, ResponseDeliverTx from bigchaindb import BigchainDB, App from bi...
13,908
schedule task
__copyright__ = 'Copyright 2017, http://radical.rutgers.edu' __license__ = 'MIT' import os import shlex import textwrap import radical.utils as ru from ... import states as rps from ... import constants as rpc from ..launch_method import LaunchMethod from .base import AgentSchedulingComp...
13,909
instantiate single port
from kratos import * from lake.modules.sram_stub import SRAMStub from lake.modules.two_port_sram_stub import TwoPortSRAMStub from lake.modules.pipe_reg import PipeReg from lake.modules.virtual_remap_table import VirtualRemapTable from math import * class SinglePortMemory(Generator): def __init__(self, ...
13,910
transform lambda
"""Fixer for function definitions with tuple parameters. def func(((a, b), c), d): ... -> def func(x, d): ((a, b), c) = x ... It will also support lambdas: lambda (x, y): x + y -> lambda t: t[0] + t[1] # The parens are a syntax error in Python 3 lambda (x): x + y -> lambda x: x + y """...
13,911
manifest
# (C) Datadog, Inc. 2022-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) from __future__ import annotations import os import re from functools import cached_property from typing import TYPE_CHECKING, Iterator from ddev.repo.constants import NOT_SHIPPABLE from ddev.utils.fs im...
13,912
get route from steps
from __future__ import annotations from functools import partial import numpy as np import gdsfactory as gf from gdsfactory.components.via_corner import via_corner from gdsfactory.port import Port from gdsfactory.routing.manhattan import round_corners from gdsfactory.typings import ( STEP_DIRECTIVES, Compone...
13,913
test
# ClearML - Example of pytorch with tensorboardX # from __future__ import print_function import argparse import os from tempfile import gettempdir import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from tensorboardX import SummaryWriter from torch.autograd import Variable f...
13,914
test pip install
import json import os import pathlib import shutil import subprocess import pytest from pytestskipmarkers.utils import platform @pytest.fixture def pypath(): if platform.is_windows(): return pathlib.Path(os.getenv("ProgramFiles"), "Salt Project", "Salt") elif platform.is_darwin(): return path...
13,915
charge gas
""" Ethereum Virtual Machine (EVM) Gas ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. contents:: Table of Contents :backlinks: none :local: Introduction ------------ EVM gas constants and calculators. """ from dataclasses import dataclass from typing import List, Tuple from ethereum.base_types import U256, Uint from...
13,916
options
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2008-2010 (ita) """ Execute the tasks with gcc -MD, read the dependencies from the .d file and prepare the dependency calculation for the next run. This affects the cxx class, so make sure to load Qt5 after this tool. Usage:: def options(opt): opt.load('compi...
13,917
registration revocation
# automatically generated by the FlatBuffers compiler, do not modify # namespace: proto import flatbuffers from flatbuffers.compat import import_numpy np = import_numpy() class CalleeFeatures(object): __slots__ = ['_tab'] @classmethod def GetRootAs(cls, buf, offset=0): n = flatbuffers.encode.Get...
13,918
machine readable
# This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful # but...
13,919
test aggregations can be iterated over
# 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...
13,920
test second chat
from typing import Sequence import pytest from llama_index.llms.base import ChatMessage, MessageRole from llama_index.llms.llama_utils import ( B_INST, B_SYS, BOS, DEFAULT_SYSTEM_PROMPT, E_INST, E_SYS, EOS, completion_to_prompt, messages_to_prompt, ) @pytest.fixture def chat_mess...
13,921
usage
#!/usr/bin/python2 # Copyright John Dennis, jdennis@redhat.com import getopt import os import re import sys #------------------------------------------------------------------------------- prog_name = os.path.basename(sys.argv[0]) config = { 'recursive' : False, 'list-containing' : False, 'list-f...
13,922
get deployer
from pathlib import Path from typing import Optional, Union from constant_sorrow import constants from cryptography.hazmat.primitives.asymmetric import ec from hendrix.deploy.tls import HendrixDeployTLS from hendrix.facilities.services import ExistingKeyTLSContextFactory from nucypher_core import ( HRAC, Encry...
13,923
provisioning state
# 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,924
set scroll brightness
# SPDX-License-Identifier: GPL-2.0-or-later from openrazer_daemon.dbus_services import endpoint def set_led_effect_common(self, zone: str, effect: str) -> None: driver_path = self.get_driver_path(zone + '_led_effect') with open(driver_path, 'w') as driver_file: driver_file.write(effect) @endpoint(...
13,925
test provides custom target class in context
import unittest from typing import Iterable from linkml_runtime.linkml_model import ClassDefinition, SchemaDefinition from linkml.validator import Validator from linkml.validator.loaders import Loader from linkml.validator.plugins import ValidationPlugin from linkml.validator.report import Severity, ValidationResult ...
13,926
evaluate proof
# This file is part of the Trezor project. # # Copyright (C) 2012-2022 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distrib...
13,927
setup
""" ******************************************************* * Copyright (C) 2017 MindsDB Inc. <copyright@mindsdb.com> * * This file is part of MindsDB Server. * * MindsDB Server can not be copied and/or distributed without the express * permission of MindsDB Inc **************************************************...
13,928
normalize eval metrics
"""CIFAR workload implemented in Jax.""" import functools from typing import Any, Dict, Iterator, Optional, Tuple from flax import jax_utils from flax import linen as nn import jax from jax import lax import jax.numpy as jnp import optax import tensorflow_datasets as tfds from algorithmic_efficiency import param_uti...
13,929
select adjust
# This module exports classes for the various canvas item types # NOTE: This module was an experiment and is now obsolete. # It's best to use the Tkinter.Canvas class directly. from warnings import warnpy3k warnpy3k("the Canvas module has been removed in Python 3.0", stacklevel=2) del warnpy3k from Tkinter import Ca...
13,930
test preprocess
import asyncio from datetime import datetime from unittest.mock import AsyncMock import plotly.graph_objects as pgo import plotly.io as pio import pytest from geojson import FeatureCollection from ohsome_quality_api.indicators.building_completeness.indicator import ( BuildingCompleteness, get_hex_cells, g...
13,931
middleware before
import asyncio from typing import Any, Callable, Dict, Tuple, Union from aiohttp import web from opentelemetry.sdk.trace import TracerProvider import tomodachi from tomodachi.discovery.dummy_registry import DummyRegistry from tomodachi.opentelemetry import TomodachiInstrumentor from tomodachi.transport.http import Re...
13,932
validate inputs
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
13,933
command
# SPDX-License-Identifier: Apache-2.0 # Copyright Contributors to the Rez Project ''' Build a package from source and deploy it. ''' from __future__ import print_function import os import sys from subprocess import call def setup_parser(parser, completions=False): from rez.cli.build import setup_parser_common ...
13,934
tear down
# coding=utf-8 # Copyright 2023 HuggingFace 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 ag...
13,935
test spfi005 defaults to equal on numeric
import dash from dash.dependencies import Input, Output from utils import get_props from dash.dash_table import DataTable from dash.html import Div, Button from selenium.webdriver.common.action_chains import ActionChains import pytest def get_app(props=dict(), special=False, clear=False): app = dash.Dash(__name...
13,936
get message packet
from struct import pack from game.world.managers.objects.units.player.ChannelManager import ChannelManager from game.world.managers.objects.units.player.GroupManager import GroupManager from game.world.managers.objects.units.player.guild.GuildManager import GuildManager from game.world.managers.objects.units.player.tra...
13,937
mouse handler
''' Support for WM_TOUCH messages (Windows platform) ================================================ ''' __all__ = ('WM_MotionEventProvider', 'WM_MotionEvent') import os from kivy.input.providers.wm_common import WNDPROC, \ SetWindowLong_WndProc_wrapper, RECT, POINT, WM_TABLET_QUERYSYSTEMGESTURE, \ QUERYSYST...
13,938
initialize
from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.utils.translation import gettext_lazy as _ class ProductAttributesContainer: """ Stolen liberally from django-eav, but simplified to be product-specific To set attributes on a product, use the `attr` attribute: pr...
13,939
sidemenu items
# This file is part of Indico. # Copyright (C) 2002 - 2023 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from flask import session from indico.core import signals from indico.core.logger import Logger from indi...
13,940
agent query
import json import random import time from pprint import pprint if __name__ == '__main__': from util.ModelLoader import AGENT_NLU_MODEL, WIKI_NLU_MODEL, JPS_NLU_MODEL from util.StopWords import removeStopWords from Wikidata_Query.WikiQueryInterface import WikiQueryInterface from JPS_Query.JPSQueryInterf...
13,941
is bad api key
import httpx import time import random from typing import Optional, List from augur.tasks.util.redis_list import RedisList from augur.application.db.session import DatabaseSession from augur.application.config import AugurConfig from sqlalchemy import func class NoValidKeysError(Exception): pass class Github...
13,942
test dyn broadcast to
# 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,943
test factorized conv init throws if latent
# Copyright 2022 MosaicML Composer authors # SPDX-License-Identifier: Apache-2.0 import pytest import torch from composer.algorithms.factorize import FactorizedConv2d, FactorizedLinear @pytest.mark.parametrize('batch_size', [1, 2]) @pytest.mark.parametrize('h', [5]) @pytest.mark.parametrize('w', [6]) @pytest.mark.p...
13,944
test add news flash throws exception
import os import unittest from unittest import TestCase from unittest.mock import Mock, patch import datetime from anyway.infographics_utils import get_infographics_data_for_location from anyway.request_params import RequestParams from anyway.models import NewsFlash from anyway.constants import CONST from anyway.backen...
13,945
set job modules
# Copyright 2016 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
13,946
test csp darknet backbone
# Copyright (c) OpenMMLab. All rights reserved. import pytest import torch from torch.nn.modules.batchnorm import _BatchNorm from mmdet.models.backbones.csp_darknet import CSPDarknet from .utils import check_norm_state, is_norm def METHOD_NAME(): with pytest.raises(ValueError): # frozen_stages must in ra...
13,947
main
# Copyright 2020 Adap GmbH. 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...
13,948
build schema on 200
# -------------------------------------------------------------------------------------------- # 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,949
exp fjb
""" Collection of Model instances for use with the odrpack fitting package. """ import numpy as np from scipy.odr.odrpack import Model __all__ = ['Model', 'exponential', 'multilinear', 'unilinear', 'quadratic', 'polynomial'] def _lin_fcn(B, x): a, b = B[0], B[1:] b.shape = (b.shape[0], 1) ret...
13,950
get position in parent
# Name: sfp.py, version: 1.0 # # Description: Module contains the definitions of SFP related APIs # for Nokia IXS 7215 platform. # # Copyright (c) 2023, Nokia # All rights reserved. # try: import os from sonic_platform_base.sonic_xcvr.sfp_optoe_base import SfpOptoeBase from sonic_py_common.logger import Lo...
13,951
test int32 align
# *************************************************************** # Copyright (c) 2023 Jittor. All Rights Reserved. # Maintainers: Dun Liang <randonlang@gmail.com>. # This file is subject to the terms and conditions defined in # file 'LICENSE.txt', which is part of this source code package. # ************************...
13,952
outline text
# Clock example with NTP synchronization # # Create a secrets.py with your Wifi details to be able to get the time # when the Galactic Unicorn isn't connected to Thonny. # # secrets.py should contain: # WIFI_SSID = "Your WiFi SSID" # WIFI_PASSWORD = "Your WiFi password" # # Clock synchronizes time on start, and resynch...
13,953
test instructions
from recipe_scrapers.theclevercarrot import TheCleverCarrot from tests import ScraperTest class TestTheCleverCarrotScraper(ScraperTest): scraper_class = TheCleverCarrot test_file_name = "theclevercarrot_1" def test_host(self): self.assertEqual("theclevercarrot.com", self.harvester_class.host()) ...
13,954
test dv finite space model
# Copyright (c) 2017-2019 Uber Technologies, Inc. # SPDX-License-Identifier: Apache-2.0 from contextlib import ExitStack import pytest import torch import pyro import pyro.distributions as dist import pyro.optim as optim from pyro.contrib.oed.eig import ( donsker_varadhan_eig, lfire_eig, marginal_eig, ...
13,955
day msgid
""" This tool requires a translation service which supports the translate method and the default parameter. """ from AccessControl import ClassSecurityInfo from AccessControl.class_init import InitializeClass from Acquisition import aq_get from OFS.SimpleItem import SimpleItem from plone.base import PloneLocalesMessag...
13,956
tear down
#!/usr/bin/env python3 import os import json import time import datetime import unittest import subprocess import numpy as np import cereal.messaging as messaging from openpilot.system.hardware import TICI from openpilot.system.sensord.rawgps.rawgpsd import at_cmd, wait_for_modem from openpilot.selfdrive.manager.proce...
13,957
do finalize
# # This file is part of LiteX-Boards. # # Copyright (c) 2021 Icenowy Zheng <icenowy@aosc.io> # Copyright (c) 2015 Yann Sionneau <yann.sionneau@gmail.com> # Copyright (c) 2015-2019 Florent Kermarrec <florent@enjoy-digital.fr> # SPDX-License-Identifier: BSD-2-Clause from litex.build.generic_platform import * from litex...
13,958
tags
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
13,959
get patchset
from __future__ import annotations from typing import Any, Mapping, MutableMapping, Sequence from sentry.integrations import IntegrationInstallation from sentry.models import Organization, PullRequest, Repository from sentry.plugins.providers import IntegrationRepositoryProvider from sentry.services.hybrid_cloud.inte...
13,960
test valid iexact
# -*- coding: utf-8 -*- import pytest # Django from django.core.exceptions import FieldDoesNotExist from rest_framework.exceptions import PermissionDenied, ParseError from awx.api.filters import FieldLookupBackend, OrderByBackend, get_field_from_path from awx.main.models import ( AdHocCommand, ActivityStrea...
13,961
edit link
from django.contrib import admin from django.contrib.contenttypes.models import ContentType from django import forms from django.urls import reverse from django.utils.safestring import mark_safe from django.utils.html import strip_tags from tendenci.apps.perms.admin import TendenciBaseModelAdmin from tendenci.apps.pe...
13,962
add arguments
import os.path from django.contrib.gis.gdal import DataSource from django.contrib.gis.geos import Point from django.contrib.gis.geos.error import GEOSException from django.core.management.base import BaseCommand, CommandError from django.db import transaction from geotrek.authent.models import Structure from geotrek....
13,963
right size
"""Classes to wrap anything that needs a border.""" from __future__ import annotations from functools import cached_property from typing import Type from ..regex import real_length from .base import Widget from .styles import StyleManager __all__ = [ "Frame", "ASCII", "ASCII_X", "ASCII_O", "Ligh...
13,964
print n times
import builtins import sys import time import traceback from robot.utils import eq, normalize, timestr_to_secs from objecttoreturn import ObjectToReturn class ExampleLibrary: def print_(self, msg, stream='stdout'): """Print given message to selected stream (stdout or stderr)""" print(msg, file=...
13,965
guess version
#\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\# import os import sys from GangaCore.Core.exceptions import PluginError from GangaCore.Utility.Shell import Shell from GangaCore.Utility.logging import getLogger from GangaLHCb.Lib.RTHandlers.LHCbGaudiRunTimeHandler import LHCbGaudiRunTimeHa...
13,966
baseconfig
from onl.platform.base import * from onl.platform.wnc import * class OnlPlatform_x86_64_wnc_rseb_w1_32_r0(OnlPlatformWNC, OnlPlatformPortConfig_32x100): PLATFORM='x86-64-wnc-rseb-w1-32-r0' MODEL="RSEB-W1-32" SYS_OBJECT_ID=".6819.18.6649" def METHOD_NAME(se...
13,967
test isdir mixed
import posixpath import shutil import pytest import dvc_data from dvc.fs import localfs from dvc.fs.data import DataFileSystem from dvc.utils.fs import remove from dvc_data.hashfile.build import build from dvc_data.hashfile.hash_info import HashInfo @pytest.mark.parametrize( "path, key", [ ("", ()),...
13,968
infer net
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
13,969
histogram
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
13,970
kind
# 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,971
get release or latest
# -*- coding: utf-8 -*- # # Copyright 2022 Nitrokey Developers # # Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or # http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or # http://opensource.org/licenses/MIT>, at your option. This file may not be # copied, modified, or distribute...
13,972
test top k infinities
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
13,973
test voronoi cylinder num points
import numpy as np import openpnm as op from openpnm._skgraph.tools import cyl2cart, sph2cart class VoronoiTest: def setup_class(self): pass def teardown_class(self): pass def test_voronoi_square_trim_and_reflect(self): np.random.seed(0) shape = [1, 1, 0] net = o...
13,974
load settings
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # 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 ...
13,975
mark evidence
def METHOD_NAME(container=None, input_object=None, content_type=None, **kwargs): """ Mark an object as Evidence in a container Args: container (CEF type: phantom container id): Container ID or Container Object input_object (CEF type: *): The object to mark as evidence. This could be a v...
13,976
fixture
# ================================================================= # # Authors: Matthew Perry <perrygeo@gmail.com> # # Copyright (c) 2018 Matthew Perry # Copyright (c) 2021 Tom Kralidis # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # fi...
13,977
header parameters
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
13,978
strict inequality op
from __future__ import unicode_literals from .simplex import * from .conversions import * # ------------------------------------------------------------------------------ # Unary operations # -x def minus_uop(self): return -to_number(self) # +x def plus_uop(self): # +u return to_number(self) # !x def lo...
13,979
coerce parameters impl
import pya from pya import * from SiEPIC.utils import get_technology, get_technology_by_name from SiEPIC.utils import arc, arc_wg, arc_to_waveguide, points_per_circle#,layout import math class phc_L3c(pya.PCellDeclarationHelper): """ Input: length, width """ import numpy def __init__(self): # Importa...
13,980
test ticket48270 home directory indexed cis
# --- BEGIN COPYRIGHT BLOCK --- # Copyright (C) 2022 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). # See LICENSE for details. # --- END COPYRIGHT BLOCK --- # import pytest from lib389.tasks import * from lib389.utils import * from lib389.topologies import topology_st from lib3...
13,981
handle display
# ---------------------------------------------------------------------------- # Copyright (C) 2021-2023 Deepchecks (https://www.deepchecks.com) # # This file is part of Deepchecks. # Deepchecks is distributed under the terms of the GNU Affero General # Public License (version 3 or later). # You should have received a ...
13,982
test equality
import pytest import gspread from .conftest import GspreadTest class CellTest(GspreadTest): """Test for gspread.Cell.""" @pytest.fixture(scope="function", autouse=True) def init(self, client, request): # User current test name in spreadsheet name name = self.get_temporary_spreadsheet_ti...
13,983
test special cases
""" Unit test for Pybind wrap program Author: Matthew Sklar, Varun Agrawal Date: February 2019 """ # pylint: disable=import-error, wrong-import-position, too-many-branches import filecmp import os import os.path as osp import sys import unittest sys.path.append(osp.dirname(osp.dirname(osp.abspath(__file__)))) sys.pa...
13,984
pack
############################################################################## # # Copyright (c) 2010 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
13,985
set initial conditions
# # Subodels for a lithium metal electrode # import pybamm from .base_ohm import BaseModel class LithiumMetalBaseModel(BaseModel): def __init__(self, param, domain, options=None): super().__init__(param, domain, options=options) def _get_li_metal_interface_variables(self, delta_phi_s, phi_s, phi_e): ...
13,986
issue ids
"""Metric model class.""" from __future__ import annotations from collections.abc import Callable, Sequence from datetime import date from typing import TYPE_CHECKING, cast from shared.utils.type import ( Direction, MetricId, Scale, SourceId, Status, SubjectId, TargetType, ) from .source...
13,987
test fit loop done log messages
# 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,988
test completions short plot1
""" Tests the OptsCompleter class for tab-completion in the opts magic. """ from unittest import SkipTest try: from holoviews.ipython import IPTestCase from holoviews.ipython.magics import OptsCompleter except ImportError: raise SkipTest("Required dependencies not satisfied for testing OptsCompleter") cl...
13,989
test protect a repository environment group name
import pytest from gitlabform.gitlab import AccessLevel from tests.acceptance import run_gitlabform, gl pytestmark = pytest.mark.requires_license class TestProtectedEnvironments: def test__protect_a_repository_environment(self, project, make_user) -> str: config = f""" projects_and_groups: ...
13,990
test get atoms
# This source code is part of the Biotite package and is distributed # under the 3-Clause BSD License. Please see 'LICENSE.rst' for further # information. from os.path import join import itertools import numpy as np import pytest import biotite.structure as struc import biotite.structure.io as strucio from ..util impo...
13,991
id
# 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,992
get pool config
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
13,993
error format
# -------------------------------------------------------------------------------------------- # 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,994
url parameters
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
13,995
admin user enabled
# 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,996
test range
import logging import time from qcodes.instrument import InstrumentBase from qcodes.instrument_drivers.Lakeshore.Model_336 import Model_336 from .test_lakeshore import ( DictClass, MockVisaInstrument, command, instrument_fixture, query, split_args, ) log = logging.getLogger(__name__) VISA_LO...
13,997
clean cl rut
""" Clean and validate a DataFrame column containing Chile RUT/RUN numbers (RUTs). """ # pylint: disable=too-many-lines, too-many-arguments, too-many-branches from typing import Any, Union from operator import itemgetter import dask.dataframe as dd import numpy as np import pandas as pd from stdnum.cl import rut from...
13,998
com google fonts check layout valid script
from opentypespec.tags import FEATURE_TAGS, SCRIPT_TAGS, LANGUAGE_TAGS from fontbakery.callable import check from fontbakery.status import PASS, FAIL from fontbakery.message import Message # used to inform get_module_profile whether and how to create a profile from fontbakery.fonts_profile import profile_factory # n...
13,999
data selection
"""Training algorithm track submission functions for ImageNet.""" import functools from typing import Dict, Iterator, List, Tuple from flax import jax_utils import jax from jax import lax import jax.numpy as jnp import optax from algorithmic_efficiency import spec def get_batch_size(workload_name): # Return the ...