id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
1,700 | test popen worker recycles with initializer | # 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... |
1,701 | heartbeat | # Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
import gzip
import os
import shutil
import subprocess
import sys
import time
from importlib import import_module
from shutil import copyfile
from celery.schedules import crontab
from django.conf import settings
from django.c... |
1,702 | assert io | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2014 Glencoe Software, Inc. All Rights Reserved.
# Use is subject to license terms supplied in LICENSE.txt
#
# 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... |
1,703 | on train end | import os
import stat
from utils import apply_eval
from mindspore import log as logger
from mindspore import save_checkpoint
from mindspore.train.callback import Callback, CheckpointConfig, LossMonitor, ModelCheckpoint, TimeMonitor
class EvalCallBack(Callback):
"""
Evaluation callback when training.
Ar... |
1,704 | multi attachments plan | """Test storing of attachments in a report."""
import re
import os
import pytest
import testplan
from testplan.testing import multitest
@multitest.testsuite
class Suite1:
def __init__(self, attachments):
self._attachments = attachments
@multitest.testcase
def attach(self, env, result):
... |
1,705 | post | from typing import List
from flask import request
from flask_restx import Namespace, Resource
from CTFd.api.v1.helpers.request import validate_args
from CTFd.api.v1.helpers.schemas import sqlalchemy_to_pydantic
from CTFd.api.v1.schemas import APIDetailedSuccessResponse, APIListSuccessResponse
from CTFd.constants impo... |
1,706 | execute add document to collection | from django.contrib import admin
from django.utils.translation import gettext_lazy as _
from filingcabinet.admin import (
CollectionDirectoryAdmin,
CollectionDocumentBaseAdmin,
DocumentBaseAdmin,
DocumentCollectionBaseAdmin,
DocumentPortalAdmin,
PageAdmin,
PageAnnotationAdmin,
)
from filing... |
1,707 | test to string without checksum | #!/usr/bin/python3
import pytest
from brownie import compile_source
from brownie.exceptions import VirtualMachineError
from brownie.network.transaction import TransactionReceipt
code = """
pragma solidity ^0.6.0;
contract Foo {
fallback () external payable {}
}
"""
def test_to_string(accounts):
"""Can send... |
1,708 | test systemstatus detail api redirect | import urllib.parse
from django.contrib.auth.models import User
from django.test import TestCase
from dfirtrack_main.models import Systemstatus
class SystemstatusAPIViewTestCase(TestCase):
"""systemstatus API view tests"""
@classmethod
def setUpTestData(cls):
# create object
Systemstatu... |
1,709 | goto frame | # Copyright © 2012-2023 Forschungszentrum Jülich GmbH
# SPDX-License-Identifier: LGPL-3.0-or-later
import math
from jupedsim_visualizer.geometry import Geometry
from jupedsim_visualizer.geometry_widget import RenderWidget
from jupedsim_visualizer.trajectory import Trajectory
from PySide6.QtCore import QSignalBlocker, ... |
1,710 | run coro and return result | ## Copyright 2022, The TensorFlow Federated 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 ... |
1,711 | test color overlay | from __future__ import absolute_import, unicode_literals
import pytest
import logging
from psd_tools.api.psd_image import PSDImage
from psd_tools.terminology import Enum
from ..utils import full_name
logger = logging.getLogger(__name__)
LAYER_EFFECTS = PSDImage.open(full_name('layer_effects.psd'))
@pytest.fixture... |
1,712 | test text changed signal | ##########################################################################
#
# Copyright (c) 2012, Image Engine Design Inc. All rights reserved.
# Copyright (c) 2012, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that ... |
1,713 | authenticate | """
init code for run falcon API
"""
import json
import datetime
import falcon
from enum import Enum
from itsdangerous import JSONWebSignatureSerializer, BadSignature
class MonitorrentJSONEncoder(json.JSONEncoder):
"""
can return datetime in ISO format and Enum as regular string
"""
# pylint: disable... |
1,714 | host memory arg | """
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""
import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.message
import sys
import tensorflow.core.framework.attr_value_pb2
if sys.version_info >= (3, 8):
im... |
1,715 | test it proxies to fetch by pubid | import datetime
from unittest import mock
import pytest
from h_matchers import Any
from h.models import Group
from h.models.group import ReadableBy
from h.services.group import GroupService, groups_factory
class TestGroupServiceFetch:
def test_it_proxies_to_fetch_by_groupid_if_groupid_valid(self, svc):
... |
1,716 | grid | # Copy past from c2cgeoportal_admin.views.layer_wms except:
# - All references to LuxLayerInternalWMS and lux_layer_internal_wms
# - Addition of _list_field('category_id'),
# - renderer path (from "../templates/abc.jinja2" to "./templates/abc.jinja2")
from functools import partial
from pyramid.view import view_defa... |
1,717 | chatter | #!/usr/bin/env python
##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany t... |
1,718 | compile consensus statistics | import logging
import warnings
import os
import numpy as np
import pandas as pd
import xarray as xr
try:
import salem
except ImportError:
pass
from oggm import utils, cfg
# Module logger
log = logging.getLogger(__name__)
default_base_url = 'https://cluster.klima.uni-bremen.de/~fmaussion/icevol/composite/'
... |
1,719 | message | import typing as t
if t.TYPE_CHECKING:
from .runtime import Undefined
class TemplateError(Exception):
"""Baseclass for all template errors."""
def __init__(self, METHOD_NAME: t.Optional[str] = None) -> None:
super().__init__(METHOD_NAME)
@property
def METHOD_NAME(self) -> t.Optional[str... |
1,720 | plot for energies | import matplotlib.pyplot as plt
import numpy as np
from qaml_scripts.evolution import perform_adiabatic
import qibo
def train_adiabatic_evolution(
nsteps,
xarr,
cdf,
training_n,
init_params,
e0,
e1,
target_loss,
finalT,
h0,
h1,
obs_target,
):
"""Train the adiabatic... |
1,721 | compare | # This file is part of Ansible
# -*- coding: utf-8 -*-
#
# Ansible 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.
#
# Ansible is distr... |
1,722 | get tokens of interest |
from vsg import parser
from vsg import violation
from vsg.vhdlFile import utils
from vsg.rule_group import whitespace
from vsg.rules import utils as rules_utils
class spaces_before_and_after_tokens_when_bounded_by_tokens(whitespace.Rule):
'''
Checks for a single space between two tokens.
Parameters
... |
1,723 | is stat in shape of scale | # Copyright (c) 2023 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 applicable law or agreed to in writ... |
1,724 | v12 | """Configuration for EcalHexReadout"""
class EcalGeometry() :
"""Configuration for EcalHexReadout for a specific geometry
Attributes
----------
layerZPositions : float
z-coordinates of sensitive ecal layers relative to front of ecal [mm]
ecalFrontZ : float
z-coordinate of front of ... |
1,725 | handle error | from authlib.common.urls import (
url_decode,
add_params_to_uri,
urlparse,
)
from authlib.common.encoding import json_loads
from .rfc5849 import (
SIGNATURE_HMAC_SHA1,
SIGNATURE_TYPE_HEADER,
ClientAuth,
)
class OAuth1Client:
auth_class = ClientAuth
def __init__(self, session, client_i... |
1,726 | write test nested key json dataset | # -*- coding: utf-8 -*-
import json
import logging
import os
import shutil
import subprocess
import tempfile
from urllib.error import HTTPError
import torch # noqa: F401
from torch.testing._internal.common_utils import TestCase
logger = logging.getLogger(__name__)
def third_party_download(test_func):
def inner... |
1,727 | group by | import math
from collections import OrderedDict
from itertools import groupby
from functools import reduce
def percent(num, denom, places=2):
if denom == 0:
return 0
else:
return round(num / denom * 100, places)
def ratio(num, denom, places=2):
if denom == 0:
return 0
else:
... |
1,728 | extract terms set | # Copyright 2016-22 Nick Boultbee
#
# 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.
import time
import operator
from co... |
1,729 | test gpu | # Copyright 2019-2022 ETH Zurich and the DaCe authors. All rights reserved.
# Original application code: NPBench - https://github.com/spcl/npbench
import dace.dtypes
import numpy as np
import dace as dc
import pytest
import argparse
from dace.fpga_testing import fpga_test, xilinx_test
from dace.transformation.interstat... |
1,730 | test evaluate tuple | import datetime
import sys
from decimal import Decimal
from enum import Enum
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Set
from typing import Tuple
from typing import Type
from typing import TypeVar
from typing import Union
from unittest import... |
1,731 | print msg | #-------------------------------------------------------------------------------
#
# Project: EOxServer <http://eoxserver.org>
# Authors: Stephan Krause <stephan.krause@eox.at>
# Stephan Meissl <stephan.meissl@eox.at>
# Fabian Schindler <fabian.schindler@eox.at>
#
#------------------------------------... |
1,732 | get project root files | # Copyright (C) 2020 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd... |
1,733 | test expected values | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2023
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... |
1,734 | test partitioned csv | import bz2
import gzip
import logging
import lzma
from io import BytesIO, TextIOWrapper
from typing import Optional
import boto3
import pyarrow as pa
import pytest
import awswrangler as wr
import awswrangler.pandas as pd
from .._utils import get_df_csv, is_ray_modin
EXT = {"gzip": ".gz", "bz2": ".bz2", "xz": ".xz",... |
1,735 | test array inline force float array | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#
"""Tests for the Array Builder Widget."""
# Standard library imports
import sys
# Third party imports
from qtpy.QtCore import Qt
import pytest
# Local imports
from spyder.widgets.arraybuilder import A... |
1,736 | lu factor | """LU decomposition functions."""
from __future__ import division, print_function, absolute_import
from warnings import warn
from numpy import asarray, asarray_chkfinite
# Local imports
from .misc import _datacopied, LinAlgWarning
from .lapack import get_lapack_funcs
from .flinalg import get_flinalg_funcs
__all__ ... |
1,737 | get tasks id labels | from _typeshed import Incomplete
from influxdb_client.service._base_service import _BaseService
class TasksService(_BaseService):
def __init__(self, api_client: Incomplete | None = None) -> None: ...
def delete_tasks_id(self, task_id, **kwargs): ...
def delete_tasks_id_with_http_info(self, task_id, **kwar... |
1,738 | write dc description | ###############################################################################
#
# Core - A class for writing the Excel XLSX Worksheet file.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright 2013-2023, John McNamara, jmcnamara@cpan.org
#
# Standard packages.
from datetime import datetime, timezone
# Package impo... |
1,739 | relative closeness | #!/usr/bin/env python
############################################################################
#
# MODULE: r.mcda.topsis
# AUTHOR: Gianluca Massei - Antonio Boggia
# PURPOSE: Generate a MCDA map based on TOPSIS algorthm.
# Based on Hwang C. L. and Yoon K. Multiple Objective Decision
# Making Methods and ... |
1,740 | post member access | from typing import Optional
from slither.core import expressions
from slither.core.expressions.expression import Expression
from slither.visitors.expression.expression import ExpressionVisitor
def get(expression: Expression) -> str:
val = expression.context["ExpressionPrinter"]
# we delete the item to reduce... |
1,741 | parse dir | #! /usr/bin/env python3
from __future__ import print_function
from builtins import range
import re,os,sys
import optparse
# python 2.6 has json modue; <2.6 could use simplejson
try:
import json
except ImportError:
import simplejson as json
from mutypes import *
import pprint
pp = pprint.PrettyPrinter(indent=2)... |
1,742 | get live url | # -*- coding: utf-8 -*-
# Copyright: (c) JUL1EN094, SPM, SylvainCecchetto
# Copyright: (c) 2016, SylvainCecchetto
# GNU General Public License v2.0+ (see LICENSE.txt or https://www.gnu.org/licenses/gpl-2.0.txt)
# This file is part of Catch-up TV & More
from __future__ import unicode_literals
from builtins import str
... |
1,743 | get rank | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
This file contains primitives for multi-gpu communication.
This is useful when doing distributed training.
"""
import functools
import logging
import numpy as np
import pickle
import torch
import torch.distributed as dist
import torch
_LOCAL_... |
1,744 | build | from conan import ConanFile
from conan.tools.scm import Version
from conan.tools import files
from conan.tools.files import copy
from conan.errors import ConanInvalidConfiguration
from conans import AutoToolsBuildEnvironment
import os
required_conan_version = ">=1.47.0"
class MoldConan(ConanFile):
name = "mold"
... |
1,745 | test glob symlinks | import glob
import os
import shutil
import sys
import unittest
from test.support import (run_unittest, TESTFN, skip_unless_symlink,
can_symlink, create_empty_file)
class GlobTests(unittest.TestCase):
def norm(self, *parts):
return os.path.normpath(os.path.join(self.tempdir, *pa... |
1,746 | test delete clusters | import json
import shutil
from glob import glob
from pathlib import Path
import pytest
from assisted_service_client import PlatformType
from junit_report import JunitTestSuite
from assisted_test_infra.test_infra import ClusterName
from assisted_test_infra.test_infra.helper_classes.cluster import Cluster
from assisted... |
1,747 | on flag take | """
Team Deathmatch game mode.
Options
^^^^^^^
.. code-block:: toml
[tdm]
# Maximum kills to win the game
kill_limit = 100
# How many points you will get by intel capture
intel_points = 10
# Hide intel from the map and disable the captures
remove_intel = false
# Use intel scores as a... |
1,748 | max num favorites | # Copyright (c) 2021 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
# Copyright (c) 2021 Martin Zimandl <martin.zimandl@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as publis... |
1,749 | do validate | # coding=utf-8
#
# This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Most of this work is copyright (C) 2013-2019 David R. MacIver
# (david@drmaciver.com), but it contains contributions by others. See
# CONTRIBUTING.rst for a full list of people who may hold cop... |
1,750 | checkpoint artifact | """catboost init."""
from pathlib import Path
from types import SimpleNamespace
from typing import List, Union
from catboost import CatBoostClassifier, CatBoostRegressor # type: ignore
import wandb
from wandb.sdk.lib import telemetry as wb_telemetry
class WandbCallback:
"""`WandbCallback` automatically integr... |
1,751 | test parse results combined | # Copyright 2015 PerfKitBenchmarker 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... |
1,752 | test too many positional | # 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... |
1,753 | test disallow break in code | """Test suite for testing the ForbiddenPythonSyntaxChecker."""
import astroid
import pylint.testutils
from astroid import nodes
from python_ta.checkers.forbidden_python_syntax_checker import (
ForbiddenPythonSyntaxChecker,
)
class TestForbiddenPythonSyntaxCheckerDisallowedsyntax(pylint.testutils.CheckerTestCase)... |
1,754 | print point values |
# Helium atom with a combination of two orbitals and simple jastrow factor
# Uses automatic differentiation via the autograd package to
# compute spatial and parameter derivatives
import autograd.numpy as np
from autograd import hessian,grad
from stats import averager
from run_qmc import run_qmc
# Point values used... |
1,755 | test configuration valid obs input | import pytest
from pydantic import ValidationError
from ert.analysis import UpdateConfiguration
from ert.analysis.row_scaling import RowScaling
def test_configuration():
config = UpdateConfiguration(
update_steps=[
{
"name": "update_step_name",
"observations": ... |
1,756 | min install resolver | """
resolver configuration to match portage behaviour (misbehaviour in a few spots)
"""
__all__ = ["upgrade_resolver", "min_install_resolver"]
from functools import partial
from itertools import chain
from ..repository import misc, multiplex
from ..resolver import plan
from ..restrictions import packages, values
fro... |
1,757 | test failure state message | import time
from unittest.mock import Mock
import pytest
import remoulade
from remoulade import group
from remoulade.cancel import Cancel
from remoulade.middleware import Middleware, SkipMessage
from remoulade.state.backend import State, StateStatusesEnum
from remoulade.state.backends import PostgresBackend
from remo... |
1,758 | to did | #!/usr/bin/env python3
import re
from typing import Literal, TypedDict
from uuid import UUID
from did_resolver import DIDDocument, DIDResolutionResult, ParsedDID, Resolvable
from shortuuid import ShortUUID
from typing_extensions import NotRequired
from .utils import HASH_LENGTH, hash_func, number_to_version_char, to... |
1,759 | func sort versions | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
1,760 | test eval exception2 | #!/usr/bin/env python
import unittest
import sys
import os
from test import test_support
# Skip this test if the _tkinter module wasn't built.
_tkinter = test_support.import_module('_tkinter')
from Tkinter import Tcl
from _tkinter import TclError
class TkinterTest(unittest.TestCase):
def testFlattenLen(self):... |
1,761 | test samba gupsgen mmu 4 kb | # -*- coding: utf-8 -*-
from sst_unittest import *
from sst_unittest_support import *
################################################################################
# Code to support a single instance module initialize, must be called setUp method
module_init = 0
module_sema = threading.Semaphore()
def initialize... |
1,762 | teardown | # -*- coding: utf-8 -*-
"""
flask.testsuite.ext
~~~~~~~~~~~~~~~~~~~
Tests the extension import thing.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import unittest
try:
from imp import reload as reload_module
except ImportError:
reload... |
1,763 | add mappings | from typing import TYPE_CHECKING, Optional
from ..config import Config
from ..utils import RichStatus
from .ircluster import IRCluster
from .irresource import IRResource
if TYPE_CHECKING:
from .ir import IR # pragma: no cover
class IRTracing(IRResource):
cluster: Optional[IRCluster]
service: str
dr... |
1,764 | l1 | import unittest
import shelve
import glob
from test import support
from collections.abc import MutableMapping
from test.test_dbm import dbm_iterator
def METHOD_NAME(s):
return s.decode("latin-1")
class byteskeydict(MutableMapping):
"Mapping that supports bytes keys"
def __init__(self):
self.d = {... |
1,765 | send imsi detach indication | #!/usr/bin/env python3
"""
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" BAS... |
1,766 | test check incompatible user agent | """Unit test for modules/http_analyzer/http_analyzer.py"""
from tests.module_factory import ModuleFactory
import random
# dummy params used for testing
profileid = 'profile_192.168.1.1'
twid = 'timewindow1'
uid = 'CAeDWs37BipkfP21u8'
timestamp = 1635765895.037696
SAFARI_UA = (
'Mozilla/5.0 (Macintosh; Intel Ma... |
1,767 | bboxes diou | # -*- coding: utf-8 -*-
'''
'''
import torch
import os, sys
from torch.nn import functional as F
import numpy as np
from packaging import version
__all__ = [
"bboxes_iou",
"bboxes_giou",
"bboxes_diou",
"bboxes_ciou",
]
if version.parse(torch.__version__) >= version.parse('1.5.0'):
def _true_di... |
1,768 | test caches | # SPDX-License-Identifier: MIT OR Apache-2.0
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the MIT License. See the LICENSE file in the root of this
# repository for complete details.
import pytest
from structlog import get_config, get_logger, reset_defaults, testing
from str... |
1,769 | write val | from SCons.Defaults import SharedCheck, ProgScan
from SCons.Script.SConscript import SConsEnvironment
def TOOL_BUNDLE(env):
"""defines env.LinkBundle() for linking bundles on Darwin/OSX, and
env.MakeBundle() for installing a bundle into its dir.
A bundle has this structure: (filenames are case SENSITI... |
1,770 | infer | import argparse
import grpc
import inference_pb2
import inference_pb2_grpc
import management_pb2
import management_pb2_grpc
def get_inference_stub():
channel = grpc.insecure_channel("localhost:7070")
stub = inference_pb2_grpc.InferenceAPIsServiceStub(channel)
return stub
def get_management_stub():
... |
1,771 | create unsigned transaction | from functools import (
partial,
)
from typing import (
Tuple,
)
from eth_keys.datatypes import (
PrivateKey,
)
from eth_typing import (
Address,
)
import rlp
from eth._utils.transactions import (
V_OFFSET,
IntrinsicGasSchedule,
calculate_intrinsic_gas,
create_transaction_signature,
... |
1,772 | load detectors | from __future__ import annotations
import logging
from typing import Any, Dict, List, Optional
import yaml
from checkov.common.bridgecrew.platform_integration import bc_integration
from checkov.common.util.file_utils import decompress_file_gzip_base64
def METHOD_NAME() -> list[dict[str, Any]]:
detectors: List[d... |
1,773 | connect | import asyncio
import time
from collections import defaultdict, deque
from robot.api import logger
from robot.api.deco import keyword, library
from gmqtt import Client as MQTTClient, Subscription
from gmqtt.mqtt.constants import MQTTv311
ROBOT_AUTO_KEYWORDS = False
@library
class Client:
"""A keyword library fo... |
1,774 | set safety text | #!/usr/bin/env python
# -*- coding: utf-8 -*-
## Copyright (C) 2021 University of Oxford
##
## This file is part of Cockpit.
##
## Cockpit 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... |
1,775 | convert redd | import pandas as pd
import numpy as np
from copy import deepcopy
from os.path import join, isdir, isfile
from os import listdir
import re
from sys import stdout
from nilmtk.utils import get_datastore
from nilmtk.datastore import Key
from nilmtk.timeframe import TimeFrame
from nilmtk.measurement import LEVEL_NAMES
from ... |
1,776 | test h2 o molden | import pytest
import psi4
import os
from shutil import copytree
from psi4.driver.p4util.testing import compare_strings, compare_values, compare_integers
from psi4.driver.p4util.exceptions import ValidationError
pytestmark = [pytest.mark.psi, pytest.mark.api]
# Checks for
# Molden files are the same as reference
@pyt... |
1,777 | whitespace clean | # -------------------------------------------------------------------------
# MIT License
#
# Copyright (c) 2021 OpenAI
#
# 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, ... |
1,778 | assert gb subject | import pytest
from _ssl import SSLError
from settings import TEST_DATA
from suite.utils.resources_utils import (
create_ingress_from_yaml,
create_secret_from_yaml,
delete_items_from_yaml,
delete_secret,
ensure_connection_to_public_endpoint,
is_secret_present,
replace_secret,
wait_before_... |
1,779 | get treatment for split | """Split evaluator module."""
import logging
from splitio.models.grammar.condition import ConditionType
from splitio.models.impressions import Label
CONTROL = 'control'
_LOGGER = logging.getLogger(__name__)
class Evaluator(object): # pylint: disable=too-few-public-methods
"""Split Evaluator class."""
de... |
1,780 | validate model | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
import copy
import numpy as np
import pytest
import torch
from composer.algorithms import EMA
from composer.algorithms.ema.ema import EMAParameters, compute_ema
from composer.core import Event, Time, Timestamp, TimeUnit
from tests.commo... |
1,781 | on connect | #!/usr/bin/python3
from gi.repository import Gio
LG_DBUS_NAME = "org.Cinnamon.LookingGlass"
LG_DBUS_PATH = "/org/Cinnamon/LookingGlass"
class LookingGlassProxy:
def __init__(self):
self._signals = []
self._status_change_callbacks = []
self._proxy = None
Gio.bus_watch_name(Gio.Bus... |
1,782 | execute and monitor | '''
Created on Jun 16, 2009
@author: meloam
'''
import os
import sys
from types import *
class ProcessMonitor(object):
'''
Lets us fork (and optionally exec) processes, monitoring their exit codes
'''
def __init__(self):
'''
Constructor
'''
self.processList = {}
... |
1,783 | id | # 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... |
1,784 | transform aspect | import logging
from typing import Callable, List, Optional, cast
import datahub.emitter.mce_builder as builder
from datahub.configuration.common import (
KeyValuePattern,
TransformerSemantics,
TransformerSemanticsConfigModel,
)
from datahub.configuration.import_resolver import pydantic_resolve_key
from dat... |
1,785 | process dir | #!/usr/bin/env python3
#
# Copyright 2016 WebAssembly Community Group participants
#
# 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
#
# Unles... |
1,786 | sort assigned attribute values | from typing import TYPE_CHECKING, Iterable, Set, Union
from ..page.models import Page
from ..product.models import Product, ProductVariant
from .models import (
AssignedPageAttribute,
AssignedPageAttributeValue,
AssignedProductAttribute,
AssignedProductAttributeValue,
AssignedVariantAttribute,
... |
1,787 | test bad user agent | ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
1,788 | test command by user ids | """
Unittests for populate_created_on_site_user_attribute management command.
"""
from unittest import mock
import ddt
import pytest
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth-user
from django.core.management import CommandError, call_command
from django.test import Te... |
1,789 | real extract | # coding: utf-8
from __future__ import unicode_literals
import random
import string
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
determine_ext,
int_or_none,
js_to_json,
ExtractorError,
urlencode_postdata
)
class FunimationIE(InfoExtractor):
_V... |
1,790 | fetch | import requests
from waste_collection_schedule import Collection # type: ignore[attr-defined]
from bs4 import BeautifulSoup, NavigableString
import datetime
TITLE = "Armadale (Western Australia)"
DESCRIPTION = "Source for Armadale (Western Australia)."
URL = "https://www.armadale.wa.gov.au"
TEST_CASES = {
"23 Se... |
1,791 | average multiclass ovo score | # Copyright 1999-2022 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
1,792 | test cleanup | from collections import defaultdict
from datetime import timedelta
from ichnaea.data.tasks import cleanup_datamap, update_datamap
from ichnaea.models.content import DataMap, encode_datamap_grid
from ichnaea import util
class TestDataMapCleaner(object):
@property
def today(self):
return util.utcnow().... |
1,793 | get login url | # Copyright (c) 2018 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
# Copyright (c) 2018 Tomas Machalek <tomas.machalek@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as publis... |
1,794 | has verbosity | # 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... |
1,795 | test styles inlining | from unittest.mock import patch
from django.conf import settings
from django.contrib.sites.models import Site
from django.utils.functional import lazy
from django.utils.translation import get_language
from kitsune.sumo.email_utils import emails_with_users_and_watches, safe_translation
from kitsune.sumo.tests import T... |
1,796 | delete files and dir | #!/usr/bin/env python
#
# Copyright 2008, Google 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... |
1,797 | mock check task start | import asyncio
import itertools
import random
import time
from avocado.utils.astring import tabular_output
DEBUG = False
def debug(msg):
if DEBUG:
print(msg)
async def sleep_random():
await asyncio.sleep(random.random())
def true_or_false(handicap=3):
"""Returns a random positive or negative... |
1,798 | test shader include fail | """
Low level tests for OpenGL 3.3 wrappers.
"""
import pytest
from pyglet.math import Mat4
def test_ctx(ctx):
if ctx.gl_api == "gl":
assert ctx.gl_version >= (3, 3)
elif ctx.gl_api == "gles":
assert ctx.gl_version >= (3, 1)
else:
raise ValueError(f"Unsupported api: {ctx.gl_api}")
... |
1,799 | act | #!/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.
"""
Teachers that wrap around other teachers, for instance, to modify message fields while
keeping the examples/episodes ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.