id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
4,800 | parse start | import re
from collections import defaultdict
from datetime import datetime
import scrapy
from city_scrapers_core.constants import BOARD, COMMITTEE
from city_scrapers_core.items import Meeting
from city_scrapers_core.spiders import CityScrapersSpider
class ChiTeacherPensionSpider(CityScrapersSpider):
name = "chi... |
4,801 | set device | # Copyright (c) 2019 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 applicabl... |
4,802 | match | import os
import re
import random
from spytest import env
from spytest.ordyaml import OrderedYaml
import utilities.common as utils
config = None
levels = ['emerg', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug', 'none']
sample_syslogs = []
def add_sample_syslog(msg):
sample_syslogs.append(msg)
... |
4,803 | test cov of uncorrelated data is zero | '''
@date: 15/04/2015
@author: Stefan Hegglin
'''
import unittest
import numpy as np
from scipy.constants import c, e, m_p
from PyHEADTAIL.particles.particles import Particles
from PyHEADTAIL.particles.generators import generate_Gaussian6DTwiss
import PyHEADTAIL.cobra_functions.stats as cf
from PyHEADTAIL.trackers... |
4,804 | test grouped iterator | # 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 unittest
from fairseq.data import iterators
class TestIterators(unittest.TestCase):
def test_counting_iterator(self, ref=None, i... |
4,805 | mock ugettext | from unittest.mock import patch
from django.conf import settings
from django.contrib.sites.models import Site
from django.utils.functional import lazy
from django.utils.translation import get_language
from kitsune.sumo.email_utils import emails_with_users_and_watches, safe_translation
from kitsune.sumo.tests import T... |
4,806 | 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 . imp... |
4,807 | cli | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
4,808 | create initial config | import os
import sys
from hls4ml.backends import FPGABackend
from hls4ml.model.flow import register_flow
from hls4ml.report import parse_vivado_report
class SymbolicExpressionBackend(FPGABackend):
def __init__(self):
super().__init__('SymbolicExpression')
self._register_flows()
def _register... |
4,809 | test fifth day five gold rings | # These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/twelve-days/canonical-data.json
# File last updated on 2023-07-19
import unittest
from twelve_days import (
recite,
)
# PLEASE TAKE NOTE: Expected result lists for these test cases use *... |
4,810 | 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... |
4,811 | test ethaddress typeerror | #!/usr/bin/python3
import pytest
from brownie.convert.datatypes import EthAddress, HexString, ReturnValue, Wei
from brownie.project import compile_source
string_fixture = "bar baz"
@pytest.fixture
def return_value(accounts, tester):
yield tester.manyValues(
88, [False, False, False], accounts[2], [("0x... |
4,812 | load model | import os
import shutil
from mlagents.torch_utils import torch
from typing import Dict, Union, Optional, cast, Tuple, List
from mlagents_envs.exception import UnityPolicyException
from mlagents_envs.logging_util import get_logger
from mlagents.trainers.model_saver.model_saver import BaseModelSaver
from mlagents.trainer... |
4,813 | test plot coord 3d transform | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.backend_bases import KeyEvent
import astropy.units as u
from astropy.coordinates import FK5, SkyCoord, galactocentric_frame_defaults
from astropy.time import Time
from astropy.visualizatio... |
4,814 | test allows some none tags | #!/usr/bin/env python3
# Copyright 2023 OpenC3, Inc.
# All Rights Reserved.
#
# This program is free software; you can modify and/or redistribute it
# under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation; version 3 with
# attribution addendums as found in the LICENSE.... |
4,815 | url 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
# --------------------------------... |
4,816 | tear down | # (C) Copyright 2005-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... |
4,817 | export get productions | """ DISET request handler base class for the ProductionDB.
"""
from DIRAC import S_ERROR, S_OK, gLogger
from DIRAC.Core.DISET.RequestHandler import RequestHandler
from DIRAC.Core.Utilities.DEncode import ignoreEncodeWarning
from DIRAC.Core.Utilities.ObjectLoader import ObjectLoader
prodTypes = [str, int]
transTypes =... |
4,818 | set up | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import os
import sys
import unittest
# noinspection PyProtectedMember
from numpy.testing import assert_allclose
from numpy.testing import assert_array_less
from numpy.testing import assert_equal
from numpy.testing import ass... |
4,819 | test division detail api redirect | import urllib.parse
from django.contrib.auth.models import User
from django.test import TestCase
from dfirtrack_main.models import Division
class DivisionAPIViewTestCase(TestCase):
"""division API view tests"""
@classmethod
def setUpTestData(cls):
# create object
Division.objects.create... |
4,820 | mock delete | # 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... |
4,821 | drive letter iso | """
Windows virtio-win utilities
"""
import re
import logging
from . import drive
from . import system
from avocado.core import exceptions
ARCH_MAP_ISO = {"32-bit": "x86", "64-bit": "amd64"}
ARCH_MAP_VFD = {"32-bit": "i386", "64-bit": "amd64"}
LOG = logging.getLogger('avocado.' + __name__)
def arch_dirname_iso(s... |
4,822 | record call | """
This module contains facilities for building a call graph for an Ada program.
The 'StaticCallGraphVisitor' class runs a call graph analysis on a libadalang
AdaNode via a visitor pattern (inherit from 'AdaVisitor') and makes available
its result call graph in the 'nodes' and 'edges' member variables.
"""
__copyrig... |
4,823 | view | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import six
import yaml
from builtins import object
# Describes where to search for the config file if no location is specified
from typing impor... |
4,824 | create operation | # SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2021, Intel Corporation
import memoryoperations
from reorderexceptions import NotSupportedOperationException
class OperationFactory:
"""
An abstract memory operation factory.
This object factory puts special constraints on names of classes.
It... |
4,825 | test progress update | from contextlib import contextmanager
import numpy as np
from napari.utils import cancelable_progress, progrange, progress
@contextmanager
def assert_progress_added_to_all(prog):
"""Check prog is added to `progress_instances` on init & removed on close"""
assert prog in progress._all_instances
yield
... |
4,826 | kind | # coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** 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 .... |
4,827 | default config | """
svd
===
Autogenerated DPF operator classes.
"""
from warnings import warn
from ansys.dpf.core.dpf_operator import Operator
from ansys.dpf.core.inputs import Input, _Inputs
from ansys.dpf.core.outputs import Output, _Outputs
from ansys.dpf.core.operators.specification import PinSpecification, Specification
class s... |
4,828 | infer | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
4,829 | test execute query succeeded no retry | # 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... |
4,830 | teardown method | # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt
import os
import re
import sys
from pathlib import Path
import astroid
from pylint.che... |
4,831 | setup user in baggage and spans | import functools
import inspect
import os
import typing
from abc import ABCMeta
from operator import attrgetter
from typing import List, Optional, Union
from opentelemetry import baggage, context
from opentelemetry.context import Context, attach, detach, set_value
from opentelemetry.sdk.trace import Span
from opentele... |
4,832 | test encoding loop | # 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... |
4,833 | requested task | import json
from uuid import uuid4
import pytest
class TestRequestedTaskList:
url = "/requested-tasks/"
def _assert_requested_task(self, task, item):
assert set(item.keys()) == {
"_id",
"status",
"schedule_name",
"timestamp",
"config",
... |
4,834 | test user cannot reply if status is | from unittest.mock import ANY
import pytest
from grants.models import Grant
pytestmark = pytest.mark.django_db
def _send_grant_reply(graphql_client, grant, *, status, message=""):
document = """
mutation sendGrantReply ($input: SendGrantReplyInput!) {
sendGrantReply(input: $input) {
__... |
4,835 | test standalone | import shutil
import tempfile
import os.path
from nose.tools import eq_
from nose.tools import raises
from nose.tools import with_setup
from build_pack_utils import BuildPack
from build_pack_utils.runner import CalledProcessError
from common.integration import FileAssertHelper
from common.integration import ErrorHelper... |
4,836 | decorator | # Copyright (C) 2018-2022 Intel Corporation
#
# SPDX-License-Identifier: MIT
import http.client
from django.http import HttpResponseBadRequest, HttpResponse
from rules.contrib.views import permission_required, objectgetter
from django.conf import settings
from rest_framework.permissions import IsAuthenticated
from re... |
4,837 | test parameters to table | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pytest
import numpy as np
from numpy.testing import assert_allclose
from gammapy.modeling import Parameter, Parameters
def test_parameter_init():
par = Parameter("spam", 42, "deg")
assert par.name == "spam"
assert par.factor == 42
... |
4,838 | visit call | # Copyright 2022 Fuzz Introspector 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 ... |
4,839 | check | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# request.py
#
# Copyright 2017 Dominique Revuz <dr@univ-mlv.fr>
#
import json
import logging
import os
import requests
from django.conf import settings
from playexo.exception import SandboxUnavailable
from playexo.utils import tar_from_dic
from playexo.utils import m... |
4,840 | translate profile | # (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import os
import click
import yaml
from ...console import CONTEXT_SETTINGS
from .constants import MIB_SOURCE_URL
def fetch_mib(mib, source_url):
try:
from urllib.parse import urlparse
except ... |
4,841 | test parens in quotes are not counted | #############################################################################
# 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... |
4,842 | add | from GangaCore.Utility.logging import getLogger
from GangaCore.Core.exceptions import GangaValueError
logger = getLogger()
class PluginManagerError(GangaValueError):
def __init__(self, x):
super(PluginManagerError, self).__init__(self, x)
# Simple Ganga Plugin Mechanism
#
# Any object may be registered ... |
4,843 | close | #!/usr/bin/env python3
# -*- 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 ... |
4,844 | get reports by table | import json
import requests
from django.conf import settings
from django.db import transaction
from django.db.models import Q
from django.http import HttpResponse
from django.template import loader
from django.utils.translation import gettext as _
from django.views.decorators.cache import cache_control
from django.vie... |
4,845 | reset queue manager process match | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import threading
from six import iteritems
from datadog_checks.base import AgentCheck
from datadog_checks.ibm_mq.collectors.stats_collector import StatsCollector
from datadog_checks.ibm_mq.metrics import... |
4,846 | set name | #
# Copyright (c) 2008--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
4,847 | call tir dyn | # 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... |
4,848 | load usage markdown | import operator
from collections import defaultdict
from aiohttp_jinja2 import template
from app.service.auth_svc import check_authorization
from app.utility.base_world import BaseWorld
class CampaignPack(BaseWorld):
def __init__(self, services):
self.auth_svc = services.get('auth_svc')
self.ap... |
4,849 | test quadratic form | """
Copyright 2013 Steven Diamond
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... |
4,850 | encode | # Copyright 2021 The OpenAI Team Authors.
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
#
# The implementation here is modified based on OpenAI CLIP,
# originally MIT License, Copyright (c) 2021 OpenAI,
# and publicly available at https://github.com/openai/CLIP/.
""" CLIP Token... |
4,851 | test struct abi | import pytest
from vyper.compiler import compile_code
from vyper.compiler.output import build_abi_output
from vyper.compiler.phases import CompilerData
source_codes = [
"""
x: int128
@external
def __init__():
self.x = 1
""",
"""
x: int128
@external
def __init__():
pass
""",
]
@pytest.mark.... |
4,852 | test bad content | #!/usr/bin/env python3
"""Test fctl FAUCET CLI utility."""
# Copyright (C) 2015 Brad Cowie, Christopher Lorier and Joe Stringer.
# Copyright (C) 2015 Research and Innovation Advanced Network New Zealand Ltd.
# Copyright (C) 2015--2019 The Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License")... |
4,853 | awooify | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# CatUserBot #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Copyright (C) 2020-2023 by TgCatUB@Github.
# This file is part of: https://github.com/TgCatUB/catuserbot
# and is released under the "GNU v3.0 License Agreement".
# Please see: https://github.com/TgCatUB/catuserbot/blob/... |
4,854 | js e local global negative paired | import itertools
import numpy as np
import torch
import torch.nn.functional as F
import torch.nn as nn
def JSE_loss(zs, zs_n=None, batch=None, sigma=None, neg_by_crpt=False, **kwargs):
'''The Jensen-Shannon Estimator of Mutual Information used in contrastive learning. The
implementation follows the paper `Lea... |
4,855 | grouper | #!/usr/bin/env python
# coding utf-8
from asyncio import BoundedSemaphore, Queue, gather, get_event_loop
from concurrent.futures import ProcessPoolExecutor
from logging import getLogger
from types import GeneratorType
from typing import Any, Callable, Dict, Optional
from aioitertools import enumerate
from tqdm.auto i... |
4,856 | init num samples | # Copyright 2023 The DLRover 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 applicable law o... |
4,857 | is local | """Interface to the compiler's internal symbol tables"""
import _symtable
from _symtable import (USE, DEF_GLOBAL, DEF_LOCAL, DEF_PARAM,
DEF_IMPORT, DEF_BOUND, DEF_ANNOT, SCOPE_OFF, SCOPE_MASK, FREE,
LOCAL, GLOBAL_IMPLICIT, GLOBAL_EXPLICIT, CELL)
import weakref
__all__ = ["symtable", "SymbolTable", "Class",... |
4,858 | clear | '''
Reusable tree structure, including a variant with a fast indexed lookup.
'''
from __future__ import annotations
from collections import deque
from typing import Callable, Deque, Dict, Generic, Iterable, List, Optional, TypeVar, Union
try:
from IPython.lib.pretty import PrettyPrinter # type: ignore
suppor... |
4,859 | configure | """
Copyright (c) 2018-2023 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... |
4,860 | test conv2d transpose dilation | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
4,861 | test linux webapp quick create kube | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
4,862 | test principal filter | from tests import testmodels
from tortoise.contrib import test
from tortoise.exceptions import IntegrityError, OperationalError
from tortoise.queryset import QuerySet
class TestOneToOneFieldWithUnique(test.TestCase):
async def test_principal__empty(self):
with self.assertRaises(IntegrityError):
... |
4,863 | test op translation to value error | # 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... |
4,864 | test composing v1 | # Copyright (C) 2018-2019 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distribute... |
4,865 | test format results without events | import elastalert.eql as eql
from elastalert import ElasticSearchClient
from unittest import mock
def test_format_request_without_eql():
assert eql.format_request({}) is None
assert eql.format_request({'query': {}}) is None
assert eql.format_request({'query': {'bool': {}}}) is None
assert eql.format_r... |
4,866 | xml | #!/usr/bin/env python
"""
_RESTFormatter_
A basic REST formatter. The formatter takes the data from the API call, turns it into the
appropriate format and sets the CherryPy header appropriately.
Could add YAML via http://pyyaml.org/
"""
from builtins import str
import json
from types import GeneratorType
from cher... |
4,867 | check health status | # Copyright 2023 The DLRover 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 applicable law o... |
4,868 | test manufacture delivery missing disposition | from expungeservice.models.disposition import DispositionCreator
from expungeservice.models.expungement_result import EligibilityStatus
from expungeservice.record_merger import RecordMerger
from tests.factories.charge_factory import ChargeFactory
from tests.models.test_charge import Dispositions
def test_manufacture_... |
4,869 | 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
# --------------------------------... |
4,870 | test decimal format | # Copyright 2021 The NetKet 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 applicable ... |
4,871 | teller3 | # 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 appli... |
4,872 | api update alias | import logging
import re
import xml
from urllib.parse import quote
from xml.dom.minidom import parseString
import aiohttp
from scriptworker.exceptions import ScriptWorkerTaskException
from scriptworker.utils import retry_async
from bouncerscript.constants import BOUNCER_LOCATION_PLATFORMS, NIGHTLY_VERSION_REGEX
log ... |
4,873 | target | from bayes_opt import BayesianOptimization
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib import mlab
from matplotlib import gridspec
# https://github.com/fmfn/BayesianOptimization/issues/18
def unique_rows(a):
"""
A functions to trim repeated rows that may appe... |
4,874 | user update | from FreeTAKServer.model.FTSModel.fts_protocol_object import FTSProtocolObject
#######################################################
#
# Contact.py
# Python implementation of the Class Contact
# Generated by Enterprise Architect
# Created on(FTSProtocolObject): 11-Feb-2020 11(FTSProtocolObject):08(FTSProtocolOb... |
4,875 | keys | # External compatible license
# taken from https://github.com/slezica/python-frozendict on March 14th 2014 (commit ID b27053e4d1)
#
# Copyright (c) 2012 Santiago Lezica
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
# documentation files (the "Software")... |
4,876 | get single google app publish config | import logging
log = logging.getLogger(__name__)
def _google_should_do_dry_run(task):
# Don't commit anything by default. Committed APKs can't be unpublished,
# unless you push a newer set of APKs.
return not task.get("commit", False)
def _handle_legacy_google_track(google_track):
if google_track =... |
4,877 | test agents details scanner id typeerror | '''
test agents
'''
import pytest
from tenable.errors import UnexpectedValueError
from ..checker import check
@pytest.mark.vcr()
def test_agents_list_scanner_id_typeerror(api):
'''
test to raise the exception when type of scanner_id is not as defined
'''
with pytest.raises(TypeError):
api.age... |
4,878 | certificate | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import annotations
import typing
from cryptography import x509
from cryptography.hazmat.primitives import serialization
f... |
4,879 | send data | #!/usr/bin/python3
import importlib
from typing import TYPE_CHECKING, Any, Dict, Generator, Optional, Tuple
import rospy
from serial import SerialException
from mil_usb_to_can.sub8.board import (
USBtoCANBoard,
)
# relative import causes import error with rosrun - GH-731
from mil_usb_to_can.sub8.utils import USB... |
4,880 | get | # -*- coding: utf-8 -*-
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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.
#
# ... |
4,881 | run const expr | # 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... |
4,882 | get enum includes | # ===============================================================================
# NAME: Port.py
#
# DESCRIPTION: This is a Port meta-model sort of class. It is
# contained within a Component class as a list
# of Port instances and is visited by the code
# generators.
#
# US... |
4,883 | brace expand words | #!/usr/bin/env python
from __future__ import print_function
"""
braces.py
NOTE: bash implements brace expansion in the braces.c file (835 lines). It
uses goto!
Possible optimization flags for CompoundWord:
- has Lit_LBrace, LitRBrace -- set during word_parse phase
- it if has both, then do _BraceDetect
- has Brace... |
4,884 | tags | # Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Classes and functions to manage package tags"""
import collections
import copy
from collections.abc import Mapping
impo... |
4,885 | convert | import os
import core.exceptions as ex
from utilities.converters import convert_size
from env import Env
from utilities.subsystems.zfs import Dataset
from core.objects.svcdict import KEYS
from core.capabilities import capabilities
from .. import KWS_POOLING
KEYWORDS = KWS_POOLING + [
{
"section": "fs",
... |
4,886 | test image create | from datetime import datetime
from plone.app.textfield import RichTextValue
from plone.namedfile.file import NamedFile
from plone.namedfile.file import NamedImage
from Products.CMFPlone.tests import dummy
from Products.CMFPlone.tests import PloneTestCase
AddPortalTopics = "Add portal topics"
class TestContentTypeSc... |
4,887 | load config | # encoding: utf-8
# type: ignore
from __future__ import print_function
import sys
from typing import Any, Optional, cast
import click
import paste.script # type: ignore
import routes # type: ignore
from paste.registry import Registry # type: ignore
from urllib.parse import urlparse
from ckan.config.middleware im... |
4,888 | test command pipe alert text | import json
import subprocess
import logging
import pytest
from unittest import mock
from elastalert.alerters.command import CommandAlerter
from elastalert.alerts import BasicMatchString
from elastalert.util import EAException
from tests.alerts_test import mock_rule
def test_command_getinfo():
# Test command as... |
4,889 | test kaleido fulljson | import plotly.io as pio
import plotly.io.kaleido
from contextlib import contextmanager
from io import BytesIO
from pathlib import Path
from unittest.mock import Mock
fig = {"layout": {"title": {"text": "figure title"}}}
def make_writeable_mocks():
"""Produce some mocks which we will use for testing the `write_im... |
4,890 | get tracked plugin assets and readings | # -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge-iot.readthedocs.io/
# FLEDGE_END
from functools import lru_cache
from aiohttp import web
from fledge.common.service_record import ServiceRecord
from fledge.common.storage_client.payload_builder import PayloadBuilder
from fledge.services.core.service_regist... |
4,891 | test dataset move | """
Tests for FeaturizedSamples class
"""
import os
import tempfile
import shutil
import deepchem as dc
def test_unlabelled():
current_dir = os.path.dirname(os.path.abspath(__file__))
input_file = os.path.join(current_dir, "../../data/tests/no_labels.csv")
featurizer = dc.feat.CircularFingerprint(size=10... |
4,892 | test comment many as artist | import os
from tests.base import ApiDBTestCase
from zou.app.utils import events
from zou.app.services import projects_service, tasks_service
from PIL import Image
class RouteTaskChangeTestCase(ApiDBTestCase):
def setUp(self):
super(RouteTaskChangeTestCase, self).setUp()
self.generate_fixture_... |
4,893 | set up | from grass.gunittest.case import TestCase
from grass.gunittest.main import test
from grass.gunittest.gmodules import SimpleModule
class TestVsurfrst(TestCase):
elevation = "elevation"
elevation_attrib = "elevation_attrib"
elevation_threads = "elevation_threads"
slope = "slope"
aspect = "aspect"
... |
4,894 | cb device ready | """
Copyright (c) 2018-2019 Arm Limited and affiliates.
SPDX-License-Identifier: Apache-2.0
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 re... |
4,895 | upgrade config | #!/usr/bin/python3.6
#
# Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates
#
# 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
#
# ... |
4,896 | description | #!/usr/bin/env python3
#
# This file is part of OpenMediaVault.
#
# @license http://www.gnu.org/licenses/gpl.html GPL Version 3
# @author Volker Theile <volker.theile@openmediavault.org>
# @copyright Copyright (c) 2009-2023 Volker Theile
#
# OpenMediaVault is free software: you can redistribute it and/or modify
# ... |
4,897 | attach volume | from cli.exceptions import OperationFailedError, ResourceNotFoundError
from utility.log import Log
log = Log(__name__)
class Node:
"""Interface to perform node operations"""
def __init__(self, name, cloud):
"""Initialize instance with provided details
Args:
name (str): Node name... |
4,898 | fct delta c9 constant | import flavio
import numpy as np
from flavio.classes import AuxiliaryQuantity, Implementation
from flavio.physics.bdecays.common import meson_quark
from flavio.physics.bdecays.wilsoncoefficients import wctot_dict
from flavio.physics.common import conjugate_par, conjugate_wc, add_dict
from flavio.config import config
#... |
4,899 | generator | """ Unit test for while and for loops"""
import unittest
class SimpleLoopTests(unittest.TestCase):
def test_for_in_range(self):
a = 0
b = 0
for i in range(5):
b = i
a +=1
self.assertEqual(a,5)
self.assertEqual(b, 4)
y = 0
for t in rang... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.