id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
6,900
set up
# -*- coding: utf-8 -*- # Copyright (c) 2020, Thales Netherlands # Copyright (c) 2021, Ansible Project # 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, print_f...
6,901
sync db update processing job
""" The database is used to store information regarding jobs and workspaces. Jobs: for every process-request a job is inserted into the database with an uuid, status and information about the process like parameters and file groups. It is mainly used to track the status (`ocrd_network.models.job.StateEnum`) of a job s...
6,902
generate input
# Copyright (c) 2021 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...
6,903
print packages
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
6,904
recreate prow config
#!/usr/bin/env python # Copyright 2018 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
6,905
make client
# Copyright (C) 2022 CVAT.ai Corporation # # SPDX-License-Identifier: MIT import json from http import HTTPStatus import pytest from cvat_sdk.api_client import ApiClient, Configuration, models from shared.utils.config import BASE_URL, USER_PASS, make_api_client @pytest.mark.usefixtures("restore_db_per_class") clas...
6,906
test rename stereotype attrs field
import pytest from gaphor.storage.parser import element from gaphor.storage.storage import load_elements from gaphor.storage.upgrade_canvasitem import upgrade_canvasitem from gaphor.UML import diagramitems @pytest.fixture def loader(element_factory, modeling_language): def _loader(*parsed_items): for ite...
6,907
get next
# 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,908
model bernoulli likelihood
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 """ Example: Horseshoe Regression ============================= We demonstrate how to use NUTS to do sparse regression using the Horseshoe prior [1] for both continuous- and binary-valued responses. For a more complex modeling and inf...
6,909
test ipu to dense batch no batch
import pytest import torch from torch_geometric.data import Data, Batch from graphium.ipu.to_dense_batch import to_dense_batch from warnings import warn # General imports import yaml import unittest as ut import numpy as np from copy import deepcopy from warnings import warn from lightning import Trainer, LightningMo...
6,910
integer range
# 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,911
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 # --------------------------------...
6,912
get coarse ds
import intake import xarray as xr import os from dask.diagnostics import ProgressBar import fsspec from vcm.catalog import catalog as CATALOG from vcm.fv3.metadata import standardize_fv3_diagnostics from vcm import convert_timestamps from vcm.cubedsphere import center_and_rotate_xy_winds from vcm.safe import get_varia...
6,913
test unix mbox
# This set of tests exercises the backward-compatibility class # in mailbox.py (the ones without write support). from __future__ import with_statement import mailbox import os import time import unittest from test import test_support # cleanup earlier tests try: os.unlink(test_support.TESTFN) except os.error: ...
6,914
test select from datasets
# Copyright 2017 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...
6,915
inverse
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 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 derivat...
6,916
test checkin overdue item
# -*- coding: utf-8 -*- # # RERO ILS # Copyright (C) 2019 RERO # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License. # # This program is distributed in the hope that...
6,917
build params
# Copyright 2016 Free Software Foundation, Inc. # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later # import itertools import re from ..Constants import ADVANCED_PARAM_TAB from ..utils import to_list from ..Messages import send_warning from .block import Block from ._flags import Flags fr...
6,918
download file
import multiprocessing import os import subprocess import tempfile import time from pathlib import Path import boto3 from django.conf import settings from django.core.management import BaseCommand from django.db import DEFAULT_DB_ALIAS, connections APPROX_ADDRESS_BASE_BYTES = 3_300_000_000 def import_single_file(fi...
6,919
get route filter
# 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,920
doc test suite
import types import unittest from _typeshed import ExcInfo from collections.abc import Callable from typing import Any, NamedTuple from typing_extensions import TypeAlias __all__ = [ "register_optionflag", "DONT_ACCEPT_TRUE_FOR_1", "DONT_ACCEPT_BLANKLINE", "NORMALIZE_WHITESPACE", "ELLIPSIS", "S...
6,921
main
# Copyright (c) 2021 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...
6,922
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 __all__ ...
6,923
test rotate
from builtins import range import unittest import os import sys from datetime import timedelta from time import sleep from nose.plugins.attrib import attr from WMCore.Database.CMSCouch import RotatingDatabase, CouchServer, CouchNotFoundError class RotatingDatabaseTest(unittest.TestCase): def setUp(self): ...
6,924
last modified by
# 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,925
create tree
"""distutils.dir_util Utility functions for manipulating directories and directory trees.""" import os import errno from distutils.errors import DistutilsFileError, DistutilsInternalError from distutils import log # cache for by mkpath() -- in addition to cheapening redundant calls, # eliminates redundant "creating ...
6,926
conditional entropy compute
# Copyright The Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
6,927
last modified at
# 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 ._en...
6,928
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 # --------------------------------...
6,929
add two
import pytest import random import typing as ty from ..functions import task, annotate from ...engine.task import FunctionTask def test_task_equivalence(): def METHOD_NAME(a): return a + 2 canonical = FunctionTask(METHOD_NAME, a=3) decorated1 = task(METHOD_NAME)(a=3) @task def addtwo(a...
6,930
test image out painting
# SPDX-License-Identifier: Apache-2.0 import os import sys import unittest import mock_keras2onnx from mock_keras2onnx import set_converter import numpy as np from mock_keras2onnx.proto import keras from os.path import dirname, abspath sys.path.insert(0, os.path.join(dirname(abspath(__file__)), '../../keras2onnx_tests...
6,931
compare counts
# -*- coding: utf-8 -*- # Copyright 2021, IBM. # # This source code is licensed under the Apache License, Version 2.0 found in # the LICENSE.txt file in the root directory of this source tree. import json import os import sys from qiskit.result import Result def assertDictAlmostEqual(dict1, dict2, delta=None, msg=...
6,932
test thread root id returns id if
from uuid import UUID import pytest from h.db.types import URLSafeUUID from h.models.annotation import Annotation def test_parent_id_of_direct_reply(): ann = Annotation(references=["parent_id"]) assert ann.parent_id == "parent_id" def test_parent_id_of_reply_to_reply(): ann = Annotation(references=["...
6,933
compress frames
import logging from logging import LogRecord, Formatter, ERROR from traceback import TracebackException from colorlog import ColoredFormatter from os.path import join, abspath HISTORY_SIZE = 1000 PATH_BASE = abspath(join(__file__, "..", "..")) logging.addLevelName(5, "TRACE") logging.TRACE = 5 class HistoryHandler(...
6,934
check checkout on base branch
# ----------------------------------------------------------------------------- # Copyright (c) 2012 - 2023, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. # -----------------------------------------------------------------...
6,935
open
# Copyright 2021-2022 python-tuf contributors # SPDX-License-Identifier: MIT OR Apache-2.0 """Simple example of using the repository library to build a repository""" import copy import json import logging from collections import defaultdict from datetime import datetime, timedelta from typing import Dict, List from ...
6,936
test creation func
# Copyright 2021-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 ...
6,937
test get columns returns all columns
from mindsdb.integrations.handlers.binance_handler.binance_tables import BinanceAggregatedTradesTable from mindsdb.integrations.handlers.binance_handler.binance_handler import BinanceHandler from mindsdb_sql.parser import ast from mindsdb_sql.parser.ast.select.star import Star from mindsdb_sql.parser.ast.select.identif...
6,938
distribution
# Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
6,939
plotting error
# -*- coding: utf-8 -*- """ Description: define the object to initialize the plot option subwindow Author: YingzhiGou Date: 20/06/2017 """ from qtpy import QtCore from qtpy.QtWidgets import QWidget, QMessageBox from mtpy.gui.SmartMT.gui.busy_indicators import BusyOverlay from mtpy.gui.SmartMT.ui_a...
6,940
encrypt
''' Cramer-Shoup Public Key Encryption Scheme (Decisional Diffie-Hellman Assumption in groups of prime order) | From: "R. Cramer, V. Shoup: A practical public key cryptosystem provably secure against adaptive chosen ciphertext attack" | Published in: CRYPTO 1998 | Available from: http://knot.kaist.ac.kr/seminar/archi...
6,941
reorder encoder out
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math import torch import torch.nn as nn import torch.nn.functional as F from fairseq.models import ( Fairs...
6,942
close
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
6,943
handle sequence
# pylint:disable=unused-argument,no-self-use from collections import OrderedDict import claripy import ailment from ailment.expression import negate from .sequence_walker import SequenceWalker from .structuring.structurer_nodes import ( MultiNode, SequenceNode, CodeNode, ConditionNode, SwitchCaseN...
6,944
assert in custom modules
# -*- coding: utf-8 -*- import filecmp import json import os import pkgutil import zipfile import hypothesis import pytest from verta.tracking.entities._deployable_entity import _DeployableEntity from verta._internal_utils.custom_modules import CustomModules from .. import utils from . import contexts class TestP...
6,945
test latest release with environment
from datetime import datetime from sentry.models import Release, Rule from sentry.rules.filters.latest_release import LatestReleaseFilter, get_project_release_cache_key from sentry.testutils.cases import RuleTestCase from sentry.utils.cache import cache class LatestReleaseFilterTest(RuleTestCase): rule_cls = Lat...
6,946
test matrix iqr
#!/usr/bin/env python from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME Project" #remember to add yourself if you make changes __credits__ = ["Rob Knight", "Daniel McDonald", "Greg Caporaso", "Justin Kuczynski", "Catherine Lozupone", ...
6,947
test failed get policies
from unittest.mock import Mock, patch from canonicalwebteam.store_api.exceptions import StoreApiResponseErrorList from tests.admin.tests_models import TestModelServiceEndpoints class TestGetPolicies(TestModelServiceEndpoints): @patch("webapp.admin.views.admin_api.get_store_model_policies") def test_get_polic...
6,948
set crc
"""NRF24L01 driver for MicroPython """ from micropython import const import utime # nRF24L01+ registers CONFIG = const(0x00) EN_RXADDR = const(0x02) SETUP_AW = const(0x03) SETUP_RETR = const(0x04) RF_CH = const(0x05) RF_SETUP = const(0x06) STATUS = const(0x07) RX_ADDR_P0 = const(0x0A) TX_ADDR = const(0x10) RX_PW_P0 =...
6,949
issue command
#!/usr/bin/env python # Copyright 2019 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
6,950
calls
from multiprocessing import Queue, get_context from multiprocessing.managers import SyncManager from time import sleep from typing import Sequence import pytest from pydantic import SecretStr from tests.data_for_tests.propagation_credentials import ( CREDENTIALS, PASSWORD_1, PASSWORD_3, USERNAME, ) fro...
6,951
code container properties
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
6,952
test authcode wellformed
"""Tests for the OAuth2 API endpoints.""" from base64 import b64encode from secrets import token_urlsafe from typing import Dict from urllib.parse import parse_qs, urlsplit import pytest from funnel import models def test_authcode_requires_login(client) -> None: """The authcode endpoint requires a login.""" ...
6,953
test from address
import unittest, sys from ctypes import * import _ctypes_test ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float] python_types = [int, int, int, int, int, int, int, int, int, int, float, float] class PointersT...
6,954
build list request
# 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,955
test delete tenant fails with invalid id
import uuid import pytest from prefect import api, models def random_id() -> str: return str(uuid.uuid4()) class TestCreateTenant: async def test_create_tenant(self): name = random_id() slug = random_id() tenant_id = await api.tenants.create_tenant(name=name, slug=slug) as...
6,956
test creator can delete in active phase
import pytest from django.urls import reverse from adhocracy4.test.helpers import assert_template_response from adhocracy4.test.helpers import freeze_phase from adhocracy4.test.helpers import redirect_target from adhocracy4.test.helpers import setup_phase from apps.mapideas import models from apps.mapideas import phas...
6,957
set up
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function import os import sys import unittest # noinspection PyProtectedMember from numpy.testing import assert_allclose from numpy.testing import assert_array_less from numpy.testing import assert_equal from numpy.testing import ass...
6,958
test packages to install with custom index
# Copyright 2022 The Kubeflow Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
6,959
extract id from inline
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- import dote...
6,960
get lineno
from _typeshed import Incomplete, SupportsGetItem, SupportsLenAndGetItem, Unused from abc import abstractmethod from collections.abc import Iterable, Iterator, MutableSequence from typing_extensions import Final, Self, TypeAlias from .fixer_base import BaseFix from .pgen2.grammar import Grammar _NL: TypeAlias = Node ...
6,961
fn
#!/usr/bin/env python # vim: ai ts=4 sts=4 et sw=4 import re import warnings from django.conf import settings from django.http import HttpResponse import json from django.utils.encoding import force_str from django.utils.functional import Promise from dimagi.utils.parsing import json_format_datetime from datetime imp...
6,962
test ingredient groups
from recipe_scrapers._grouping_utils import IngredientGroup from recipe_scrapers.rainbowplantlife import RainbowPlantLife from tests import ScraperTest class TestRainbowPlantLifeScraper(ScraperTest): scraper_class = RainbowPlantLife test_file_name = "rainbowplantlife_groups" def test_host(self): ...
6,963
test main help
import asyncio import configparser import sys import tempfile import unittest.mock as mock from pathlib import Path from typing import TYPE_CHECKING, Any import pytest from _pytest.capture import CaptureFixture from _pytest.logging import LogCaptureFixture import bandersnatch.mirror import bandersnatch.storage from b...
6,964
get hostname for platform
""" Copyright (c) 2017-2022 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from typing import Any, Dict, Optional from atomic_reactor.plugin import Plugin from atomic_reactor.constants import PLUGIN_GATHER_BUILD...
6,965
add kind
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Matti Hämäläinen <msh@nmr.mgh.harvard.edu> # Denis Engemann <denis.engemann@gmail.com> # # License: BSD-3-Clause from copy import deepcopy import numpy as np from .constants import FIFF from .tag import read_tag from .tree import dir_tre...
6,966
add
# --------------------------------------------------------------------- # # Copyright (C) 2015 - 2022 by the deal.II authors # # This file is part of the deal.II library. # # The deal.II library is free software; you can use it, redistribute # it, and/or modify it under the terms of the GNU Lesser General # Public Lice...
6,967
visit begin
# # QAPI command marshaller generator # # Copyright IBM, Corp. 2011 # Copyright (C) 2014-2016 Red Hat, Inc. # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # Michael Roth <mdroth@linux.vnet.ibm.com> # Markus Armbruster <armbru@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. #...
6,968
is parameter
"""Interface to the compiler's internal symbol tables""" import _symtable from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM, DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE, LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL) import weakref __all__ = ["symtable", "SymbolTable", "Class",...
6,969
margo client
import logging import asyncio import functools import collections import pymargo import pymargo.core from concurrent.futures import ProcessPoolExecutor from deephyper.evaluator._evaluator import Evaluator import mpi4py # !To avoid initializing MPI when module is imported (MPI is optional) mpi4py.rc.initialize = Fal...
6,970
sync signal
""" This module provides signals, which are a simple dispatching system that allows any number of interested parties to subscribe to events ("signals"). This is similar to the Blinker library (https://pypi.org/project/blinker/), with the following changes: - provides only a small subset of Blinker's functionality ...
6,971
returns 400 if start date not provided
import time import random from datetime import datetime, timedelta from backend.models.postgis.task import Task, TaskStatus from tests.backend.base import BaseTestCase from tests.backend.helpers.test_helpers import ( create_canned_project, generate_encoded_token, return_canned_user, ) from tests.backend.in...
6,972
get easiu r2005
""" sample Python codes for EASIUR and APSCA """ import csv import deepdish import h5py import numpy as np import pyproj import os # print(f"This module uses the following packages") # print(f"deepdish: {deepdish.__version__}") # print(f"h5py : {h5py.__version__}") # print(f"numpy : {np.__version__}") # print(f"...
6,973
with ret type
from typing import ClassVar, Dict, FrozenSet, List, final from mypy.nodes import ARG_OPT, ARG_POS, ARG_STAR, ARG_STAR2, ArgKind from mypy.typeops import get_type_vars from mypy.types import AnyType, CallableType, FunctionLike, Overloaded from mypy.types import Type as MypyType from mypy.types import TypeOfAny, TypeVar...
6,974
close
"""Operating system-related utility functions for Sphinx.""" from __future__ import annotations import contextlib import filecmp import os import re import shutil import sys import unicodedata from io import StringIO from os import path from typing import TYPE_CHECKING, Any from sphinx.deprecation import _deprecatio...
6,975
benchmark decode csv
# 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...
6,976
read lines
import _winapi import math import msvcrt import os import subprocess import uuid import winreg from test import support from test.libregrtest.utils import print_warning # Max size of asynchronous reads BUFSIZE = 8192 # Seconds per measurement SAMPLING_INTERVAL = 1 # Exponential damping factor to compute exponentially...
6,977
generic visit
import dataclasses import functools from typing import Callable, Iterable from magma.circuit import CircuitKind, CircuitType, DefineCircuitKind from magma.clock import ClockTypes from magma.common import is_empty from magma.conversions import as_bits from magma.passes.clock import get_undriven_clocks_in_value from mag...
6,978
export
# coding=utf-8 # @license # Copyright 2019-2020 Google 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...
6,979
test zero
""" :codeauthor: Rupesh Tare <rupesht@saltstack.com> Test cases for salt.modules.lvs """ import pytest import salt.modules.lvs as lvs from tests.support.mock import MagicMock, patch @pytest.fixture def configure_loader_modules(): return {lvs: {}} def test_add_service(): """ Test for Add a vi...
6,980
generate
from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import copy, get, rmdir from conan.tools.microsoft import is_msvc from conan.tools.scm import ...
6,981
teardown module
#!/usr/bin/env python # SPDX-License-Identifier: ISC # # test_bgp_vpnv4_ebgp.py # Part of NetDEF Topology Tests # # Copyright (c) 2022 by 6WIND # """ test_bgp_vpnv4_ebgp.py: Test the FRR BGP daemon with EBGP direct connection """ import os import sys import json from functools import partial import pytest # Save t...
6,982
config options
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, rmdir, save from conan...
6,983
wires for tile
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright (C) 2017-2020 The Project X-Ray Authors. # # Use of this source code is governed by a ISC-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/ISC # # SPDX-License-Identifier: ISC import os.path import csv import pick...
6,984
load
''' Usage: `python3 rename_nll_facts.py src ref dest` Renames atoms in `src/*.facts` to match the names used in `ref/*.facts`, then writes the renamed facts to `dest/`. ''' import ast from collections import defaultdict import os import sys src_dir, ref_dir, dest_dir = sys.argv[1:] # Map `src` loan/origin/path name...
6,985
sku
# 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,986
tear down
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, Inc. # 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 source cod...
6,987
validate and add block multi error
from __future__ import annotations from typing import List, Optional from chia.consensus.blockchain import AddBlockResult, Blockchain from chia.consensus.multiprocess_validation import PreValidationResult from chia.types.full_block import FullBlock from chia.util.errors import Err from chia.util.ints import uint32, u...
6,988
scale up obj
from collections import defaultdict from os.path import join as pjoin import numpy as np import numpy.testing as npt import pytest from fury import actor, interactor, ui from fury import utils as vtk_utils from fury import window from fury.data import DATA_DIR from fury.decorators import skip_osx, skip_win from fury....
6,989
outputs format
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in complia...
6,990
get abs pos
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved import math import torch import torch.nn as nn import torch.nn.functional as F __all__ = [ "window_partition", "window_unpartition", "add_decomposed_rel_pos", "get_abs_pos", "PatchEmbed", ] def window_partition(x, window_size)...
6,991
setup
# encoding: utf-8 '''A Sphinx extension to automatically document CKAN's crazy plugins toolkit, autodoc-style. Sphinx's autodoc extension can document modules or classes, but although it masquerades as a module CKAN's plugins toolkit is actually neither a module nor a class, it's an object-instance of a class, and it...
6,992
private link service connection 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 . imp...
6,993
extract translation units
# # Copyright 2023 Zuza Software Foundation & Anders Kaplan # # This file is part of translate. # # translate 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 opti...
6,994
pre prepare client
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
6,995
extract data
# 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,996
on failed log
import logging import operator import socket from contextlib import contextmanager from typing import Any, Callable, Mapping, MutableMapping, Optional, cast from mode import Service from faust.types import AppT from . import states from .app import send_update from .models import Status CHECK_FREQUENCY = 5.0 clas...
6,997
test inverse
""" ckwg +31 Copyright 2020 by Kitware, Inc. 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 source code must retain the above copyright notice, this list of conditions and the ...
6,998
get course in cache v2
""" Asynchronous tasks related to the Course Blocks sub-application. """ import logging from celery import shared_task from django.conf import settings from edx_django_utils.monitoring import set_code_owner_attribute from edxval.api import ValInternalError from lxml.etree import XMLSyntaxError from opaque_keys.edx.k...
6,999
test average dielectric constant
import os import tempfile import numpy as np import pytest from openff.units import unit from openff.evaluator.forcefield import ParameterGradient, ParameterGradientKey from openff.evaluator.protocols.analysis import ( AverageDielectricConstant, AverageFreeEnergies, AverageObservable, ComputeDipoleMom...