id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
3,000 | check cache file exists | """RBD Persistent write back cache."""
import datetime
from json import loads
from utility.log import Log
log = Log(__name__)
class PWLException(Exception):
pass
class PWLConfigurationError(Exception):
pass
class PersistentWriteAheadLog:
def __init__(self, rbd, client, drive):
"""Initialize... |
3,001 | test failed trait definition | # (C) Copyright 2005-2023 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
3,002 | mock thread safe | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... |
3,003 | 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 . im... |
3,004 | test fc3d | import siconos.numerics as sn
import os.path
import scipy.sparse
import scipy.sparse.linalg
import numpy as np
# this could be changed at install time
data_dir = "data/"
# solvers = [sn.SICONOS_GLOBAL_FRICTION_3D_NSGS, sn.SICONOS_GLOBAL_FRICTION_3D_NSN_AC]
solvers = (sn.SICONOS_GLOBAL_FRICTION_3D_NSGS,)
solvers_reduc... |
3,005 | test thread env | # Copyright (c) 2020 Horizon Robotics. 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 applicab... |
3,006 | load personas | #!/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.
from typing import Optional
from parlai.core.params import ParlaiParser
from parlai.core.opt import Opt
from parlai.core... |
3,007 | test attentive email schema | import pytest
from fides.api.schemas.connection_configuration import SovrnSchema
from fides.api.schemas.connection_configuration.connection_secrets_attentive import (
AttentiveSchema,
)
from fides.api.schemas.connection_configuration.connection_secrets_email import (
AdvancedSettings,
AdvancedSettingsWithE... |
3,008 | test compute no instances | from re import search
from unittest import mock
GCP_PROJECT_ID = "123456789012"
class Test_compute_instance_block_project_wide_ssh_keys_disabled:
def METHOD_NAME(self):
compute_client = mock.MagicMock
compute_client.project_ids = [GCP_PROJECT_ID]
compute_client.instances = []
wit... |
3,009 | make root commitment | from hashlib import blake2b
import struct
from typing import (List, Optional)
from .mininode import (CBlockHeader, block_work_from_compact, ser_compactsize, ser_uint256)
from .util import (
NU5_BRANCH_ID,
assert_equal,
)
def H(msg: bytes, consensusBranchId: int) -> bytes:
digest = blake2b(
digest_... |
3,010 | open inclusive | # Copyright (C) 2016-2018 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import errno
import hashlib
import logging
import os
import shutil
import tempfile
from pathlib import PureWindowsPath
from lib.cuckoo.common.config i... |
3,011 | test logout | from test import test_support as support
# If we end up with a significant number of tests that don't require
# threading, this test module should be split. Right now we skip
# them all if we don't have threading.
threading = support.import_module('threading')
from contextlib import contextmanager
import imaplib
impo... |
3,012 | markdown2html | #############################################################################
# Copyright (c) 2018, Voilà Contributors #
# Copyright (c) 2018, QuantStack #
# #
# Distri... |
3,013 | test flatten module with random data | """
Copyright 2020 The OneFlow 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 applicable law or agr... |
3,014 | claim period | # flake8: noqa: E402
from dataclasses import dataclass
import ape
import pytest
from beamer.tests.util import alloc_accounts
@dataclass(frozen=True)
class Contracts:
resolver: ape.project.Resolver
fill_manager: ape.project.FillManager
request_manager: ape.project.RequestManager
l1_messenger: ape.proj... |
3,015 | add medical folder dataset | import os
import re
from cache import cached
from db import node_database
from flask import request, g
from middlewares import middleware, medical_folder_dataset, common
from schemas import ValidateMedicalFolderReferenceCSV, \
ValidateMedicalFolderRoot, \
ValidateSubjectsHasAllModalities, \
ValidateMedical... |
3,016 | mode | """Compatibility fixes for older version of python, numpy and scipy
If you add content to this file, please give the version of the package
at which the fix is no longer needed.
"""
# Authors: Emmanuelle Gouillart <emmanuelle.gouillart@normalesup.org>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# ... |
3,017 | render | """DMD (hardware device)."""
import struct
from kivy.graphics.instructions import Callback
from kivy.uix.effectwidget import EffectWidget
from kivy.clock import Clock
from kivy.graphics.fbo import Fbo
from kivy.graphics.opengl import glReadPixels, GL_RGB, GL_UNSIGNED_BYTE
from kivy.graphics.texture import Texture
fr... |
3,018 | get resource output | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
fr... |
3,019 | make test message | # Copyright iris-grib contributors
#
# This file is part of iris-grib and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""Unit tests for the :mod:`iris_grib` package."""
# import iris_grib.tests first so that some things can be initial... |
3,020 | additive phylogeny rec | from collections import defaultdict
import numpy as np
import sys
class DistanceMatrix:
def __init__(self, *args):
self.D = np.array(*args)
return
def __str__(self):
return str([[float(a) for a in x] for x in self.D])
def __repr__(self):
return type(self).__name__ + "(" +... |
3,021 | test accum wo reroute | #!/usr/env/python
from collections import deque
import numpy as np
import pytest
from landlab import FieldError, HexModelGrid, RasterModelGrid
from landlab.components import (
FlowAccumulator,
FlowDirectorDINF,
FlowDirectorSteepest,
LakeMapperBarnes,
)
from landlab.utils import StablePriorityQueue
"... |
3,022 | get foo | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""The tests for decorators_async.py"""
try:
from unittest import mock
except ImportError:
import mock
import sys
import time
import pytest
from azure.core.pi... |
3,023 | has object | from os.path import split, join
from PyQt5.QtWidgets import QWidget
from PyQt5.QtCore import pyqtSignal, pyqtSlot
from PyQt5.uic import loadUiType
class Overview3D(QWidget):
"""
This class is the 3D widget seen in the bottom right corner in ilastik.
It is basically a container for the actual 3D view, a ... |
3,024 | resources | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2018-2022 F4PGA 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
#
# Unl... |
3,025 | test streamlit activate | #!/usr/bin/env python
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)
#
# 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
#
# ... |
3,026 | set | import asyncio
from .. import fhem
from .. import fhem_pythonbinding as fhepy
from .. import generic
# imports for dynamical usage, do NOT remove
from .devices.gateway import Gateway # noqa: F401
from .devices.sensor import (
ContactSensor,
HTSensor, # noqa: F401
MotionSensor,
SmokeSensor,
Water... |
3,027 | test logging level | # coding: utf-8
import sys
import pytest
import logging
import warnings
from sentry_sdk.integrations.logging import LoggingIntegration, ignore_logger
other_logger = logging.getLogger("testfoo")
logger = logging.getLogger(__name__)
@pytest.fixture(autouse=True)
def reset_level():
other_logger.setLevel(logging.D... |
3,028 | return json | #!/usr/bin/python
import json
from collections import OrderedDict
from sys import argv
def METHOD_NAME(payload):
return(json.dumps(payload,
sort_keys=True,
indent=4
)
)
if argv[1] == 'update_order':
fw_manifest = argv[2]
ver... |
3,029 | tr | import qgis.gui
from qgis.core import Qgis
from qgis.PyQt import QtCore
from qgis.PyQt.QtCore import QCoreApplication
from qgis.PyQt.QtCore import QEventLoop
from qgis.PyQt.QtCore import Qt
from qgis.PyQt.QtCore import QThread
from qgis.PyQt.QtWidgets import QProgressBar
from qgis.PyQt.QtWidgets import QPushButton
from... |
3,030 | check job | # Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract
# DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government
# retains certain rights in this software.
import RemoteComputationInterface
import subprocess
impo... |
3,031 | file line helper | from tkinter import *
from idlelib.EditorWindow import EditorWindow
import re
import tkinter.messagebox as tkMessageBox
from idlelib import IOBinding
class OutputWindow(EditorWindow):
"""An editor window that can serve as an output file.
Also the future base class for the Python shell window.
This class ... |
3,032 | test with timeout | # 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" file... |
3,033 | test perceval params | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2023 Bitergia
#
# 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 ... |
3,034 | h | #!/usr/bin/python2.6
#
# Copyright (C) Christian Thurau, 2010.
# Licensed under the GNU General Public License (GPL).
# http://www.gnu.org/licenses/gpl.txt
"""
PyMF Simplex Volume Maximization [1]
SIVM_SEARCH: class for search-SiVM
[1] C. Thurau, K. Kersting, and C. Bauckhage. Yes We Can - Simplex Volume
Maximiza... |
3,035 | placements | """
Placements are representations of a laserjob origin.
A project may contain multiple such placements, for every placement
a copy of the plan will be executed with the placement indicating
the relative position
"""
from meerk40t.core.node.node import Node
from meerk40t.core.units import Angle, Length
from meerk40t.s... |
3,036 | allow updates | # 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__ =... |
3,037 | main | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2012 Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metac... |
3,038 | get date list | import datetime
from collections.abc import Sequence
from typing import Any, TypeVar
from django.db import models
from django.db.models.query import QuerySet
from django.http import HttpRequest, HttpResponse
from django.utils.datastructures import _IndexableCollection
from django.views.generic.base import View
from dj... |
3,039 | probe | from __future__ import print_function
import os
import pygame
import pkg_resources
import yaml
import fnmatch
from MAVProxy.modules.lib import mp_module
from MAVProxy.modules.lib import mp_util
from MAVProxy.modules.lib import mp_settings
from MAVProxy.modules.mavproxy_joystick import controls
class Joystick(mp_mo... |
3,040 | on mouse drag | """
Section Example 1:
In this Section example we divide the screen in two sections and let the user
pick a box depending on the selected Section
Note:
- How View know nothing of what's happening inside the sections.
Each section knows what to do.
- Each event mouse input is handled by each Section even... |
3,041 | output | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
3,042 | analyze | #################################################################################
# FOQUS Copyright (c) 2012 - 2023, by the software owners: Oak Ridge Institute
# for Science and Education (ORISE), TRIAD National Security, LLC., Lawrence
# Livermore National Security, LLC., The Regents of the University of
# California... |
3,043 | test docstring example | from snowfakery.utils.collections import CaseInsensitiveDict
import pytest
# From: https://github.com/psf/requests/blob/05a1a21593c9c8e79393d35fae12c9c27a6f7605/tests/test_requests.py
class TestCaseInsensitiveDict:
@pytest.mark.parametrize(
"cid",
(
CaseInsensitiveDict({"Foo": "foo", "... |
3,044 | typer | from .. import types, utils, errors
import operator
from .templates import (AttributeTemplate, ConcreteTemplate, AbstractTemplate,
infer_global, infer, infer_getattr,
signature, bound_function, make_callable_template)
from .builtins import normalize_1d_index
@infer_glob... |
3,045 | setup | # -------------------------------------------------------------------------------------------------
# Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved.
# https://nautechsystems.io
#
# Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
# You may not use this file ex... |
3,046 | caller trace | """SCons.Debug
Code for debugging SCons internal things. Shouldn't be
needed by most users. Quick shortcuts:
from SCons.Debug import caller_trace
caller_trace()
"""
#
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software... |
3,047 | pop back | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
3,048 | 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
# --------------------------------... |
3,049 | tear down class | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
3,050 | nudge | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Årets Spil 2014 - klappet og klart til julehandlen.
# Prik til concieggs mellem en og fem gange! -
# Men vær forsigtig. Pludselig eksploderer concieggs!
# Vinderen er den, som har prikket mest til concieggs, uden at udløse et raserianfald!
# SJOVT FOR ALLE MENNESKER I ... |
3,051 | get booted deployment id | import os.path
import DataFormats
import SSHLibrary
from robot.libraries.BuiltIn import BuiltIn
_log = BuiltIn().log
DATA_DIR = "/var/lib/microshift"
VERSION_FILE = f"{DATA_DIR}/version"
BACKUP_STORAGE = "/var/lib/microshift-backups"
HEALTH_FILE = f"{BACKUP_STORAGE}/health.json"
def remote_sudo_rc(cmd: str) -> tup... |
3,052 | bool option | # Copyright (c) 2005 The Regents of The University of Michigan
# 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 ... |
3,053 | shrink on resize | from rubicon.objc import ObjCClass
from toga_iOS.libs import UIApplication
from ..probe import BaseProbe
from .properties import toga_color
# From UIControl.h
UIControlEventTouchDown = 1 << 0
UIControlEventTouchDownRepeat = 1 << 1
UIControlEventTouchDragInside = 1 << 2
UIControlEventTouchDragOutside = 1 << 3
UIContr... |
3,054 | test bad path | # Copyright 2016 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... |
3,055 | test04 custom converter | import py, os, sys
from pytest import raises, skip
from .support import ispypy
class TestAPI:
def setup_class(cls):
if ispypy:
skip('C++ API only available on CPython')
import cppyy
cppyy.include('CPyCppyy/API.h')
def test01_type_checking(self):
"""Python class ty... |
3,056 | interpolate extend to | import bottleneck
import numpy as np
from Orange.data import Table, Domain
from Orange.data.util import SharedComputeValue
from scipy.interpolate import interp1d
from orangecontrib.spectroscopy.data import getx
def is_increasing(a):
return np.all(np.diff(a) >= 0)
class PreprocessException(Exception):
def ... |
3,057 | todense impl | # Copyright 2021 The JAX 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
3,058 | get lookup key | """Provides Registry mapping utility."""
from testplan.common.utils import logger
class Registry(logger.Loggable):
"""
A utility that provides a decorator (`@registry.bind`) for
mapping objects to another (decorated) class.
Supports absolute or category based
defaults via `@registry.bind_default`... |
3,059 | from dict | # Copyright 2021 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 accompanyin... |
3,060 | test start agent with no args | from unittest.mock import ANY
import prefect.cli.agent
from prefect import PrefectClient
from prefect.settings import PREFECT_AGENT_PREFETCH_SECONDS, temporary_settings
from prefect.testing.cli import invoke_and_assert
from prefect.testing.utilities import MagicMock
from prefect.utilities.asyncutils import run_sync_in... |
3,061 | create acl policy | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
3,062 | find project id | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
3,063 | test output created regression | #!/usr/bin/env python3
"""
MODULE: Test of r.learn.ml
AUTHOR(S): Steven Pawley <dr.stevenpawley gmail com>
PURPOSE: Test of r.learn.ml for regression
COPYRIGHT: (C) 2020 by Steven Pawley and the GRASS Development Team
This program is free software under the GNU General Public
License (>=v2). Read the file COP... |
3,064 | custom entity | # 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... |
3,065 | plot | # Copyright 2019 The Cirq Developers
#
# 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 agreed to in ... |
3,066 | encode key value | # Copyright The OpenTelemetry 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 ... |
3,067 | test init empty user agent raises configurationerror | import pytest
from subliminal_patch.core import Episode
from subliminal_patch.providers import subf2m
from subliminal_patch.providers.subf2m import ConfigurationError
from subliminal_patch.providers.subf2m import Subf2mProvider
from subliminal_patch.providers.subf2m import Subf2mSubtitle
from subzero.language import La... |
3,068 | slack channel | import pytest
import subprocess
import time
import os
import yaml
from kubernetes import config
from pathlib import Path
from io import StringIO
from tests.config import CONFIG
from tests.utils.robusta_utils import RobustaController
from tests.utils.slack_utils import SlackChannel
def pytest_addoption(parser):
p... |
3,069 | test cluster natural gas bus links entry | import pytest
import os
import pandas
from program_files.urban_district_upscaling.components import Link
# import standard parameter
standard_parameters = pandas.ExcelFile(os.path.dirname(__file__)
+ "/standard_parameters.xlsx")
links = standard_parameters.parse("6_links")
@pyt... |
3,070 | build transformer | # Copyright 2021 IBM Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
3,071 | set default font func | """
Global definitions used by Direct Gui Classes and handy constants
that can be used during widget construction
"""
__all__ = ()
from panda3d.core import (
KeyboardButton,
MouseButton,
PGButton,
PGEntry,
PGFrameStyle,
PGSliderBar,
TextNode,
)
defaultFont = None
defaultFontFunc = TextNod... |
3,072 | award count sub schedule | import pytest
from model_bakery import baker
from usaspending_api.references.models import DisasterEmergencyFundCode
from usaspending_api.submissions.models import SubmissionAttributes
from usaspending_api.submissions.models.dabs_submission_window_schedule import DABSSubmissionWindowSchedule
@pytest.fixture
def bas... |
3,073 | aggrid with complex objects | from nicegui import ui
from ..documentation_tools import text_demo
def main_demo() -> None:
grid = ui.aggrid({
'defaultColDef': {'flex': 1},
'columnDefs': [
{'headerName': 'Name', 'field': 'name'},
{'headerName': 'Age', 'field': 'age'},
{'headerName': 'Parent',... |
3,074 | test prometheus | """The selenium test."""
# pylint: skip-file
# Generated by Selenium IDE
import json # pylint: disable=import-error disable=unused-import
import time # pylint: disable=import-error disable=unused-import
import pytest # pylint: disable=import-error disable=unused-import
from selenium import webdriver # pylint: disa... |
3,075 | ol cuda func 1 | from numba import cuda, njit
from numba.core.extending import overload
from numba.cuda.testing import CUDATestCase, skip_on_cudasim, unittest
import numpy as np
# Dummy function definitions to overload
def generic_func_1():
pass
def cuda_func_1():
pass
def generic_func_2():
pass
def cuda_func_2():... |
3,076 | setup image | # Copyright (c) 2012-2022 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... |
3,077 | with carrier aggregation | """
Copyright 2022 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... |
3,078 | setup battery component | import json
from unittest.mock import Mock
import pytest
import requests
import requests_mock
from modules.devices.tesla import bat
from modules.devices.tesla.device import Device, Tesla
from modules.common.component_state import BatState
from modules.devices.tesla.config import TeslaConfiguration
from test_utils.moc... |
3,079 | verify instance interface | import unittest
import builtins
import warnings
import os
from platform import system as platform_system
class ExceptionClassTests(unittest.TestCase):
"""Tests for anything relating to exception objects themselves (e.g.,
inheritance hierarchy)"""
def test_builtins_new_style(self):
self.assertTru... |
3,080 | posterior | from bayes_opt import BayesianOptimization
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import mlab
from matplotlib import gridspec
# https://github.com/fmfn/BayesianOptimization/issues/18
def unique_rows(a):
"""
A functions to trim repeated rows that may appe... |
3,081 | get latest revision | import os.path
import sys
from numbers import Integral as int_types
from .error import err_add
def attrsearch(tag, attr, in_list):
for x in in_list:
if getattr(x, attr) == tag:
return x
return None
def keysearch(tag, n, in_list):
for x in in_list:
if x[n] == tag:
... |
3,082 | run segments | import os
import unittest
import cle
from cle.address_translator import AT
from cle.backends import Section, Segment
TESTS_BASE = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
os.path.join("..", "..", "binaries", "tests"),
)
groundtruth = {
("x86_64", "allcmps"): {
"sections": [
... |
3,083 | unused pytest runtest protocol | import pytest
import spytest.framework as stf
from utilities.common import get_proc_name
def trace(fmt, *args):
if args:
stf.dtrace(fmt % args)
else:
stf.dtrace(fmt)
def unused_pytest_collect_file(parent, path):
trace("\n%s: start", get_proc_name())
trace("{} {}".format(parent, path)... |
3,084 | test status | """
integration tests for mac_service
"""
import plistlib
import pytest
import salt.utils.files
from tests.support.case import ModuleCase
@pytest.mark.skip_if_not_root
@pytest.mark.skip_if_binaries_missing("launchctl", "plutil")
@pytest.mark.skip_unless_on_darwin
class MacServiceModuleTest(ModuleCase):
"""
... |
3,085 | test collider graph dsep | from itertools import combinations
import pytest
import networkx as nx
def path_graph():
"""Return a path graph of length three."""
G = nx.path_graph(3, create_using=nx.DiGraph)
G.graph["name"] = "path"
nx.freeze(G)
return G
def fork_graph():
"""Return a three node fork graph."""
G = n... |
3,086 | load nones | # 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 marshmallow import fields, post_dump, post_load, pre_load
from marshmallow_enum import EnumField
fro... |
3,087 | setup | # Copyright 2015-2017 ARM Limited
#
# 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 w... |
3,088 | get id | # License models
from le_utils.constants import licenses
from .. import config
from ..exceptions import UnknownLicenseError
def get_license(license_id, copyright_holder=None, description=None):
if license_id == licenses.CC_BY:
return CC_BYLicense(copyright_holder=copyright_holder)
elif license_id == ... |
3,089 | decodeint | # ed25519.py - Optimized version of the reference implementation of Ed25519
# downloaded from https://github.com/pyca/ed25519
#
# Written in 2011? by Daniel J. Bernstein <djb@cr.yp.to>
# 2013 by Donald Stufft <donald@stufft.io>
# 2013 by Alex Gaynor <alex.gaynor@gmail.com>
# 2013 by Gre... |
3,090 | run | # This file is Copyright 2020 Volatility Foundation and licensed under the Volatility Software License 1.0
# which is available at https://www.volatilityfoundation.org/license/vsl-v1.0
#
import logging
import os
from typing import List, Optional, Tuple, Iterator
from volatility3.framework import interfaces, renderers... |
3,091 | test bfd fast convergence | #!/usr/bin/env python
# SPDX-License-Identifier: ISC
#
# test_bfd_topo1.py
# Part of NetDEF Topology Tests
#
# Copyright (c) 2018 by
# Network Device Education Foundation, Inc. ("NetDEF")
#
"""
test_bfd_topo1.py: Test the FRR BFD daemon.
"""
import os
import sys
import json
from functools import partial
import pytes... |
3,092 | forward | from typing import Tuple, Union
import torch
import torch.nn.functional as F
from torch import Tensor
from torch.nn import Parameter
from torch_geometric.nn.conv import MessagePassing
from torch_geometric.nn.dense.linear import Linear
from torch_geometric.nn.inits import glorot
from torch_geometric.typing import (
... |
3,093 | get class | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of IVRE.
# Copyright 2011 - 2022 Pierre LALET <pierre@droids-corp.org>
#
# IVRE 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 versio... |
3,094 | to binary image | from enum import Enum
from typing import Iterable, List, Union
import numpy as np
import SimpleITK as sitk
from local_migrator import register_class
@register_class
class RadiusType(Enum):
"""
If operation should be performed and if on each layer separately on globally
"""
NO = 0 #: No operation
... |
3,095 | update | import math
import time
from typing import List
import numpy
import numpy as np
import pygame
from pygame.color import THECOLORS
from soccer_strategy.ball import Ball
from soccer_strategy.robot import Robot
from soccer_strategy.robot_controlled_2d import RobotControlled2D
class Scene:
"""
Scene used by the ... |
3,096 | details | '''
Groups
======
The following methods allow for interaction into the Tenable Security Center
:sc-api:`Group <Group.htm>` API. These items are typically seen under the
**User Groups** section of Tenable Security Center.
Methods available on ``sc.groups``:
.. rst-class:: hide-signature
.. autoclass:: GroupAPI
:... |
3,097 | validate changes | """Contains the WidgetPropertiesDialog class."""
__all__ = ['WidgetPropertiesDialog']
import Pmw
import tkinter as tk
class WidgetPropertiesDialog(tk.Toplevel):
"""Class to open dialogs to adjust widget properties."""
def __init__(self, propertyDict, propertyList = None, parent = None,
tit... |
3,098 | call | """Custom loss functions and metrics."""
import tensorflow as tf
from sleap.nn.config import HardKeypointMiningConfig
def compute_ohkm_loss(
y_gt: tf.Tensor,
y_pr: tf.Tensor,
hard_to_easy_ratio: float = 2.0,
min_hard_keypoints: int = 2,
max_hard_keypoints: int = -1,
loss_scale: float = 5.0,
)... |
3,099 | compare etfs | """Stockanalysis.com/etf Model"""
__docformat__ = "numpy"
import logging
import pathlib
from typing import List, Tuple
import pandas as pd
from bs4 import BeautifulSoup
from openbb_terminal.decorators import log_start_end
from openbb_terminal.helper_funcs import get_user_agent, request
logger = logging.getLogger(__... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.