id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
8,800 | set requires grad | """
Part of the implementation is borrowed and modified from LaMa, publicly available at
https://github.com/saic-mdal/lama
"""
import bisect
import torch
import torch.nn.functional as F
from modelscope.utils.logger import get_logger
from .base import BaseInpaintingTrainingModule
from .modules.feature_matching import ... |
8,801 | test add asset metadata descriptor | from tests.base import ApiDBTestCase
from zou.app.services import projects_service
class ProjectMetadataRouteTestCase(ApiDBTestCase):
def setUp(self):
super(ProjectMetadataRouteTestCase, self).setUp()
self.generate_fixture_project_status()
self.generate_fixture_project_closed_status()
... |
8,802 | wake | import copy
import dataclasses
from typing import TYPE_CHECKING, Any, List, Optional, Type, cast
import click
import fmf
import tmt
import tmt.steps
from tmt.options import option
from tmt.plugins import PluginRegistry
from tmt.steps import (
Action,
Method,
PhaseQueue,
PullTask,
QueuedPhase,
... |
8,803 | debug | # This is a component of LinuxCNC
# Copyright 2011, 2013, 2014 Dewey Garrett <dgarrett@panix.com>,
# Michael Haberler <git@mah.priv.at>
#
# 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 Foundati... |
8,804 | system data | # 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... |
8,805 | read novel info | # -*- coding: utf-8 -*-
import logging
from bs4 import Tag
from lncrawl.core.crawler import Crawler
import urllib.parse
import requests
from bs4 import BeautifulSoup
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:101.0) Gecko/20100101 Firefox/101.0",
"Accept": "text/html,application/x... |
8,806 | update quickhelp | # 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... |
8,807 | lookup function generator | """
Greynir: Natural language processing for Icelandic
Number parsing grammar.
Copyright (C) 2023 Miðeind ehf.
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, eith... |
8,808 | set up | # (C) Copyright 2004-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... |
8,809 | retranslate ui | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mslib/msui/ui/ui_satellite_dockwidget.ui'
#
# Created by: PyQt5 UI code generator 5.12.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_SatelliteDockWidget(object):
def se... |
8,810 | tags | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
8,811 | squad train examples | import pytest
import torch
from datasets import Dataset, load_dataset
from transformers import AutoConfig, AutoModel, AutoTokenizer
from primeqa.mrc.models.heads.extractive import EXTRACTIVE_HEAD
from primeqa.mrc.models.task_model import ModelForDownstreamTasks
from primeqa.mrc.processors.preprocessors.base import Bas... |
8,812 | test add cluster naturalgas bus links | 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... |
8,813 | ispercolating | import logging
import numpy as np
import scipy.sparse as sprs
from scipy.sparse import csgraph
from openpnm.utils import PrintableDict, Workspace
from openpnm._skgraph import simulations
from openpnm._skgraph import queries
from collections import namedtuple
logger = logging.getLogger(__name__)
ws = Workspace()
__all... |
8,814 | generate | """ msginit tool
Tool specific initialization of msginit tool.
"""
# __COPYRIGHT__
#
# 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 th... |
8,815 | assert built array | # Copyright Iris contributors
#
# This file is part of Iris 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.fileformats._structured_array_identification.GroupStructure` class.
"""
# Import iris.tests... |
8,816 | conveyor distance | import math
import time
from abc import ABCMeta, abstractmethod
import quaternion
import arcor2.transformations as tr
from arcor2.data.common import Joint, Orientation, Pose, StrEnum
from arcor2.exceptions import Arcor2NotImplemented
from arcor2.helpers import NonBlockingLock
from arcor2.object_types.abstract import ... |
8,817 | enable ports | """
This module contains the workflows for installing and configuring WARP - Cloud
Object Storage Benchmark tool on the provided nodes. It supports
- deploying WARP on the provided systems
- Configuring WARP clients on the given nodes
Sample test script
- test:
abort-on-fail: true
config:... |
8,818 | get function | import numpy as nm
from sfepy.terms.terms_multilinear import ETermBase
class MassTerm(ETermBase):
r"""
Mass term with lumping and RMM support [1]_.
The lumping parameter can be 'row_sum', 'hrz' or 'none' (default). It
applies for :math:`\beta` > 0:
- :math:`\beta` = 0 correponds to the consisten... |
8,819 | get frame fn | #!/usr/bin/env python3
import os
import sys
import bz2
import numpy as np
import pyopencl as cl # install with `PYOPENCL_CL_PRETEND_VERSION=2.0 pip install pyopencl`
from system.hardware import PC, TICI
from common.basedir import BASEDIR
from selfdrive.test.openpilotci import BASE_URL, get_url
from system.version im... |
8,820 | close tasks | """
Socket server forwarding request to internal server
"""
import logging
import asyncio
from typing import Optional
from ..common.connection import TransportLimits
from ..ua.ua_binary import header_from_binary
from ..common.utils import Buffer, NotEnoughData
from .uaprocessor import UaProcessor
from .internal_server... |
8,821 | set children | import sys
from ._nexml import MixedContainer, FloatTree, TreeFloatEdge, TreeNode, LiteralMeta
from .. import PhyloTree
from ..phylo.phylotree import _parse_species
from ..parser.newick import loads
class Children(list):
def append(self, item):
list.append(self, item)
item.nexml_edge.source = self.... |
8,822 | attach signal1 | #!/usr/bin/env python
#
# Copyright 2011,2012,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, filter
from gnuradio import blocks
import sys
try:
from gnuradio import qtgui
from PyQt5 import QtWidgets, Qt
impo... |
8,823 | rand bboxes | import os
from unittest import TestCase
import cv2
import numpy as np
import torch
from mmengine.structures import InstanceData, PixelData
from mmdet.evaluation import INSTANCE_OFFSET
from mmdet.structures import DetDataSample
from mmdet.visualization import DetLocalVisualizer, TrackLocalVisualizer
def METHOD_NAME(... |
8,824 | fmt ret type | from __future__ import absolute_import, print_function
from .Visitor import CythonTransform
from .StringEncoding import EncodedString
from . import Options
from . import PyrexTypes, ExprNodes
from ..CodeWriter import ExpressionWriter
class AnnotationWriter(ExpressionWriter):
def visit_Node(self, node):
... |
8,825 | listmailcapfiles | """Mailcap file handling. See RFC 1524."""
import os
__all__ = ["getcaps","findmatch"]
# Part 1: top-level interface.
def getcaps():
"""Return a dictionary containing the mailcap database.
The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain')
to a list of dictionaries corresponding to ... |
8,826 | test activate | # Standard Library
from dataclasses import dataclass, replace
# Third-party
import pytest
# Sematic
from sematic.function import func
from sematic.plugins.abstract_external_resource import (
AbstractExternalResource,
IllegalStateTransitionError,
ManagedBy,
ResourceState,
ResourceStatus,
)
from sem... |
8,827 | visit call | # You can find documentation about adding new checker here:
# http://pylint.pycqa.org/en/latest/how_tos/custom_checkers.html#write-a-checker
"""
#### How to add a new check?
1. Chose the lowest support level that the checker should check.
2. Add a new checker in the `<support>_level_checker.py` file.
1. Add a new ... |
8,828 | test when not testing and successful unchanged | """
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
import pytest
import salt.modules.chef
import salt.states.chef as chef
from tests.support.mock import MagicMock, create_autospec, patch
@pytest.fixture
def configure_loader_modules():
return {chef: {"__salt__": {}}}
@pytest.fixture(
params=[
... |
8,829 | import task choice event | # This file is part of beets.
# Copyright 2016, Blemjhoo Tezoulbr <baobab@heresiarch.info>.
#
# 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 limitati... |
8,830 | ipython key completions | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import collections
from collections import OrderedDict
from operator import index as operator_index
import numpy as np
class Row:
"""A class to represent one row of a Table object.
A Row object is returned when a Table object is indexed with a... |
8,831 | merge | # Copyright (c) Alibaba, Inc. and its affiliates.
import importlib
from typing import Dict, List, Union
from pandas import DataFrame
from modelscope.metainfo import Metrics
from modelscope.metrics.base import Metric
from modelscope.metrics.builder import METRICS, MetricKeys
from modelscope.models.nlp.unite.configura... |
8,832 | get values | import numpy as np
import random
import os
from functools import lru_cache
from pathlib import Path
# Various pre-crafted datasets/variables for testing
# !!! Must not be changed -- only appended !!!
# while testing numpy we better not rely on numpy to produce random
# sequences
random.seed(1)
# but will seed it never... |
8,833 | validate img extension | """
Copyright 2016, 2017 UFPE - Universidade Federal de Pernambuco
Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS
O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela ... |
8,834 | stail q hea d initializer | # Generated by h2py from /usr/include/netinet/in.h
IPPROTO_IP = 0
IPPROTO_HOPOPTS = 0
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
IPPROTO_GGP = 3
IPPROTO_IPV4 = 4
IPPROTO_IPIP = IPPROTO_IPV4
IPPROTO_TCP = 6
IPPROTO_ST = 7
IPPROTO_EGP = 8
IPPROTO_PIGP = 9
IPPROTO_RCCMON = 10
IPPROTO_NVPII = 11
IPPROTO_PUP = 12
IPPROTO_ARGUS = 13
... |
8,835 | add instructions | #!/usr/bin/env python
# Author: Kwasi Mensah (kmensah@andrew.cmu.edu)
# Date: 7/25/2005
from direct.showbase.ShowBase import ShowBase
from panda3d.core import Filename, Shader
from panda3d.core import PandaNode, NodePath
from panda3d.core import ColorBlendAttrib
from panda3d.core import AmbientLight, DirectionalLight... |
8,836 | get cached dependency graph | from typing import Optional, Hashable, TypeVar, Generic, Iterator, Tuple, Set
from robotframework_ls.impl.protocols import (
IRobotDocument,
ICompletionContextWorkspaceCaches,
ICompletionContextDependencyGraph,
IOnDependencyChanged,
)
from robocorp_ls_core import uris
from collections import OrderedDict... |
8,837 | test submodels | import unittest
import pytest
from mopidy.models import ImmutableObject
class Model(ImmutableObject):
uri = None
name = None
models = frozenset()
def __init__(self, *args, **kwargs):
self.__dict__["models"] = frozenset(kwargs.pop("models", None) or [])
super().__init__(self, *args, ... |
8,838 | has hook events | import logging
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.serializers import ValidationError
from sentry import analytics, features
from sentry.api.api_owners import ApiOwner
from sentry.api.api_publish_status import ApiPublishStatus
from sentry.api.bas... |
8,839 | test internal server error raised for invalid | # -*- coding: utf-8 -*-
import unittest
import uuid
import pytest
from azure.cosmos.http_constants import HttpHeaders
import azure.cosmos.cosmos_client as cosmos_client
from azure.cosmos import PartitionKey
import test_config
import azure.cosmos.exceptions as exceptions
from azure.cosmos.http_constants import StatusCo... |
8,840 | lfortran zsqrt | from lpython import c64, ccall, f64, overload, c32, f32
pi: f64 = 3.141592653589793238462643383279502884197
e: f64 = 2.718281828459045235360287471352662497757
tau: f64 = 6.283185307179586
@ccall
def _lfortran_zexp(x: c64) -> c64:
pass
@ccall
def _lfortran_cexp(x: c32) -> c32:
pass
@overload
def exp(x: c64)... |
8,841 | update plugin license | # coding=utf-8
import logging
from .rest_client import AtlassianRestAPI
log = logging.getLogger(__name__)
class Crowd(AtlassianRestAPI):
"""Crowd API wrapper.
Important to note that you will have to use an application credentials,
not user credentials, in order to access Crowd APIs"""
def __init__(... |
8,842 | exit | """
Core components for event-discrete simulation environments.
"""
import types
from heapq import heappush, heappop
from itertools import count
from simpy.events import (AllOf, AnyOf, Event, Process, Timeout, URGENT,
NORMAL)
Infinity = float('inf') #: Convenience alias for infinity
cla... |
8,843 | test constant depth deeper than tidal amplitude | #!/usr/bin/env python3
"""
Created on Sun Jul 12 10:22:59 2020
@author: gtucker
"""
import numpy as np
from numpy.testing import (
assert_array_almost_equal,
assert_array_equal,
assert_equal,
assert_raises,
)
from landlab import HexModelGrid, RadialModelGrid, RasterModelGrid
from landlab.components i... |
8,844 | pre operations | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
8,845 | notify low stock if required | """Background task definitions for the 'part' app"""
import logging
import random
import time
from datetime import datetime, timedelta
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
import common.models
import common.notifications
import common.settings
imp... |
8,846 | get toplevel path | import os
import itertools
import re
import logging
import subprocess
import typing
Line = typing.NamedTuple(
"Line",
[("sourcefile", str), ("number", int), ("text", str), ("added", bool)],
)
FileLines = typing.NamedTuple(
"FileLines",
[("filename", str), ("lines", typing.Sequence[typing.Tuple[int, in... |
8,847 | format record | #
# 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 us... |
8,848 | purge resources | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import asyncio
from dotenv import load_dotenv
import os
from azure.identity.aio import ClientSecretCredential
from azure.keyvault.certificates.aio import CertificateCli... |
8,849 | is transparent | # This file is part of the MapProxy project.
# Copyright (C) 2010 Omniscale <http://omniscale.de>
#
# 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... |
8,850 | escape value | # Copyright 2015-2016 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
8,851 | get object 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... |
8,852 | qpt | __all__ = ['qpt_plot', 'qpt_plot_combined', 'qpt']
from numpy import hstack, real, imag
import scipy.linalg as la
from . import tensor, spre, spost, stack_columns, unstack_columns
from .visualization import matrix_histogram
import itertools
try:
import matplotlib.pyplot as plt
except:
pass
def _index_permut... |
8,853 | test plane | # Copyright (C) 2022 Open Source Robotics 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
# Unless required by applicable law or ... |
8,854 | convert lookup tables to regex | import re
from typing import Dict, List, Text, Union
import rasa.shared.utils.io
from rasa.shared.nlu.training_data.training_data import TrainingData
from rasa.shared.exceptions import InvalidConfigException
def METHOD_NAME(
training_data: TrainingData,
use_only_entities: bool = False,
use_word_boundarie... |
8,855 | test raise error unknown str in col | # Copyright 2020 The AutoKeras 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 i... |
8,856 | pystones | #! /usr/bin/env python
"""
"PYSTONE" Benchmark Program
Version: Python/1.1 (corresponds to C/1.1 plus 2 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.
Every method to preserve ADA-likeness h... |
8,857 | lui | # Ref: MIPS® Architecture for Programmers Volume II-A: The MIPS32® Instruction Set Manual
# Document Number: MD00086 Revision 6.05
# Accession: G00021
__all__ = [
# R-format
"SLL", "SRL", "SRA", "JR", "JALR", "MFHI", "MTHI", "MFLO", "MTLO", "DIV", "DIVU", "MULT",
"MULTU", "ADD", "ADDU", "SUB", "SUBU", "AND... |
8,858 | separator | """Waste Collection Schedule Component."""
import logging
import site
from pathlib import Path
from random import randrange
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util
import voluptuous as vol
from homeassistant.core import HomeAssistant, ServiceCall, callback
from home... |
8,859 | pearson and spearman | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... |
8,860 | header parameters | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
8,861 | change process gid | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2012-present MagicStack Inc. and the EdgeDB 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... |
8,862 | add tip | from typing import Dict, Optional
from typing_extensions import Protocol
from opentrons_shared_data.pipette.dev_types import PipetteName
from opentrons.types import Mount
# TODO (lc 12-05-2022) This protocol has deviated from the OT3 api. We
# need to figure out how to combine them again in follow-up refactors.
from ... |
8,863 | qload | __all__ = ['file_data_store', 'file_data_read', 'qsave', 'qload']
import pickle
import numpy as np
import sys
from .core import Qobj
from pathlib import Path
# -----------------------------------------------------------------------------
# Write matrix data to a file
#
def file_data_store(filename, data, numtype="co... |
8,864 | serial write | import os
import sys
import time
try:
from testtools.UART_interface.base_uart_interface import uart_interface
import testtools.UART_interface.azure_test_firmware_errors as azure_test_firmware_errors
import testtools.UART_interface.serial_settings as serial_settings
import testtools.UART_interface.seria... |
8,865 | test get gift cards payment amount equal | from datetime import datetime
from decimal import Decimal
from unittest.mock import Mock, patch
import pytz
from prices import Money
from ....giftcard.events import gift_cards_used_in_order_event
from ....giftcard.models import GiftCard
from ..utils import (
chunk_products,
generate_invoice_number,
genera... |
8,866 | prepare invoice | # Copyright 2020 KMEE INFORMATICA LTDA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ContractContract(models.Model):
_name = "contract.contract"
_inherit = [_name, "l10n_br_fiscal.document.mixin"]
currency_id = fields.Many2one(
readonl... |
8,867 | test create order override amount ignore | import json
from app.api.helpers.db import get_or_create
from app.models.order import Order
from app.models.role import Role
from app.models.ticket_holder import TicketHolder
from app.models.users_events_role import UsersEventsRoles
from tests.factories.attendee import AttendeeFactoryBase
from tests.factories.discount... |
8,868 | conditional | # -*- coding: utf-8 -*-
from itertools import chain
from ufl.corealg.traversal import traverse_unique_terminals
from ufl.corealg.multifunction import MultiFunction
from ufl.corealg.map_dag import map_expr_dag
from ufl.classes import Argument, Zero
class ArityMismatch(BaseException):
pass
# String representat... |
8,869 | set read only | # coding: utf-8
# /*##########################################################################
#
# Copyright (C) 2016-2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... |
8,870 | test tail filter diff goes negative | import pytest
from datapublic.common_fields import CommonFields
from libs.datasets.taglib import TagType
from libs.datasets.tail_filter import TailFilter
from tests import test_helpers
def _assert_tail_filter_counts(
tail_filter: TailFilter,
*,
skipped_too_short: int = 0,
skipped_na_mean: int = 0,
... |
8,871 | test create stage out command options no | from __future__ import (print_function, division)
import unittest
import os
from mock import mock
from WMCore.Storage.Backends.XRDCPImpl import XRDCPImpl
class XRDCPImplTest(unittest.TestCase):
def setUp(self):
self.XRDCPImpl = XRDCPImpl()
def testCreateSourceName_simple(self):
self.assertE... |
8,872 | 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... |
8,873 | set up | #!/usr/bin/env python
import logging
import re
from tests.utils import get_config_file_path, create_client, is_enterprise
from tests.utils.server_manager import ServerManager
import distutils.spawn
class HvacIntegrationTestCase:
"""Base class intended to be used by all hvac integration test cases."""
manage... |
8,874 | build arguments schema | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
8,875 | 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
# --------------------------------... |
8,876 | release | #!/usr/bin/python
##################
# TiffDataSource.py
#
# Copyright David Baddeley, 2009
# d.baddeley@auckland.ac.nz
#
# 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... |
8,877 | test lender has negative balance | # These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/rest-api/canonical-data.json
# File last updated on 2023-07-19
import json
import unittest
from rest_api import (
RestAPI,
)
class RestApiTest(unittest.TestCase):
def test_no_users(... |
8,878 | compute n step sequence targets | # Copyright 2018 DeepMind Technologies Limited. 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 ... |
8,879 | pretty text | from decorator import decorator
from datetime import datetime
import json
import re
import os.path
from textwrap import wrap
import pendulum
from main import db, external_url
from flask import session, abort, current_app as app
from markupsafe import Markup
from flask.json import jsonify
from flask_login import login_... |
8,880 | authenticated only | # -*- coding: utf-8 -*-
#
# This file is part of EUDAT B2Share.
# Copyright (C) 2015, 2016, University of Tuebingen, CERN.
#
# B2Share 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
# ... |
8,881 | get next | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... |
8,882 | test issue775 | import pytest
@pytest.mark.issue(351)
def test_issue351(en_tokenizer):
doc = en_tokenizer(" This is a cat.")
assert doc[0].idx == 0
assert len(doc[0]) == 3
assert doc[1].idx == 3
@pytest.mark.issue(360)
def test_issue360(en_tokenizer):
"""Test tokenization of big ellipsis"""
tokens = en_to... |
8,883 | test suspicious keyword with secret | import unittest
from pathlib import Path
from checkov.secrets.plugins.entropy_keyword_combinator import EntropyKeywordCombinator
class TestCombinatorPlugin(unittest.TestCase):
def setUp(self) -> None:
self.plugin = EntropyKeywordCombinator()
def test_positive_value(self):
result = self.plugi... |
8,884 | check | from kitsune.kbforums.events import NewPostEvent, NewThreadEvent
from kitsune.kbforums.models import Thread
from kitsune.kbforums.tests import KBForumTestCase, ThreadFactory
from kitsune.sumo.tests import get, post
from kitsune.users.tests import UserFactory, add_permission
from kitsune.wiki.tests import ApprovedRevisi... |
8,885 | repr deque | """Redo the builtin repr() (representation) but with limits on most sizes."""
__all__ = ["Repr", "repr", "recursive_repr"]
import builtins
from itertools import islice
from _thread import get_ident
def recursive_repr(fillvalue='...'):
'Decorator to make a repr function return fillvalue for a recursive call'
... |
8,886 | test isometry tolerance | # This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
8,887 | save enrichment | # type_audiovideocast.py
import threading
import logging
import datetime
import zipfile
import os
from xml.dom import minidom
from django.conf import settings
from django.template.defaultfilters import slugify
from django.core.files.base import ContentFile
from pod.video.models import Video
from pod.video_encode_tran... |
8,888 | test only completions that start with word | #############################################################################
# Copyright (c) 2015-2016 Balabit
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published
# by the Free Software Foundation, or (at your option) an... |
8,889 | prepare pothole | import argparse
import os
import shutil
import requests
def get_root_dir(output_dir=None, new_folder_name=None):
if not output_dir:
root_dir = "./"
elif os.path.isdir(output_dir):
if new_folder_name:
root_dir = os.path.join(output_dir, new_folder_name)
if not os.path.e... |
8,890 | update | from toga_iOS.libs import (
NSLayoutAttributeBottom,
NSLayoutAttributeLeft,
NSLayoutAttributeRight,
NSLayoutAttributeTop,
NSLayoutConstraint,
NSLayoutRelationEqual,
)
class Constraints:
def __init__(self, widget):
"""A wrapper object storing the constraints required to position a w... |
8,891 | build mapping | # Copyright 2022 The KerasCV 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 ... |
8,892 | test check regression multi | import os
import tempfile
import unittest
from unittest.mock import mock_open, patch
import buildreq
import check
import config
import tarball
def mock_generator(rv=None):
def mock_f(*args, **kwargs):
return rv
return mock_f
class TestTest(unittest.TestCase):
backup_isfile = check.os.path.isfil... |
8,893 | on thread start | # coding: utf-8
#
# Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com>
# Copyright 2012 Google, Inc & contributors.
# Copyright 2014 Thomas Amland
#
# 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 ... |
8,894 | test empty string wrong password | # 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... |
8,895 | test addresses to placement group info | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
8,896 | test lifetime items iter | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
# @author Simon Heybrock
"""This file contains tests specific to pybind11 lifetime issues, in particular
py::return_value_policy and py::keep_alive."""
import numpy as np
import pytest
import scipp as sc
def t... |
8,897 | get dbinfo | #!/usr/bin/env python
from __future__ import print_function
MODDOC = """
=== Epics Scanning Functions for Larch ===
This does not used the Epics SScan Record, and the scan is intended to run
as a python application, but many concepts from the Epics SScan Record are
borrowed. Where appropriate, the difference will b... |
8,898 | solutions | # 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__ ... |
8,899 | eval examples and features | import os
import tempfile
from datasets import Dataset
from torch.utils.data import ConcatDataset
import pytest
from transformers import TrainingArguments, DataCollatorWithPadding
from primeqa.mrc.trainers.mrc_mskd import MSKD_MRCTrainer
from primeqa.mrc.models.heads.extractive import EXTRACTIVE_HEAD
from tests.prim... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.