id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
2,200 | test kill job | #!/bin/env python
"""
tests for HTCondorCEComputingElement module
"""
import uuid
import pytest
from DIRAC.Resources.Computing import HTCondorCEComputingElement as HTCE
from DIRAC.Resources.Computing.BatchSystems import Condor
from DIRAC import S_OK
MODNAME = "DIRAC.Resources.Computing.HTCondorCEComputingElement"
ST... |
2,201 | resolve definition | """Core utilities and constants."""
import inspect
import os
import re
from typing import Optional, Tuple
from ..cache.base import BaseCache
from ..core.profile import Profile
from ..messaging.agent_message import AgentMessage
from ..utils.classloader import ClassLoader
from .error import ProtocolMinorVersionNotSup... |
2,202 | set up | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2018 Satpy developers
#
# This file is part of satpy.
#
# satpy 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... |
2,203 | set visibility | from collections import OrderedDict
from typing import Iterable, TYPE_CHECKING, Callable, List, Tuple, Dict, Union, TypeVar, Any
from gi.repository import Gio, GLib, Pango
from blueman.main.DbusService import DbusService
from blueman.main.Tray import BluemanTray
from blueman.main.indicators.IndicatorInterface import ... |
2,204 | serialization type | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import log... |
2,205 | test apply | # This file is part of the pyMOR project (https://www.pymor.org).
# Copyright pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
import numpy as np
import pytest
import scipy.linalg as spla
from pymor.operators.block import BlockDiago... |
2,206 | fitheight | '''
Character width dictionary and convenience functions for column sizing
with xlwt when Arial 10 is the standard font. Widths were determined
experimentally using Excel 2000 on Windows XP. I have no idea how well
these will work on other setups. For example, I don't know if system
video settings will affect the re... |
2,207 | test single channel pass default when max | from random import randrange
from pubnub.pubnub import PubNub
from tests.helper import pnconf_file_copy
pubnub = PubNub(pnconf_file_copy())
MAX_FOR_FETCH_MESSAGES = 100
MULTIPLE_CHANNELS_MAX_FOR_FETCH_MESSAGES = 25
MAX_FOR_FETCH_MESSAGES_WITH_ACTIONS = 25
EXPECTED_SINGLE_CHANNEL_DEFAULT_MESSAGES = 100
EXPECTED_MULTI... |
2,208 | test dot stim | from psychopy import visual, event, info
import pytest
import numpy as np
import shutil, os
from tempfile import mkdtemp
from psychopy.tests import utils
# Testing for memory leaks in PsychoPy classes (experiment run-time, not Builder, Coder, etc)
# The tests are too unstable to include in travis-ci at this point.
... |
2,209 | test download cache | import os
from pathlib import Path
import pytest
from sunpy.data.data_manager.tests.mocks import MOCK_HASH, write_to_test_file
from sunpy.util.exceptions import SunpyUserWarning
def test_basic(storage, downloader, data_function):
data_function()
assert downloader.times_called == 1
assert len(storage._s... |
2,210 | test dynamic field | import logging
import os
from django.core import management
from django.test import TestCase, override_settings
from django.forms import ValidationError
from django.core.files import File
from django.urls import reverse
from biostar.recipes import models, views, auth, factory, forms, const, api
from biostar.recipes imp... |
2,211 | fixture connection settings service | """Test Network Manager Connection object."""
from dbus_fast.aio.message_bus import MessageBus
from dbus_fast.signature import Variant
import pytest
from supervisor.dbus.network.interface import NetworkInterface
from supervisor.dbus.network.setting import NetworkSetting
from supervisor.dbus.network.setting.generate i... |
2,212 | perform mutation | from typing import Iterable
import graphene
from django.core.exceptions import ValidationError
from django.db import transaction
from ....core.tracing import traced_atomic_transaction
from ....core.utils.promo_code import generate_promo_code
from ....core.utils.validators import is_date_in_future
from ....giftcard im... |
2,213 | test get data no data | # (C) Copyright 2005-2021 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... |
2,214 | get tags | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Supports git repositories for the benchmarked project.
"""
import os
import re
import shlex
from ..console import log
from ..repo import Repo, NoSuchNameError
from .. import util
class Git(Repo):
dvcs = "git"
def __init__(self, url, mirro... |
2,215 | uninstall addon | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
2,216 | get optimized locs | # Copyright 2022 NREL
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distri... |
2,217 | send | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import json
import threading
import time
from abc import ABC, abstractmethod
from queue import Empty, Queue
from .log_utils import LogType, nni_log
from .commands import CommandType
INTERVAL_SECONDS = 0.5
class BaseChannel(ABC):
def __ini... |
2,218 | load seccomp | # This file is part of BenchExec, a framework for reliable benchmarking:
# https://github.com/sosy-lab/benchexec
#
# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org>
#
# SPDX-License-Identifier: Apache-2.0
"""Utility functions adding a seccomp filter."""
import ctypes
from ctypes import c_int, ... |
2,219 | random movie | import logging
import random
from discord import Embed
from discord.ext import commands
from bot.bot import Bot
from bot.constants import Colours, NEGATIVE_REPLIES, Tokens
log = logging.getLogger(__name__)
class ScaryMovie(commands.Cog):
"""Selects a random scary movie and embeds info into Discord chat."""
... |
2,220 | link | # 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... |
2,221 | norm | """tensorflow.compat.v1 backend implementation"""
from packaging.version import Version
import tensorflow.compat.v1 as tf
if Version(tf.__version__) < Version("2.7.0"):
raise RuntimeError("DeepXDE requires TensorFlow>=2.7.0.")
# The major changes from TensorFlow 1.x to TensorFlow 2.x are:
# 1. Eager execution:... |
2,222 | is from local | import inspect
from typing import Dict, List
import torch
from .. import variables
from ..exc import unimplemented
from ..utils import istype
from .base import VariableTracker
from .constant import ConstantVariable
class DistributedVariable(VariableTracker):
def __init__(self, **kwargs):
super().__init__... |
2,223 | str see also | import re, inspect, textwrap, pydoc
from docscrape import NumpyDocString, FunctionDoc, ClassDoc
class SphinxDocString(NumpyDocString):
# string conversion routines
def _str_header(self, name, symbol='`'):
return ['.. rubric:: ' + name, '']
def _str_field_list(self, name):
return [':' + nam... |
2,224 | wait for | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
import socket
import ssl
import struct
import time
import aioquic.quic.configuration # type: ignore
import aioquic.quic.connection # type: ignore
import aioquic.quic.events # type: ignore
import trio
import dns.exception
import dns.inet
f... |
2,225 | api member name | # Copyright (C) 2022 CVAT.ai Corporation
#
# SPDX-License-Identifier: MIT
from __future__ import annotations
import json
from abc import ABC
from copy import deepcopy
from typing import (
TYPE_CHECKING,
Any,
Dict,
Generic,
List,
Literal,
Optional,
Tuple,
Type,
TypeVar,
Unio... |
2,226 | test group mirror | #!/usr/bin/env python
#
#
from qautils.gppylib.testold.testDriver import TestDriver
from qautils.gppylib.programs.clsAddMirrors import *
from qautils.gppylib.operations.buildMirrorSegments import *
from qautils.gppylib.mainUtils import *
from qautils.gppylib.testold.testUtils import *
from qautils.gppylib.system import... |
2,227 | parse edge key | import time
from signal import pause
import logging
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
logger = logging.getLogger(__name__)
map_edge_parse = {'falling':GPIO.FALLING, 'rising':GPIO.RISING, 'both':GPIO.BOTH}
map_pull_parse = {'pull_up':GPIO.PUD_UP, 'pull_down':GPIO.PUD_DOWN, 'pull_off':GPIO.PUD_OFF}
map_edg... |
2,228 | process | # This file is part of Indico.
# Copyright (C) 2002 - 2023 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from contextlib import ExitStack
from flask import flash, redirect, request, session
from werkzeug.except... |
2,229 | add trigger | import inspect
from ..hdl import *
from ..hdl.ast import Statement, SignalSet
from .core import Tick, Settle, Delay, Passive, Active
from ._base import BaseProcess
from ._pyrtl import _ValueCompiler, _RHSValueCompiler, _StatementCompiler
__all__ = ["PyCoroProcess"]
class PyCoroProcess(BaseProcess):
def __init_... |
2,230 | write table | # Copyright (c) 2021, 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 copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
2,231 | connect indicators dimension names | from typing import Iterable
from akvo.rsr.models import (
Project, DefaultPeriod, Result, IndicatorDimensionName, IndicatorDimensionValue,
Indicator, IndicatorReference, IndicatorPeriod
)
def add_new_project_to_program(project: Project, program: Project):
"""
This function assumes that the project is ... |
2,232 | custom manylinux platforms | """Generate and work with PEP 425 Compatibility Tags.
"""
import re
from typing import List, Optional, Tuple
from pip._vendor.packaging.tags import (
PythonVersion,
Tag,
compatible_tags,
cpython_tags,
generic_tags,
interpreter_name,
interpreter_version,
mac_platforms,
)
_osx_arch_pat ... |
2,233 | container count | # 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,234 | normalize prefix or 404 | # -*- coding: utf-8 -*-
"""Utility functions for the Bioregistry :mod:`flask` app."""
import json
from functools import partial
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple
import yaml
from flask import (
Response,
abort,
current_app,
redirect,
render_template,... |
2,235 | fcn | from iminuit._core import (
FCN,
MnUserParameterState,
MnUserTransformation,
MnMigrad,
MnStrategy,
MnScan,
FunctionMinimum,
MnSimplex,
MnPrint,
MnUserCovariance,
MinimumState,
)
from pytest import approx
import pytest
import pickle
import numpy as np
@pytest.fixture
def deb... |
2,236 | test parallel optimization without grad | import logging
import unittest
from monty.tempfile import ScratchDir
import numpy as np
try:
from mpi4py import MPI
except:
MPI = None
from simsopt._core.optimizable import Optimizable
from simsopt.objectives.functions import Beale
from simsopt.objectives.least_squares import LeastSquaresProblem
if MPI is not... |
2,237 | register repo kind | #
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed ... |
2,238 | normalize sample format | from datetime import datetime
from typing import Any, Mapping, Optional
from uuid import UUID
from snuba import environment
from snuba.consumers.types import KafkaMessageMetadata
from snuba.datasets.events_format import EventTooOld, enforce_retention
from snuba.datasets.processors import DatasetMessageProcessor
from s... |
2,239 | mutate params | """Quantile Random Forest Regression model from skgarden"""
import datatable as dt
import numpy as np
from h2oaicore.models import CustomModel
from h2oaicore.systemutils import physical_cores_count
class RandomForestQuantileModel(CustomModel):
_regression = True
_binary = False
_multiclass = False
_a... |
2,240 | signextend | """
Ethereum Virtual Machine (EVM) Arithmetic Instructions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. contents:: Table of Contents
:backlinks: none
:local:
Introduction
------------
Implementations of the EVM Arithmetic instructions.
"""
from ethereum.base_types import U255_CEIL_VALUE, U256, ... |
2,241 | download | #
# Copyright 2019 The FATE 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,242 | target overloaded calls target overloaded | from numba import cuda, njit
from numba.core.extending import overload
from numba.cuda.testing import CUDATestCase, skip_on_cudasim, unittest
import numpy as np
# Dummy function definitions to overload
def generic_func_1():
pass
def cuda_func_1():
pass
def generic_func_2():
pass
def cuda_func_2():... |
2,243 | load events |
import click.testing
import numpy as np
import os
import tempfile
import unittest
from caffe2.python import brew, core, model_helper
import caffe2.contrib.tensorboard.tensorboard as tb
import caffe2.contrib.tensorboard.tensorboard_exporter as tb_exporter
try:
# tensorboard>=1.14.0
from tensorboard.compat... |
2,244 | bacenpix get form action url | # Copyright 2023 KMEE
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import json
import logging
import requests
from werkzeug.urls import url_join
from odoo import fields, models
_logger = logging.getLogger(__name__)
BACENPIX_PROVIDER = "bacenpix"
SANDBOX_GET_TOKEN_URL = "https://oauth.sandbox.b... |
2,245 | test returns list from previous configuration | # -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2015 - 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,246 | write vertices ply | import numpy as np
import h5py
from scipy import spatial
from sklearn import decomposition
import plyfile
import os
import networkx as nx
import cloudvolume
from multiwrapper import multiprocessing_utils as mu
def read_mesh_h5():
pass
def write_mesh_h5():
pass
def read_obj(path):
return Mesh(path)
def ... |
2,247 | shape parameter as tuple | import pytensor.tensor as at
from pytensor.compile import optdb
from pytensor.graph.rewriting.basic import in2out, node_rewriter
from pytensor.tensor.basic import MakeVector
from pytensor.tensor.elemwise import DimShuffle
from pytensor.tensor.math import Sum
from pytensor.tensor.shape import Reshape
from pytensor.tenso... |
2,248 | test license headers | # Copyright iris-grib contributors
#
# This file is part of iris-grib and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Unit tests for iris-grib license header conformance.
"""
from datetime import datetime
from fnmatch import fnma... |
2,249 | pmids from ncbi email | from __future__ import absolute_import, print_function, unicode_literals
from builtins import dict, str, bytes
import re
import os
import sys
import imaplib
import email
import email.header
import datetime
import getpass
import base64
import shutil
def get_mailboxes(M):
res, mailboxes = M.list()
if res == 'OK'... |
2,250 | test mcol mgga ab ks | #!/usr/bin/env python
# Copyright 2022 The PySCF Developers. 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... |
2,251 | test case list lookup wo image | from django.test import SimpleTestCase
from corehq.apps.app_manager.models import Application, Module
from corehq.apps.app_manager.tests.app_factory import AppFactory
from corehq.apps.app_manager.tests.util import TestXmlMixin, patch_get_xform_resource_overrides
@patch_get_xform_resource_overrides()
class CaseListLo... |
2,252 | open | """Generic interface to all dbm clones.
Use
import dbm
d = dbm.open(file, 'w', 0o666)
The returned object is a dbm.gnu, dbm.ndbm or dbm.dumb object, dependent on the
type of database being opened (determined by the whichdb function) in the case
of an existing dbm. If the dbm does not exist and the cr... |
2,253 | is gossipsub | import anyio
from async_exit_stack import AsyncExitStack
from p2pclient.datastructures import StreamInfo
from p2pclient.utils import get_unused_tcp_port
import pytest
import trio
from libp2p.io.abc import ReadWriteCloser
from libp2p.security.noise.transport import PROTOCOL_ID as NOISE_PROTOCOL_ID
from libp2p.security.... |
2,254 | use ai pipeline params | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... |
2,255 | update gui | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2018 The gPodder Team
#
# gPodder 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 Licens... |
2,256 | critic fn | # 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 ... |
2,257 | test edit with all parameters | ############################ Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
2,258 | test create annotation ajax | from json import loads
from django.http.response import Http404
from django.test.client import RequestFactory
from django.test.testcases import TestCase
from mediathread.djangosherd.models import SherdNote
from mediathread.djangosherd.views import delete_annotation, edit_annotation, \
create_annotation
from media... |
2,259 | is before | #! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2011 (ita)
"""
Common mistakes highlighting.
There is a performance impact, so this tool is only loaded when running ``waf -v``
"""
typos = {
'feature':'features',
'sources':'source',
'targets':'target',
'include':'includes',
'export_include':'export_includes',... |
2,260 | 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
# --------------------------------... |
2,261 | test conv3d ndhwc tensorcore | # 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,262 | aci any targetattr ne | # --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2015 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
"""Aci class to help parse and create ACIs.
You will access this via the Entry Class.
"""
import ldap
# Helpers to det... |
2,263 | to ranges | from datetime import date, timedelta
from typing import (
Callable,
Optional,
Sequence,
Tuple,
Union
)
from epiweeks import Week, Year
from typing_extensions import TypeAlias
from delphi.epidata.common.logger import get_structured_logger
# Alias for a sequence of date ranges (int, int) or date in... |
2,264 | test update individual data | from django.test import TestCase, override_settings
from mock import Mock, PropertyMock, call, patch
from people.tests.factories import PersonFactory
from twitterbot.management.twitter import TwitterAPIData
def fake_twitter_api_post(*args, **kwargs):
data = kwargs["data"]
mock_result = Mock()
if "screen_n... |
2,265 | test fuse double array | #!/usr/env/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2023 Alibaba Group Holding Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LI... |
2,266 | license | #!/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# Based on: https://github.com/enarx/spdx
import os
import re
SLUG = re.compile('[a-zA-Z0-9.-]+')
SPDX = re.compile(f'SPDX-License-Identifier:\s+({SLUG.pattern})')
class Language:
def __init__(self, *comments, shebang=False):
assert(isinstance(she... |
2,267 | test out file | #!/usr/bin/env python
# Copyright 2018, 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 o... |
2,268 | test wrong exception order | """Tests for distutils.command.upload."""
import os
import unittest
import unittest.mock as mock
from urllib.request import HTTPError
from test.support import run_unittest
from distutils.command import upload as upload_mod
from distutils.command.upload import upload
from distutils.core import Distribution
from distut... |
2,269 | stub context | import json
from pathlib import Path
import pylint.lint
import pytest
from micropy.project.template import Template, TemplateProvider
@pytest.fixture
def METHOD_NAME(mock_mp_stubs):
stubs = list(mock_mp_stubs.stubs)[:3]
stub_paths = [stub.stubs for stub in stubs]
frozen_paths = [stub.frozen for stub in s... |
2,270 | to json | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
The version of the OpenAPI document: 1.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
... |
2,271 | sv init | # This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import math
from random import ra... |
2,272 | test get secret in file suffixes | # 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... |
2,273 | set str | class AttributeParser:
"""
:type string: str
:type current_pos: int
"""
def __init__(self, string=""):
self.str = string
self.current_pos = 0
def METHOD_NAME(self, string):
self.str = string
return self
def current_char(self):
return self.str[self.c... |
2,274 | path | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from datetime import datetime, timedelta
from typing import Any, Iterable, List, Mapping, MutableMapping, Optional, Tuple
import requests
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sources.streams import Stream
from airbyte_cdk.sources... |
2,275 | try update access time | import argparse
import filecmp
import logging
import os
import pprint
import shutil
import subprocess
import sys
import time
from pathlib import PosixPath, WindowsPath
from common import OperatingSystem
from common.utils.argparse_types import positive_int
from common.utils.environment import get_os
from infection_monk... |
2,276 | get lookup | #
# 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,277 | get command result | ########################################################################
# NOKIA IXS7215
#
# Module contains an implementation of SONiC Platform Base API and
# provides the Components' (e.g., BIOS, CPLD, FPGA, etc.) available in
# the platform
#
########################################################################
... |
2,278 | get ballot paper id | import urllib
from addressbase.models import Address
from data_finder.helpers import (
EveryElectionWrapper,
PostcodeError,
geocode_point_only,
)
from data_finder.views import LogLookUpMixin
from django.core.exceptions import ObjectDoesNotExist
from pollingstations.models import AdvanceVotingStation
from r... |
2,279 | rank | from django.core.validators import MaxValueValidator, MinValueValidator
from django.db import models
from django.db.models import JSONField
from django_extensions.db.models import TimeStampedModel
class ResultSet(TimeStampedModel):
ballot = models.OneToOneField("candidates.Ballot", on_delete=models.CASCADE)
... |
2,280 | is conductance based | # Copyright (c) 2017 The University of Manchester
#
# 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 ... |
2,281 | with flux | # Copyright (c) 2012-2022 by the GalSim developers team on GitHub
# https://github.com/GalSim-developers
#
# This file is part of GalSim: The modular galaxy image simulation toolkit.
# https://github.com/GalSim-developers/GalSim
#
# GalSim is free software: redistribution and use in source and binary forms,
# with or w... |
2,282 | test crt path expandvars | import os
from pathlib import Path
from monkey_island.cc.server_utils.consts import (
DEFAULT_CRT_PATH,
DEFAULT_DATA_DIR,
DEFAULT_KEY_PATH,
DEFAULT_LOG_LEVEL,
DEFAULT_START_MONGO_DB,
)
from monkey_island.cc.setup.island_config_options import IslandConfigOptions
TEST_CONFIG_FILE_CONTENTS_SPECIFIED ... |
2,283 | options | #!/usr/bin/env python
# encoding: utf-8
# Federico Pellegrin, 2016-2019 (fedepell) adapted for Python
"""
This tool helps with finding Python Qt5 tools and libraries,
and provides translation from QT5 files to Python code.
The following snippet illustrates the tool usage::
def options(opt):
opt.load('py pyqt5')
... |
2,284 | connection secrets | import pytest
from fides.api.schemas.connection_configuration.connection_config import (
mask_sensitive_fields,
)
class TestMaskSenstiveValues:
@pytest.fixture(scope="function")
def secret_schema(self):
return {
"additionalProperties": False,
"description": "Aircall secret... |
2,285 | corr2 coeff | # mlxtend Machine Learning Library Extensions
#
# A function for plotting a PCA correlation circle
# File Author: Gabriel Azevedo Ferreira <az.fe.gabriel@gmail.com>
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from mlxtend.externals.adjust_text import adjust_text
from mlxtend.feature_extract... |
2,286 | connect | #!/usr/bin/env pmpython
#
# Copyright (C) 2014-2016,2018,2020 Red Hat.
#
# 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.... |
2,287 | get qualities | import logging
import subprocess
import attr
from ..exceptions import InvalidConfigError
from ..factory import target_factory
from ..protocol import VideoProtocol
from .common import Driver
@target_factory.reg_driver
@attr.s(eq=False)
class USBVideoDriver(Driver, VideoProtocol):
bindings = {
"video": {"... |
2,288 | single lane gui class | from __future__ import absolute_import
###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free softwa... |
2,289 | list all components of languageand type | import glob
import json
import logging
import os
import sys
from dataclasses import dataclass
import nlu
COMPONENT_INFO_FILE_NAME = 'component_infos.json'
logger = logging.getLogger('nlu')
class AllComponentsInfo:
def __init__(self):
''' Initialize every NLU component_to_resolve info object and provide a... |
2,290 | on kill | """
Killing KILL_REQUIREMENT other players in under TIME_REQUIREMENT seconds
sends you into a rampage lasting RAMPAGE_DURATION seconds.
The rampage refills and drastically increases your weapons' rate of fire.
By default this means 3 kills in under 8 seconds to activate. For reference,
lines disappear from the killfee... |
2,291 | 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 . im... |
2,292 | slice indices | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import numpy as np
import torch
from fairseq.data import FairseqDataset, plasma_utils
from fairseq.data.indexed_dataset import best_fitting_in... |
2,293 | read file | #!/usr/bin/env python
import argparse
import sys
import os
from . import config
from . import rule_list
from . import vhdlFile
def parse_command_line_arguments():
'''Parses the command line arguments and returns them.'''
parser = argparse.ArgumentParser(
prog='VHDL Style Guide (VSG) Parser',
de... |
2,294 | build | #!/usr/bin/env python3
import argparse
import os
import shutil
import requests
import sys
import json
from pathlib import Path
## Configure command-line options
parser = argparse.ArgumentParser()
parser.add_argument('action', help="Action to execute", choices=["build", "push", "delete"], default="build")
parser.add_a... |
2,295 | setup | #
# Copyright (c) 2020 Alex Richardson
#
# This software was developed by SRI International and the University of
# Cambridge Computer Laboratory (Department of Computer Science and
# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
# DARPA SSITH research programme.
#
# Redistribution and use... |
2,296 | test get text unit name no context | from unittest import mock
import unittest
from ict import GettextUtils
from ict import IctMetadataBuilder
from ict import TagsBlockEncoder
# Keep this snippet in sync with the Javascript implementation IctMetadataExtractor.js, TagsBlockDecoder.js, etc
# in this directory
# python3 -m venv ~/p3-env
# . ~/p3-env/bin/a... |
2,297 | setup network | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test PrioritiseTransaction code
#
from test_framework.test_framework import BitcoinTestFramework
fro... |
2,298 | test save report permission | import os
import re
import tempfile
import unittest
from unittest.mock import patch
from AnyQt.QtCore import Qt, QRectF
from AnyQt.QtGui import QFont, QBrush, QPixmap, QColor, QIcon
from AnyQt.QtWidgets import QGraphicsScene
from orangewidget.report.owreport import OWReport, HAVE_REPORT
from orangewidget import gui
f... |
2,299 | supported extensions | # -*- coding: utf-8 -*-
# Copyright © 2016-2019, Chris Warrick.
# 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 rights to use, copy... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.