id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
12,300 | wrapper | import functools
import json
import logging
import time
import pika
from hoppy.config import RABBITMQ_CONFIG
class Service:
def __init__(self, exchange, consumers, config={}):
self.config = config = {**RABBITMQ_CONFIG, **config}
self.exchange = exchange
self.consumers = consumers
... |
12,301 | real section | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""TOML configuration support for coverage.py"""
from __future__ import annotations
import os
import re
from typing import Any, Callable, Dict, Iterable, List, O... |
12,302 | fix offset before match | #
# Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
# Use of this file is governed by the BSD 3-clause license that
# can be found in the LICENSE.txt file in the project root.
#/
# Represents an executor for a sequence of lexer actions which traversed during
# the matching operation of a lexer rule (to... |
12,303 | json | from datetime import datetime, timedelta
from unittest import mock
import pandas as pd
import pytest
from viadot.exceptions import ValidationError
from viadot.sources import VidClub
from viadot.task_utils import credentials_loader
CREDENTIALS = credentials_loader.run(credentials_secret="VIDCLUB")
vc = VidClub(creden... |
12,304 | split parameter list as sql | # Stubs for django.db.models.lookups (Python 3.5)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from typing import Any
from django.db.models.expressions import Func
from django.db.models.query_utils import RegisterLookupMixin
class Lookup:
lookup_name = ... # type: Any
rhs = ..... |
12,305 | register | from __future__ import annotations
from typing import TYPE_CHECKING
from poetry.mixology.assignment import Assignment
from poetry.mixology.set_relation import SetRelation
if TYPE_CHECKING:
from poetry.core.packages.dependency import Dependency
from poetry.core.packages.package import Package
from poetr... |
12,306 | stop | # -*- coding: utf-8 -*-
import time
import traceback
from queue import Queue
from ..network.exceptions import Abort, Fail, Reconnect, Retry, Skip
from .plugin_thread import PluginThread
class DownloadThread(PluginThread):
"""
thread for downloading files from 'real' downloader plugins.
"""
# -----... |
12,307 | test both message and text | #!/usr/bin/env python
# Copyright 2013-2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# o... |
12,308 | compute variance | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020, 2023.
#
# 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 derivat... |
12,309 | next c | #!/usr/bin/python
# mpsclasses.py: show the MPS class hierarchy
# $Id$
# Copyright (c) 2007-2020 Ravenbrook Limited. See end of file for license.
# This file parses MPS C source for MPS class definitions
# (DEFINE_CLASS() et al), and prints out the class hierarchy.
#
# USAGE:
#
# Invoke it with the list of MPS sourc... |
12,310 | set up | import json
from django.test import TestCase
from wagtail.models import Site
from incident.tests.factories import IncidentIndexPageFactory, IncidentPageFactory
class IncidentExportTestCase(TestCase):
def METHOD_NAME(self):
site = Site.objects.get(is_default_site=True)
root_page = site.root_page
... |
12,311 | test blockcut sensitivities3 | """
Integration tests that use the command-line entry point run_polyphase.
"""
import os
from pytest import raises
from whatshap.cli.polyphase import run_polyphase, CommandLineError
from whatshap.vcf import VcfReader
def test_polyphase_short_chr22(tmp_path):
outvcf = tmp_path / "output.vcf"
run_polyphase(
... |
12,312 | click sync no args | import asyncio
from typing import Literal
import pytest
from selenium.webdriver.common.by import By
from nicegui import ui
from nicegui.events import ClickEventArguments
from .screen import Screen
def METHOD_NAME():
ui.label('click_sync_no_args')
def click_sync_with_args(_: ClickEventArguments):
ui.label... |
12,313 | show stats | import json
import os
import time
from urllib.parse import quote
import pytest
from statistic.update import StatsUpdater
from statistic.work_load import WorkLoadStatistic
from test.acceptance.conftest import test_fw_a, test_fw_c
from test.common_helper import get_test_data_dir
@pytest.fixture(autouse=True)
def _aut... |
12,314 | assert hasattr | '''
Test cases for pyclbr.py
Nick Mathewson
'''
from test.test_support import run_unittest, import_module
import sys
from types import ClassType, FunctionType, MethodType, BuiltinFunctionType
import pyclbr
from unittest import TestCase
StaticMethodType = type(staticmethod(lambda: None))
ClassMethodType = type(cl... |
12,315 | get action list | __license__ = """
NML 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.
NML is distributed in the hope that it will be useful,
but WITHOUT ANY... |
12,316 | get default output json path | import os
import sys
import yaml
from datetime import datetime, timedelta
import time
import json
import yaml
from pathlib import Path
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional, Callable
REPO_PATH = Path(os.path.abspath(__file__)).parent.parent
USERBENCHMARK_OUTPUT_PREFIX = ... |
12,317 | test create program from source | # Data Parallel Control (dpctl)
#
# Copyright 2020-2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... |
12,318 | generate random str | # ***************************************************************
# Copyright (c) 2023 Jittor. All Rights Reserved.
# Maintainers:
# Guoye Yang <498731903@qq.com>
# Dun Liang <randonlang@gmail.com>.
#
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this s... |
12,319 | validate native script | from typing import TYPE_CHECKING
from trezor.enums import CardanoNativeScriptType
from trezor.wire import ProcessError
if TYPE_CHECKING:
from typing import Any
from trezor import messages
from apps.common.cbor import CborSequence
from . import seed
def METHOD_NAME(script: messages.CardanoNativeSc... |
12,320 | check dominfo | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Copyright Redhat
#
# SPDX-License-Identifier: GPL-2.0
# Author: Nan Li <nanli@redhat.com>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import os
from virttest import virsh
from virttest import libvirt_version... |
12,321 | main | # 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.
import os
import shlex
import subprocess
import sys
import click
from click._compat import should_strip_a... |
12,322 | mr update | """*****************************************************************************
* Copyright (C) 2019 Microchip Technology Inc. and its subsidiaries.
*
* Subject to your compliance with these terms, you may use Microchip software
* and any derivatives exclusively with Microchip products. It is your
* responsibility to ... |
12,323 | training step | import math
from typing import Union
import pytest
import torch
import pytorch_lightning
from pytorch_lightning import LightningModule, Trainer
from pytorch_lightning.trainer.states import RunningStage
from torch.utils.data import DataLoader, Dataset
pytestmark = pytest.mark.skipif(pytorch_lightning.__version__ < '1.... |
12,324 | test course access endpoint with invalid data | """Tests for embargo app views. """
from unittest.mock import patch, MagicMock
import ddt
import maxminddb
import geoip2.database
from django.urls import reverse
from django.conf import settings
from .factories import CountryAccessRuleFactory, RestrictedCourseFactory
from .. import messages
from lms.djangoapps.cou... |
12,325 | to str | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.28
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
12,326 | get context | import logging
from django import forms
from django.core.paginator import Page
from django.utils.safestring import mark_safe
from rest_framework.renderers import BrowsableAPIRenderer
from rest_framework.request import override_method
from urllib.parse import quote, urljoin
from usaspending_api.common.helpers.endpoint_... |
12,327 | get ancestor iteratively | # Copyright 2023 Hathor Labs
#
# 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... |
12,328 | on skip | import os
import threading
import time
from .base import BaseRunner
from .printer import (
print_run_result_error,
)
from .runnable import GraphRunnableTask
from dbt.contracts.results import (
FreshnessResult,
PartialSourceFreshnessResult,
SourceFreshnessResult,
FreshnessStatus,
)
from dbt.excepti... |
12,329 | ceil | """
mathematical functions.
Descriptions taken from:
https://raw.githubusercontent.com/micropython/micropython/master/docs/library/math.rst.
=====================================
.. module:: math
:synopsis: mathematical functions
|see_cpython_module| :mod:`python:math`.
The ``math`` module provides some basic ma... |
12,330 | inverse inscr mun | # OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Thinkopen - Brasil
# Copyright (C) Thinkopen Solutions (<http://www.thinkopensolutions.com.br>)
# Akretion
# Copyright (C) Akretion (<http://www.akretion.com>)
# License AGPL-3 - See http://www.gnu.org... |
12,331 | help searching | from pyramid.response import Response
from libweasyl import staff
from weasyl.controllers.decorators import login_required
from weasyl import define, profile, report
# Policy functions
def staff_(request):
directors = staff.DIRECTORS
technical = staff.TECHNICAL - staff.DIRECTORS
admins = staff.ADMINS -... |
12,332 | test asymmetric keyset conversion | # Copyright 2020 Google LLC
#
# 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, ... |
12,333 | test get dispatch key callable | import abc
import pytest
from prefect.utilities.dispatch import (
_TYPE_REGISTRIES,
get_dispatch_key,
get_registry_for_type,
lookup_type,
register_base_type,
register_type,
)
@pytest.fixture(autouse=True)
def reset_dispatch_registry():
before = _TYPE_REGISTRIES.copy()
_TYPE_REGISTRI... |
12,334 | format part strings | """
Base class for Scrapy commands
"""
import argparse
import os
from pathlib import Path
from typing import Any, Dict, List, Optional
from twisted.python import failure
from scrapy.crawler import CrawlerProcess
from scrapy.exceptions import UsageError
from scrapy.utils.conf import arglist_to_dict, feed_process_param... |
12,335 | test missing url | #!/usr/bin/env python
#
# Copyright (c) 2015, Arista Networks, 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,
# ... |
12,336 | set updated at to | from datetime import datetime, timedelta
import pytest
from dbt.tests.util import run_dbt, update_config_file, check_relations_equal
from dbt.tests.fixtures.project import write_project_files
from tests.functional.source_overrides.fixtures import ( # noqa: F401
local_dependency,
models__schema_yml,
seeds_... |
12,337 | key insert | from enigma import getPrevAsciiCode
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Components.ActionMap import NumberActionMap
from Components.Label import Label
from Components.Input import Input
from Components.config import config
from Tools.BoundFunction import boundFunction
from T... |
12,338 | get maximum | #!/usr/bin/env python
"""
Base class / functionality for an (illumination) amplitude control device.
Hazen 04/17
"""
from PyQt5 import QtCore
import storm_control.hal4000.halLib.halMessage as halMessage
import storm_control.sc_hardware.baseClasses.hardwareModule as hardwareModule
class AmplitudeMixin(object):
... |
12,339 | pg | import os
import shutil
import filelock
import pytest
from .utils import (
LONG_PASSWORD,
PG_SUPPORTS_SCRAM,
TEST_DIR,
TLS_SUPPORT,
Bouncer,
Postgres,
run,
)
def create_certs(cert_dir):
run(
"sh create_certs.sh",
cwd=TEST_DIR / "ssl",
silent=True,
)
ce... |
12,340 | update func | # 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... |
12,341 | increment build number | import os
import re
import string
import fnmatch
from scriptCommon import catchPath
versionParser = re.compile( r'(\s*static\sVersion\sversion)\s*\(\s*(.*)\s*,\s*(.*)\s*,\s*(.*)\s*,\s*\"(.*)\"\s*,\s*(.*)\s*\).*' )
rootPath = os.path.join( catchPath, 'src/catch2' )
versionPath = os.path.join( rootPath, "catch_version.... |
12,342 | implib pre flags | """SCons.Tool.cyglink
Customization of gnulink for Cygwin (http://www.cygwin.com/)
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
from SCons.Tool.linkCommon import StringizeLibSymlinks, EmitLibSymlinks
from... |
12,343 | run | #!/usr/bin/env python3
# This is a simple HTTP server based on the HTTPServer and
# SimpleHTTPRequestHandler. It has been extended with PUT
# and DELETE functionality to store or delete results.
#
# See: https://github.com/python/cpython/blob/main/Lib/http/server.py
from functools import partial
from http import HTTP... |
12,344 | 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... |
12,345 | auto guess clamp | """ Helpers for dealing with RGB(A) images.
"""
import dask
import dask.array as da
import numpy as np
import xarray as xr
from typing import List, Optional, Tuple, Union
from ._dask import randomize
def is_rgb(x: xr.DataArray):
if x.dtype != "uint8":
return False
if x.ndim < 3:
return False
... |
12,346 | restore ss | def test_savestate_basic(neuron_nosave_instance):
"""Test SaveState works rxd when rxd states are not saved/restored by save
state"""
h, rxd, save_path = neuron_nosave_instance
vtrap, v = rxd.rxdmath.vtrap, rxd.v
exp, log = rxd.rxdmath.exp, rxd.rxdmath.log
def saveSS():
svst = h.SaveSta... |
12,347 | parse fa pair |
import re
import collections
# Token specification
pats = []
pats.append( r'(?P<DOUBLESLASH>//)')
pats.append( r'(?P<SEMI>;)')
pats.append( r'(?P<PERIOD>\.)')
pats.append( r'(?P<BAR>\|)')
pats.append( r'(?P<BANG>!)')
pats.append( r'(?P<COMMA>,)')
pats.append( r'(?P<BACKTICK>`)')
pats.append( r'(?P<LPAREN>\()')
pats.a... |
12,348 | create | """Define the SQL classes for Users."""
import enum
from datetime import datetime
from ..core import CrudMixin, db
from backend.database.models._assoc_tables import incident_agency, incident_tag
class RecordType(enum.Enum):
NEWS_REPORT = 1
GOVERNMENT_RECORD = 2
LEGAL_ACTION = 3
PERSONAL_ACCOUNT = 4
... |
12,349 | job cancel | # encoding: utf-8
import ckan.logic as logic
import ckan.authz as authz
from ckan.logic.auth import get_group_object
from ckan.logic.auth import get_resource_object
from ckan.common import _
from ckan.types import Context, DataDict, AuthResult
def user_delete(context: Context, data_dict: DataDict) -> AuthResult:
... |
12,350 | numba cpu is supported | # 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... |
12,351 | warn about calling | # -*- coding: utf-8 -*-
"""
Tests for utilities related to logging.
"""
__author__ = 'Grzegorz Latuszek, Marcin Usielski'
__copyright__ = 'Copyright (C) 2019-2023, Nokia'
__email__ = 'grzegorz.latuszek@nokia.com, marcin.usielski@nokia.com'
import mock
import sys
def test_extracting_caller_code_location():
from ... |
12,352 | get token cache | # Copyright (c) 2019, Frappe Technologies and contributors
# License: MIT. See LICENSE
import os
from urllib.parse import urlencode, urljoin
from requests_oauthlib import OAuth2Session
import frappe
from frappe import _
from frappe.model.document import Document
if any((os.getenv("CI"), frappe.conf.developer_mode, ... |
12,353 | get p key | """ X509Request is a class for managing X509 requests with their Pkeys.
It's main use is for proxy delegation.
"""
import M2Crypto
from DIRAC import S_OK, S_ERROR
from DIRAC.Core.Security.m2crypto import DEFAULT_PROXY_STRENGTH
from DIRAC.Core.Utilities import DErrno
# from DIRAC.Core.Security.m2crypto.X509Chain import... |
12,354 | test curl nginx | import pytest
from sinspqa import sinsp, BTF_IS_AVAILABLE
from sinspqa.sinsp import assert_events
from sinspqa.docker import get_container_id, get_network_data
containers = [
{
'nginx': {
'image': 'nginx:1.14-alpine',
},
'curl': {
'image': 'pstauffer/curl:latest',
... |
12,355 | parse xds xparm scan info | from __future__ import absolute_import, division, print_function
import sys
import math
from scitbx import matrix
from scitbx.math.euler_angles import xyz_angles
from scitbx.math import r3_rotation_axis_and_angle_as_matrix
from rstbx.cftbx.coordinate_frame_converter import coordinate_frame_converter
from six.moves imp... |
12,356 | test does not report on examples | # 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... |
12,357 | test basics | """Unit tests for the PickleBuffer object.
Pickling tests themselves are in pickletester.py.
"""
import gc
from pickle import PickleBuffer
import weakref
import unittest
from test import support
class B(bytes):
pass
class PickleBufferTest(unittest.TestCase):
def check_memoryview(self, pb, equiv):
... |
12,358 | convert | from PIL import Image
import numpy as np
import netCDF4
import dateutil.parser
from os import listdir
from os.path import isfile, join
import os.path
import datetime
import urllib
import imghdr
import subprocess
#Maarten Plieger, KNMI (2018)
class HimawariConverter:
imgextent = [-5500000,-5500000,5500000,5500000]
... |
12,359 | short uid | from __future__ import annotations
import uuid
from pathlib import Path
from typing import Optional, Type, TypedDict
import localstack.services.cloudformation.provider_utils as util
from localstack.services.cloudformation.resource_provider import (
CloudFormationResourceProviderPlugin,
OperationStatus,
Pr... |
12,360 | test engine mode all | """policy engine tests"""
from django.core.cache import cache
from django.test import TestCase
from authentik.core.tests.utils import create_test_admin_user
from authentik.lib.generators import generate_id
from authentik.policies.dummy.models import DummyPolicy
from authentik.policies.engine import PolicyEngine
from a... |
12,361 | execute | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the ... |
12,362 | test tvpvar | """
Tests for CFA simulation smoothing in a TVP-VAR model
See "results/cfa_tvpvar_test.m" for Matlab file that generates the results.
Based on "TVPVAR.m", found at http://joshuachan.org/code/code_TVPVAR.html.
See [1]_ for details on the TVP-VAR model and the CFA method.
References
----------
.. [1] Chan, Joshua CC, ... |
12,363 | test modularity resolution | """Unit tests for the :mod:`networkx.algorithms.community.quality`
module.
"""
import pytest
import networkx as nx
from networkx import barbell_graph
from networkx.algorithms.community import modularity, partition_quality
from networkx.algorithms.community.quality import inter_community_edges
class TestPerformance:... |
12,364 | flip combination | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... |
12,365 | delighted test client | from typing import Any, Dict, Generator
import pydash
import pytest
import requests
from requests import Response
from sqlalchemy.orm import Session
from fides.api.cryptography import cryptographic_util
from fides.api.models.connectionconfig import (
AccessLevel,
ConnectionConfig,
ConnectionType,
)
from f... |
12,366 | get rate | # The Hazard Library
# Copyright (C) 2012-2020 GEM Foundation
#
# 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 the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#... |
12,367 | main | from Tkinter import *
class ScrolledList:
default = "(None)"
def __init__(self, master, **options):
# Create top frame, with scrollbar and listbox
self.master = master
self.frame = frame = Frame(master)
self.frame.pack(fill="both", expand=1)
self.vbar = vbar = Scrollba... |
12,368 | collect indexes | import logging
from typing import List, Tuple
from dvc.exceptions import DownloadError
from dvc_data.index import DataIndex, FileStorage
from . import locked
logger = logging.getLogger(__name__)
def _make_index_onerror(onerror, rev):
def _onerror(entry, exc):
if onerror:
return onerror(rev,... |
12,369 | forget document info | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
... |
12,370 | run | #!/usr/bin/env python3
import shutil
import os
import subprocess
import tempfile
import logging
import signal
class SSHAgent:
def __init__(self):
self._env = {}
self._env_backup = {}
self._keys = {}
self.start()
@property
def pid(self):
return int(self._env["SSH_A... |
12,371 | invoke fallback shell | """The ``celery shell`` program, used to start a REPL."""
import os
import sys
from importlib import import_module
import click
from celery.bin.base import CeleryCommand, CeleryOption, handle_preload_options
def METHOD_NAME(locals):
import code
try:
import readline
except ImportError:
p... |
12,372 | format marketplaces field of aliases | from typing import List, Tuple
from packaging.version import Version
from demisto_sdk.commands.common.constants import (
DEFAULT_CONTENT_ITEM_TO_VERSION,
OLDEST_INCIDENT_FIELD_SUPPORTED_VERSION,
)
from demisto_sdk.commands.common.handlers import DEFAULT_JSON_HANDLER as json
from demisto_sdk.commands.common.lo... |
12,373 | key safe items | from __future__ import absolute_import, division, print_function
def pretty_filename(spotfinder,key):
nwildcard = spotfinder.pd['template'].count('#')
template_f='#'*nwildcard
extensn_f='%%0%dd'%nwildcard
if nwildcard > 0:
return spotfinder.pd['template'].replace(template_f,extensn_f%key)
else:
retur... |
12,374 | initialize options | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: setup_tests.py
author: Cyrus Harrison <cyrush@llnl.gov>
created: 10/14/2010
descripti... |
12,375 | run shell | # SPDX-License-Identifier: MIT
import atexit, serial, os, struct, code, traceback, readline, rlcompleter, sys
import __main__
import builtins
import re
from .proxy import *
from .proxyutils import *
from .utils import *
from . import sysreg
from inspect import isfunction, signature
__all__ = ["ExitConsole", "run_shel... |
12,376 | pub thrust | # -*- coding: utf-8 -*-
# vim:set ts=4 sw=4 et:
#
# Copyright 2015,2021 Vladimir Ermakov.
#
# This file is part of the mavros package and subject to the license terms
# in the top-level LICENSE file of the mavros repository.
# https://github.com/mavlink/mavros/tree/master/LICENSE.md
import rclpy
from geographic_msgs.m... |
12,377 | process request | import atexit
from ctypes import sizeof
import multiprocessing
import threading
import socket
import time
from cupyx.distributed import _klv_utils
from cupyx.distributed import _store_actions
_DEFAULT_HOST = '127.0.0.1'
_DEFAULT_PORT = 13333
_exit_mode = False
@atexit.register
def _exit():
global _exit_mode
... |
12,378 | add group file | # TestFinder class, define set of tests to run.
#
# Copyright (c) 2020-2021 Virtuozzo International GmbH
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (... |
12,379 | binary file compare | from argparse import RawDescriptionHelpFormatter
import argparse
import filecmp
import json
import os
import subprocess
# Start of our unit test
# -- main() -------------------------------------------------------------------
#
# The entry point to this script.
#
# Note: It is called at the end of this script so that t... |
12,380 | get place updates | import random
from datetime import datetime
from django.contrib.auth.decorators import login_required
from django.http import Http404, HttpResponse, JsonResponse
from django.shortcuts import get_object_or_404
from django.views.generic.detail import DetailView
from ..models.place import (
PlaceAction,
PlaceGri... |
12,381 | get settings window tab settings | # flet_settings_window.py
# Flet imports
import flet as ft
# utils imports
class SettingsWindow(ft.AlertDialog):
def setup(self, settings):
self.get_settings_window_tabs(settings)
def get_settings_window_tab_page_setting_slider(
self, settings, section, setting, display_width
):
... |
12,382 | test forwards data | """
Tests for `buildbot_worker.util._hangcheck`.
"""
from __future__ import absolute_import
from __future__ import print_function
from twisted.internet import defer
from twisted.internet import reactor
from twisted.internet.endpoints import TCP4ClientEndpoint
from twisted.internet.endpoints import TCP4ServerEndpoint
... |
12,383 | list | # 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... |
12,384 | test packing fraction | #!/usr/bin/env python
from math import pi
import numpy as np
from numpy.linalg import norm
import openmc
import openmc.model
import pytest
import scipy.spatial
_RADIUS = 0.1
_PACKING_FRACTION = 0.35
_PARAMS = [
{'shape': 'rectangular_prism', 'volume': 1**3},
{'shape': 'x_cylinder', 'volume': 1*pi*1**2},
... |
12,385 | test contingency gen | import pandapower as pp
import pytest
from numpy import array, isclose
@pytest.fixture()
def base_net():
net = pp.create_empty_network()
pp.create_bus(net, vn_kv=10)
pp.create_bus(net, vn_kv=10)
pp.create_ext_grid(net, 0)
pp.create_load(net, 1, p_mw=0.2, controllable=False)
pp.create_line_from_... |
12,386 | get experiment | # 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... |
12,387 | test missing object spec | # -*- coding: utf-8 -*-
import pytest
from bravado_core.exception import SwaggerMappingError
from bravado_core.spec import Spec
from bravado_core.unmarshal import unmarshal_schema_object
from tests.conftest import get_url
def test_unmarshal_schema_object_allOf(composition_dict, composition_abspath):
composition_... |
12,388 | sanitize cell | from unittest import TestCase
from ipykernel.tests import utils
from nbformat.converter import convert
from nbformat.reader import reads
import re
import json
from copy import copy
import unittest
try:
# py3
from queue import Empty
def isstr(s):
return isinstance(s, str)
except ImportError:
... |
12,389 | numerators | import numpy as np
from numba import njit
from typing import List
@njit
def ravel_index(ind_mat: np.ndarray, dims: np.ndarray) -> np.ndarray:
"""
This function takes a matrix of indices, and a vector of dimensions, and
returns a vector of corresponding flattened indices
"""
# Initialize indices
... |
12,390 | delete sa token | import base64
import copy
import logging
import time
import typing
import kubernetes.client
import kubernetes.config
import cfg_mgmt
import cfg_mgmt.util
import ci.util
import model
import model.kubernetes
from cfg_mgmt.model import (
CfgQueueEntry,
ValidationError,
)
from kubernetes.client import (
Core... |
12,391 | get temp file name | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import time
import tarfile
import logging
import argparse
import requests
import tempfile
DEFAULT_URL = 'https://clickhouse-datasets.s3.yandex.net'
AVAILABLE_DATASETS = {
'hits': 'hits_v1.tar',
'visits': 'visits_v1.tar',
}
RETRIES_COUNT = 5... |
12,392 | send deploy contract tx | import base64
import json
import requests
import random
import time
from transaction import (
sign_payment_tx, sign_deploy_contract_tx, sign_function_call_tx,
sign_create_account_with_full_access_key_and_balance_tx, sign_staking_tx)
from key import Key
from utils import load_binary_file
from configured_logger ... |
12,393 | service version | # pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
# pylint: disable=too-many-arguments
from typing import Any
import pytest
import yaml
from models_library.utils.specs_substitution import (
SpecsSubstitutionsResolver,
SubstitutionValue,
)
from pydantic ... |
12,394 | type transfer | from uuid import uuid4
from citext import CIText
from dateutil.tz import tzutc
from flask import g
from sortedcontainers import SortedSet
from sqlalchemy import BigInteger, Column, Integer
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.orm import backref, relationship
from ereuse_devicehub.db import ... |
12,395 | run | #!/usr/bin/env python
import argparse
import collections
import grpc
import gym
import gym.spaces
import importlib
import numpy as np
import threading
import time
import signal
import sys
from concurrent import futures
from scrimmage.proto import OpenAI_pb2, OpenAI_pb2_grpc
import socket, errno
def is_port_in_use(add... |
12,396 | dataset 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... |
12,397 | from job id | """
Helper functions for communication with Gitlab.
Allowing for interaction with the test results, e.g. with UI tests.
"""
from __future__ import annotations
import json
import re
from dataclasses import dataclass
from pathlib import Path
from typing import Any, Iterable, Iterator
import requests
AnyDict = dict[A... |
12,398 | get 2mass images | #! /usr/bin/env python3
# This file is part of the Astrometry.net suite.
# Licensed under a 3-clause BSD style license - see LICENSE
import re
import sys
import socket
import time
from urllib.request import urlopen
from urllib.error import URLError
from urllib.parse import urlencode
from urllib.parse import urlparse, ... |
12,399 | get exact line number | import ast
from typing import Type, Optional
from pydantic import BaseModel, Field
from superagi.helper.github_helper import GithubHelper
from superagi.helper.json_cleaner import JsonCleaner
from superagi.helper.prompt_reader import PromptReader
from superagi.helper.token_counter import TokenCounter
from superagi.llm... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.