id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
2,100 | watchdog | """
Pytest configuration that spins up a single localstack instance that is shared across test modules.
See: https://docs.pytest.org/en/6.2.x/fixture.html#conftest-py-sharing-fixtures-across-multiple-files
It is thread/process safe to run with pytest-parallel, however not for pytest-xdist.
"""
import logging
import mu... |
2,101 | num masked values | # 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... |
2,102 | test icons | from homeassistant.components.humidifier import HumidifierEntityFeature
from homeassistant.components.humidifier.const import (
MODE_AUTO,
MODE_BOOST,
MODE_NORMAL,
MODE_SLEEP,
)
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.const import PERCENTAGE
from ..const import ... |
2,103 | test check lock up to date | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.packages import Locker
if TYPE_CHECKING:
import httpretty
from cleo.testers.command_tester import CommandTester
from pytest_mock import MockerFixture
from poetry.poetry import Poetry
from tests.types... |
2,104 | port end | #! /usr/bin/python
try:
import time
import string
from ctypes import create_string_buffer
from sonic_sfp.sfputilbase import SfpUtilBase
except ImportError as e:
raise ImportError(str(e) + "- required module not found")
class SfpUtil(SfpUtilBase):
"""Platform specific sfputil class"""
_po... |
2,105 | parse chromium | # Copyright (C) 2000-2014 Bastian Kleineidam
#
# 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 distr... |
2,106 | test register single module | import json
import pytest
import core.event
import core.config
import core.output
import core.module
class SampleModule(core.module.Module):
pass
@pytest.fixture(autouse=True)
def clear_events():
core.event.clear()
@pytest.fixture
def i3():
return core.output.i3()
@pytest.fixture
def module_a(mocke... |
2,107 | prepare get categories | import contextlib
from nonebot.typing import T_State
from nonebot.matcher import Matcher
from nonebot.params import Arg, ArgPlainText
from nonebot.adapters import Message, MessageTemplate
from nonebot_plugin_saa import Text, PlatformTarget, SupportedAdapters
from ..types import Target
from ..config import config
from... |
2,108 | set value | from datetime import datetime
from types import ModuleType
from typing import Dict, List, Optional, Sequence, TypedDict, Union, cast
import sentry_sdk
from rest_framework.exceptions import ValidationError
from rest_framework.request import Request
from rest_framework.response import Response
from sentry.api.api_publi... |
2,109 | create | from rest_framework import viewsets
from .models import ListModel
from . import serializers
from utils.page import MyPageNumberPagination
from rest_framework.filters import OrderingFilter
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.response import Response
from .filter import Filte... |
2,110 | check test type | import os
import shutil
import sys
import time
from typing import Any, NoReturn, Optional
from .setting import (
CompilerType,
LOG_DIR,
PROFILE_DIR,
TestList,
TestPlatform,
TestType,
)
def convert_time(seconds: float) -> str:
seconds = int(round(seconds))
seconds = seconds % (24 * 360... |
2,111 | test roc auc score with sklearn single | import numpy as np
import pytest
import sklearn
from autogluon.core.metrics import confusion_matrix, log_loss, quadratic_kappa, roc_auc
from autogluon.core.metrics.softclass_metrics import soft_log_loss
def test_confusion_matrix_with_valid_inputs_without_labels_and_weights():
# Given
input_solution = [2, 0, ... |
2,112 | forward | # Copyright (c) Alibaba, Inc. and its affiliates.
import math
import os.path as osp
from typing import Any, Dict, List, Union
import torch
import torch.nn.functional as F
from torch import autograd, nn
from modelscope.metainfo import Models
from modelscope.models.base import Tensor, TorchModel
from modelscope.models.... |
2,113 | run onlyif instance | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import builtins
import operator
from typing import Any, Callable, Type
import functools
import torch
from torch.fx import Node
# These need to run in global scope to handle nested calls correctly
_orig_module_call: Callable = torch.nn.Module.__... |
2,114 | get tasks | #
# -*- coding: utf-8 -*-
#
# Copyright (c) 2022 Intel 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 app... |
2,115 | handle | from __future__ import annotations
from collections import defaultdict
from django.core.management.base import BaseCommand
from django.db.models import Sum, Q, OuterRef, Subquery
from onadata.apps.logger.models.attachment import Attachment
from onadata.apps.logger.models.xform import XForm
from onadata.apps.main.mod... |
2,116 | method | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
2,117 | rx | # 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... |
2,118 | measure thread | import json
import os
import rclpy
import cv2
import sys
import base64
import threading
import time
import numpy as np
from datetime import datetime
from websocket_server import WebsocketServer
import multiprocessing
from shared.image import SharedImage
from shared.image import SharedImage
from shared.value import Sh... |
2,119 | test unknown keyword without messages | # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
import pytest
from pylint.utils.pragma_parser import (
OPTION_PO,
InvalidPragma... |
2,120 | polynomial regression | #!/usr/bin/env python
# This plan contains tests that demonstrate failures as well.
"""
This example shows how to display various data modelling techniques and their
associated statistics in Testplan. The models used are:
* linear regression
* classification
* clustering
"""
import os
import sys
from testplan import ... |
2,121 | move rel | # -*- coding: utf-8 -*-
"""
Created on Sat Sep 13 16:54:15 2014
@author: David Baddeley
"""
import Pyro.core
import Pyro.naming
import threading
from PYME.misc.computerName import GetComputerName
from PYME.Acquire import eventLog
import time
from .base_piezo import PiezoBase
class piezoOffsetProxy(PiezoBase, Pyro.c... |
2,122 | reset | from __future__ import annotations
import math
from river import base, stats
class HDDM_A(base.BinaryDriftAndWarningDetector):
"""Drift Detection Method based on Hoeffding's bounds with moving average-test.
HDDM_A is a drift detection method based on the Hoeffding's inequality which uses
the input aver... |
2,123 | username | """Utilities for views"""
from __future__ import annotations
import json
import os
import subprocess
from flask import render_template, request, session, current_app
from flask_security.core import current_user
from flexmeasures import __version__ as flexmeasures_version
from flexmeasures.auth.policy import user_has... |
2,124 | test unknown browser default | #
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# 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 ... |
2,125 | step list skus | # --------------------------------------------------------------------------
# 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 cause incor... |
2,126 | make model | # Owner(s): ["module: unknown"]
from torch import nn
from torch.ao.pruning import WeightNormSparsifier
from torch.ao.pruning import BaseScheduler, LambdaSL, CubicSL
from torch.testing._internal.common_utils import TestCase
import warnings
class ImplementedScheduler(BaseScheduler):
def get_sl(self):
if ... |
2,127 | test get enum | # -*- coding: utf-8 -*-
"""Tests for the :class:`aiida.orm.nodes.data.enum.Enum` data plugin."""
import enum
import pytest
from aiida.common import links
from aiida.orm import load_node
from aiida.orm.nodes.data.enum import EnumData
class DummyEnum(enum.Enum):
"""Dummy enum for testing."""
OPTION_A = 'a'
... |
2,128 | test user can be fetched | #!/usr/bin/env python
"""Tests for root API user management calls."""
from absl import app
from grr_api_client import errors as grr_api_errors
from grr_api_client import root as grr_api_root
from grr_response_server import data_store
from grr_response_server.gui import api_integration_test_lib
from grr.test_lib impor... |
2,129 | test chrono different resolutions | import datetime
import pytest
import env # noqa: F401
from pybind11_tests import chrono as m
def test_chrono_system_clock():
# Get the time from both c++ and datetime
date0 = datetime.datetime.today()
date1 = m.test_chrono1()
date2 = datetime.datetime.today()
# The returned value should be a ... |
2,130 | setup | # -*- coding: utf-8 -*-
from future import standard_library
standard_library.install_aliases()
from builtins import object
import sys
from requests import Session
import requests
import urllib.request, urllib.parse, urllib.error
from sqlalchemy import Column, Integer, String, ForeignKey
from monitorrent.db import Base,... |
2,131 | prepare data | """Run as `python un_wpp.py`"""
import glob
import os
import shutil
import tempfile
import time
import zipfile
from pathlib import Path
import requests
from structlog import get_logger
from owid.walden import add_to_catalog
from owid.walden.catalog import Dataset
log = get_logger()
URLS = {
"fertility": [
... |
2,132 | type | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . imp... |
2,133 | raw dir | import os.path as osp
from typing import Callable, List, Optional
import numpy as np
import torch
from torch_geometric.data import InMemoryDataset, download_url
from torch_geometric.io import read_planetoid_data
class Planetoid(InMemoryDataset):
r"""The citation network datasets :obj:`"Cora"`, :obj:`"CiteSeer"`... |
2,134 | location | # 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... |
2,135 | samples | # Copyright (C) 2022-2023 CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
from __future__ import annotations
import zipfile
from concurrent.futures import ThreadPoolExecutor
from typing import Sequence
import PIL.Image
import cvat_sdk.core
import cvat_sdk.core.exceptions
import cvat_sdk.models as models
from c... |
2,136 | as expr | """Implementation of :class:`ExpressionDomain` class."""
from ..core.sympify import SympifyError, sympify
from .characteristiczero import CharacteristicZero
from .field import Field
from .simpledomain import SimpleDomain
class ExpressionDomain(CharacteristicZero, SimpleDomain, Field):
"""A class for arbitrary ex... |
2,137 | get type docs | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
2,138 | xy z to os a ucs | """
Optical Society of America Uniform Colour Scales (OSA UCS)
==========================================================
Defines the *OSA UCS* colourspace:
- :func:`colour.XYZ_to_OSA_UCS`
- :func:`colour.OSA_UCS_to_XYZ`
References
----------
- :cite:`Cao2013` : Cao, R., Trussell, H. J., & Shamey, R. (2013). C... |
2,139 | create vendor account | # Copyright 2020 DSR 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 writ... |
2,140 | test move child after itself | from __future__ import annotations
import pytest
from textual.app import App
from textual.widget import Widget, WidgetError
async def test_move_child_no_direction() -> None:
"""Test moving a widget in a child list."""
async with App().run_test() as pilot:
child = Widget(Widget())
await pilot... |
2,141 | to generator | """
This example shows how you could use Keras `Sequence`s and multiprocessing/multithreading for Keras
models in Determined. Information for how this can be configured can be found in
`make_data_loaders()`.
Tutorial based on this example:
https://docs.determined.ai/latest/tutorials/tf-cifar-tutorial.html
Useful ... |
2,142 | run on dataset | # 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... |
2,143 | has enddate | """
Mixins to be inherited by AbstractEvent
They are split up in order make them easier to read,
and because there was (once upon a time) an idea to split up the information
about an event and the registration info into different models.
"""
from datetime import datetime
from django.db import models
from six.moves.u... |
2,144 | testfile | 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... |
2,145 | test interp dfs1 |
import numpy as np
import pytest
import pandas as pd
import mikeio
from mikeio import Dfs1
from mikeio import EUMType, EUMUnit
def test_filenotexist():
with pytest.raises(FileNotFoundError):
mikeio.open("file_that_does_not_exist.dfs1")
def test_repr():
filename = r"tests/testdata/random.dfs1"
... |
2,146 | internal paging | # 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 ... |
2,147 | preprocess grid | # Copyright 2023 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... |
2,148 | test sparse sample | # Copyright 2019 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... |
2,149 | image verify | #!/usr/bin/env python3
#
# Tests for shrinking images
#
# Copyright (c) 2016-2017 Parallels International GmbH
#
# 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, ... |
2,150 | get file | import struct
from dataclasses import dataclass
from enum import IntEnum
from pathlib import Path
from typing import Optional
import numpy as np
import numpy.typing as npt
from ..utils import Buffer, FileBuffer
def make_texture(indices, palette, use_alpha: bool = False) -> npt.NDArray[np.float32]:
new_palette =... |
2,151 | tear down | """
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... |
2,152 | exchange bind | # twisted is optional and self-contained in this module.
# We don't want to force it as a dependency but that means we also can't test it with type-checkers given the current setup.
from _typeshed import Incomplete
from typing import Generic, NamedTuple, TypeVar
import pika.connection
from pika.adapters.utils import ... |
2,153 | test condition fails on timeout | # A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2022 NV Access Limited.
"""Unit tests for the blockUntilConditionMet submodule.
"""
from typing import (
Any,
Callable,
Type,
)
import unittest
from unittes... |
2,154 | farm block | from __future__ import annotations
from secrets import token_bytes
from typing import Dict, List
from chia.rpc.full_node_rpc_api import FullNodeRpcApi
from chia.rpc.rpc_server import Endpoint, EndpointResult
from chia.simulator.full_node_simulator import FullNodeSimulator
from chia.simulator.simulator_protocol import... |
2,155 | transform | # (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from datadog_checks.base import OpenMetricsBaseCheckV2
from datadog_checks.base.constants import ServiceCheck
from datadog_checks.dev.testing import requires_py3
from .utils import get_check
pytestmark =... |
2,156 | test context | # pylint: disable=redefined-outer-name
from __future__ import annotations
import asyncio
import time
from pathlib import Path
import pytest
import bentoml
from bentoml.testing.utils import async_request
@pytest.mark.asyncio
async def test_api_server_load(host: str):
for _ in range(20):
status, _, _ = ... |
2,157 | dmatrix from cupy | import json
import sys
import numpy as np
import pytest
import xgboost as xgb
sys.path.append("tests/python")
from test_dmatrix import set_base_margin_info
from xgboost import testing as tm
cupy = pytest.importorskip("cupy")
def test_array_interface() -> None:
arr = cupy.array([[1, 2, 3, 4], [1, 2, 3, 4]])
... |
2,158 | test empty | from typing import List
import pytest
from beet import GenericPipeline, PluginError, PluginImportError
TestPipeline = GenericPipeline[List[str]]
def METHOD_NAME():
pipeline = TestPipeline([])
pipeline.run()
assert pipeline.ctx == []
def test_basic():
pipeline = TestPipeline([])
def p1(ctx: L... |
2,159 | load | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import json
import logging
import shutil
import tempfile
import unittest
from typing import Any
from mock import patch
from pyhocon import ConfigFactory, ConfigTree
from databuilder.extractor.base_extractor import Extractor
from ... |
2,160 | aestat rs | import numpy as np
from pyNastran.bdf import read_bdf, BDF
def partition_matrix(Maa):
str(Maa)
MLL = MLR = MRR = MRL = np.zeros((3, 3))
return MLL, MLR, MRR, MRL
def pfaero(model: BDF):
"""performs aero calcs that are independent of the structural model"""
str(model)
# ???
AJJ = np.zeros((... |
2,161 | empty image | # MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2022
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
# r... |
2,162 | type description | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from abc i... |
2,163 | test zoom | from PyQt5.QtCore import Qt
from PyQt5.QtGui import QDropEvent
from PyQt5.QtTest import QTest
from PyQt5.QtWidgets import QApplication
from tests.QtTestCase import QtTestCase
from urh.controller.dialogs.ModulatorDialog import ModulatorDialog
from urh.util.Logger import logger
class TestModulatorGUI(QtTestCase):
... |
2,164 | meshes container | """
forward_meshes_container
========================
Autogenerated DPF operator classes.
"""
from warnings import warn
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs
from ansys.dpf.core.operators.specification import... |
2,165 | difference | # Access WeakSet through the weakref module.
# This code is separated-out because it is needed
# by abc.py to load everything else at startup.
from _weakref import ref
from types import GenericAlias
__all__ = ['WeakSet']
class _IterationGuard:
# This context manager registers itself in the current iterators of ... |
2,166 | get description | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Profiler Plugin.
"""
# Standard library imports
from typing import List
# Third party imports
from qtpy.QtCore import Signal
# Local imports
from spyder.api.pl... |
2,167 | qnn subtract driver | # 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... |
2,168 | register | # This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2023 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
"""
Tracking spatial indexes
"""
import logging
from threading import Lock
from typing import Mapping, Optional, Type, Union
from sqlalchemy i... |
2,169 | test roundtripable types | from __future__ import annotations
import hypothesis as h
import hypothesis.strategies as st
import pyarrow as pa
import pyarrow.tests.strategies as past
import pytest
import ibis.expr.datatypes as dt
from ibis.common.exceptions import IntegrityError
from ibis.formats.pyarrow import PyArrowSchema, PyArrowType
def a... |
2,170 | test argmax memleak | # ***************************************************************
# 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.
# ************************... |
2,171 | test accessor returns a node | import os
import sys
import unittest
import listener.psapi
import listener.nodes
class EmptyNode(object):
def __init__(self, name):
self.name = name
class TestParentNode(unittest.TestCase):
def setUp(self):
listener.server.__INTERNAL__ = True
self.n = listener.nodes.ParentNode('testin... |
2,172 | inner product | # 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... |
2,173 | get next | #!/usr/bin/env python
#
# Urwid example lazy text editor suitable for tabbed and format=flowed text
# Copyright (C) 2004-2009 Ian Ward
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software F... |
2,174 | set cb | from PikaObj import *
def __init__(): ...
class EVENT:
ALL: int
PRESSED: int
PRESSING: int
PRESS_LOST: int
SHORT_CLICKED: int
LONG_PRESSED: int
LONG_PRESSED_REPEAT: int
CLICKED: int
RELEASED: int
SCROLL_BEGIN: int
SCROLL_END: int
SCROLL: int
GESTURE: int
KEY: in... |
2,175 | test check is bool non boolean attr | # -*- coding: utf-8 -*-
from unittest import mock
from django.db import models
from django.test import TestCase
from tests.testapp.models import (
DummyRelationModel, InheritedFromPostWithUniqFieldCompat, PostWithUniqFieldCompat,
ReverseModelCompat, SecondDummyRelationModel, ThirdDummyRelationModel,
)
from dj... |
2,176 | set file mode | # 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
... |
2,177 | test example secret list operations | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# -------------------------------------
from __future__ import print_function
import time
import pytest
from devtools_testutils import recorded_by_proxy
from _shared.test_case import KeyVaultTestCase
from ... |
2,178 | compose spec yaml | # pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
# pylint: disable=too-many-function-args
import asyncio
from typing import Any
import pytest
import yaml
from faker import Faker
from pytest_mock.plugin import MockerFixture
from pytest_simcore.helpers.typing_en... |
2,179 | postscript rule7 | # Leo colorizer control file for postscript mode.
# This file is in the public domain.
# Properties for postscript mode.
properties = {
"lineComment": "%",
}
# Attributes dict for postscript_main ruleset.
postscript_main_attributes_dict = {
"default": "null",
"digit_re": "",
"escape": "\\",
"highl... |
2,180 | message type at | # Author(s): Andrea Colangelo (andreacolangelo@openforce.it)
# Copyright 2018 Openforce Srls Unipersonale (www.openforce.it)
# Copyright 2018 Sergio Corato (https://efatto.it)
# Copyright 2018-2019 Lorenzo Battistini <https://github.com/eLBati>
import logging
import re
from odoo import _, fields, models
from odoo.exc... |
2,181 | fix data dtype | """OpenGL Utilities.
"""
from contextlib import contextmanager
from functools import lru_cache
from typing import Tuple
import numpy as np
from vispy.app import Canvas
from vispy.gloo import gl
from vispy.gloo.context import get_current_canvas
from napari.utils.translations import trans
texture_dtypes = [
np.dty... |
2,182 | test machine types | #
# Test virtio-scsi and virtio-blk queue settings for all machine types
#
# Copyright (c) 2019 Virtuozzo International GmbH
#
# 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... |
2,183 | test info | """
:codeauthor: Pablo Suárez Hdez. <psuarezhernandez@suse.de>
Test cases for salt.modules.udev
"""
import pytest
import salt.modules.udev as udev
from tests.support.mock import MagicMock, patch
@pytest.fixture
def configure_loader_modules():
return {udev: {}}
# 'info' function tests: 1
def METHOD... |
2,184 | safe popup noclose | import os
from PyQt5 import uic
from PyQt5.QtCore import QObject, pyqtSignal, Qt
from PyQt5.QtWidgets import QDialog, QMessageBox
from os.path import split as split_path
import platform
from enum import IntEnum, auto
class ProgressDialog(QDialog):
cancel = pyqtSignal()
trigger_popup = pyqtSignal(str, str, obj... |
2,185 | main | import pandas as pd
import sys
import time
import numpy as np
import scipy as sp
import scipy.optimize as opt
import scipy.signal as signal
import os, json
import pygama.dataset as ds
import pygama.analysis.histograms as pgh
import pygama.dsp.transforms as pgt
import pygama.utils as pgu
import pygama.analysis.peak_fitt... |
2,186 | on tag deleted | # -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2013 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Gene... |
2,187 | remove weight norm | # Copyright (c) 2022 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... |
2,188 | predict measurement | from functools import lru_cache
import numpy as np
from ..base import Property
from ..types.prediction import GaussianMeasurementPrediction
from ..types.update import Update
from ..models.measurement.linear import LinearGaussian
from ..updater.kalman import KalmanUpdater
class InformationKalmanUpdater(KalmanUpdater... |
2,189 | movie start recording | # Copyright 1996-2023 Cyberbotics 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
2,190 | bug708901 | # Minimal tests for dis module
from __future__ import print_function
import sys
import unittest
import six
import xdis.std as dis
from xdis import IS_PYPY, PYTHON3, PYTHON_VERSION_TRIPLE
if PYTHON3:
from io import StringIO
else:
from test.test_support import run_unittest
from StringIO import StringIO
... |
2,191 | display details | # 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... |
2,192 | make template | from xbmcgui import Dialog
from tmdbhelper.lib.addon.plugin import get_localized
from tmdbhelper.lib.addon.consts import PLAYERS_BASEDIR_SAVE, PLAYERS_BASEDIR_TEMPLATES
from tmdbhelper.lib.files.futils import get_files_in_folder, read_file, write_to_file
from tmdbhelper.lib.api.kodi.rpc import get_directory
from tmdbhe... |
2,193 | to dict | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.28
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
2,194 | reconnect a client | """
Tests TCP communication between a server that accepts multiple clients.
"""
from testplan.common.utils.context import context
from testplan.testing.multitest import MultiTest, testsuite, testcase
from testplan.testing.multitest.driver.tcp import TCPServer, TCPClient
@testsuite
class TCPTestsuite:
"""TCP test... |
2,195 | tear down | #
# Copyright (C) 2010-2022 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... |
2,196 | label func | from __future__ import division
import json
import os
import copy
import collections
import argparse
import csv
import neuroglancer
import neuroglancer.cli
import numpy as np
class State(object):
def __init__(self, path):
self.path = path
self.body_labels = collections.OrderedDict()
def loa... |
2,197 | test | #!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-only
#
# Advanced cgset functionality test - '-b' '-g' <controller> (cgroup v2)
#
# Copyright (c) 2023 Oracle and/or its affiliates.
# Author: Kamalesh Babulal <kamalesh.babulal@oracle.com>
from cgroup import Cgroup, CgroupVersion
from systemd import Systemd
f... |
2,198 | annotate parameter | #!/usr/bin/python2.7
# Copyright 2012 Google Inc. 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 requi... |
2,199 | test get eol chars no eol | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
"""Tests for sourcecode.py"""
import os
import sys
import pytest
from spyder.utils import sourcecode
def test_normalize_eols():
text = "a\nb\r\nc\rd"
assert sourcecode.normalize_eols(text) == ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.