id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
14,700 | session cmd | import os
import re
import time
import aexpect
from avocado.utils import download
from virttest import error_context
from virttest import utils_misc
from virttest import data_dir
@error_context.context_aware
def run(test, params, env):
"""
KVM guest stop test:
1) Log into a guest
2) Check is HeavyLoa... |
14,701 | cgen | #
# QAPI helper library
#
# Copyright IBM, Corp. 2011
# Copyright (c) 2013-2018 Red Hat Inc.
#
# Authors:
# Anthony Liguori <aliguori@us.ibm.com>
# Markus Armbruster <armbru@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2.
# See the COPYING file in the top-level directory.
import re
f... |
14,702 | tokenize | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
import unit... |
14,703 | test directory listing | # Copyright (C) 2004-2014 Bastian Kleineidam
#
# 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 distr... |
14,704 | test brisk suggestions | import numpy as np
from sleap.info.feature_suggestions import (
FrameItem,
FrameGroupSet,
ItemStack,
FeatureSuggestionPipeline,
)
def test_frame_item(small_robot_mp4_vid):
item = FrameItem(video=small_robot_mp4_vid, frame_idx=12)
assert np.all(
item.get_raw_image(scale=1.0)[:15, :15, ... |
14,705 | partial declaration path | # Copyright 2014-2017 Insight Software Consortium.
# Copyright 2004-2009 Roman Yakovenko.
# Distributed under the Boost Software License, Version 1.0.
# See http://www.boost.org/LICENSE_1_0.txt
def declaration_path(decl):
"""
Returns a list of parent declarations names.
Args:
decl (declaration_t)... |
14,706 | test symmetry stem max first | # -*- coding: utf-8 -*-
# Copyright 2016-2023 The pyXem developers
#
# This file is part of pyXem.
#
# pyXem is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... |
14,707 | test network can reject unauthorized delegate node | from unittest import TestCase
import lamden.network
from tests.integration.mock.mocks_new import MOCK_FOUNDER_SK, MockNetwork
from lamden.crypto.wallet import Wallet
from lamden.crypto import transaction
from lamden.crypto import wallet
import zmq.asyncio
import asyncio
class TestMultiNode(TestCase):
def setUp(... |
14,708 | read as image | """Data recipe to transform input audio to Mel spectrograms"""
"""
This data recipe makes the following steps:
1. Reads audio file
2. Converts audio file to the Mel spectrogram
3. Save Mel spectrogram to .png image
4. Upload image dataset to DAI
Recipe is based on the Kaggle Freesound Audio Tagging 2019 challenge:
ht... |
14,709 | validate rights |
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -------------------------------------------------------------------... |
14,710 | json | # Copyright 2018-2022 contributors to the OpenLineage project
# SPDX-License-Identifier: Apache-2.0
import METHOD_NAME
import uuid
from datetime import datetime
import pytest
import pytz
from mock import MagicMock
from openlineage.airflow.utils import try_import_from_string
from pkg_resources import parse_version
from... |
14,711 | get | # -*- encoding: utf-8 -*-
"""
keri.app.configing module
"""
import json
import os
import cbor2 as cbor
import hjson
import msgpack
from hio.base import filing, doing
from .. import help
logger = help.ogler.getLogger()
def openCF(cls=None, filed=True, **kwa):
"""
Returns contextmanager generated by openFil... |
14,712 | check path | """A simple class for caching a pandas DataFrame."""
import os
import pandas as pd
class CacheError(Exception):
"""Problem fetching, saving, or retrieving cached data."""
class DataFrameCache:
"""Abstract base class for downloading, saving, and retrieving a DataFrame.
Abstract methods:
fetch: re... |
14,713 | read from file | #!/usr/bin/env python3
# Face.py - module for reading and parsing Scintilla.iface file
# Implemented 2000 by Neil Hodgson neilh@scintilla.org
# Released to the public domain.
# Requires Python 2.7 or later
def sanitiseLine(line):
if line[-1:] == '\n':
line = line[:-1]
if line.find("##") != -1:
line = line[:line.... |
14,714 | operator specification get config type name | #-------------------------------------------------------------------------------
# OperatorSpecification
#-------------------------------------------------------------------------------
class OperatorSpecificationAbstractAPI:
@staticmethod
def init_operator_specification_environment(object):
pass
@staticmethod
... |
14,715 | test runner unauthenticated | import pytest
import salt.netapi
from salt.exceptions import EauthAuthenticationError, SaltInvocationError
from tests.support.mock import patch
@pytest.fixture
def client(salt_minion, salt_sub_minion, client_config):
return salt.netapi.NetapiClient(client_config)
@pytest.mark.slow_test
def test_local(client, a... |
14,716 | artifact event | from collections import namedtuple
from queue import Queue
from sacred.observers.base import RunObserver
from sacred.utils import IntervalTimer
import traceback
import logging
logger = logging.getLogger(__name__)
WrappedEvent = namedtuple("WrappedEvent", "name args kwargs")
class QueueObserver(RunObserver):
"""... |
14,717 | numerator | """Implementation of :class:`FiniteField` class."""
from __future__ import annotations
import numbers
import random
from ..core import Dummy, integer_digits
from ..ntheory import factorint, is_primitive_root, isprime
from ..polys.polyerrors import CoercionFailedError
from .field import Field
from .groundtypes import... |
14,718 | fit | from typing import List
import numpy as np
from sklearn.base import TransformerMixin
HANDLED_FUNCTIONS = {}
class AxesArray(np.lib.mixins.NDArrayOperatorsMixin, np.ndarray):
"""A numpy-like array that keeps track of the meaning of its axes.
Parameters:
input_array (array-like): the data to create t... |
14,719 | model version properties | # 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... |
14,720 | main | """
TestCase: Cron Dataload Verification
DDC Engine: Alluxio
Steps:
1. create Dataset & Runtime
2. check if dataset is bound
3. check if PVC & PV is created
4. submit DataLoad CR
5. check dataload status
6. check if cronjob created
7. wait until DataLoad completes
8. check dataset cache percentage
9. create app pod
10.... |
14,721 | get redis metrics timeseries | import logging
import traceback
from msgpack import Unpacker
from settings import FULL_NAMESPACE
from skyline_functions import (
get_redis_conn, get_redis_conn_decoded, nonNegativeDerivative,
sort_timeseries)
# @added 20220808 - Task #2732: Prometheus to Skyline
# Branch #4300: prometheus
# ... |
14,722 | code comment block suffix | from talon import Context, Module, actions, settings
ctx = Context()
mod = Module()
ctx.matches = r"""
tag: user.scala
"""
# Scala Common Types
scala_common_types = {
"boolean": "Boolean",
"int": "Int",
"float": "Float",
"byte": "Byte",
"double": "Double",
"short": "Short",
"long": "Long",... |
14,723 | lon str | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @BEG@ week=6 sequence=4 name=shipdict no_validation=skip
# helpers - used for verbose mode only
# could have been implemented as static methods in Position
# but we had not seen that at the time
def d_m_s(f):
"""
make a float readable; e.g. transform 2.5 into... |
14,724 | convert | from __future__ import division
import os
import glob
import re
import matplotlib.pyplot as plt
import numpy as np
def _an_sort(collection):
"""Alphanumeric sort.
"""
def METHOD_NAME(text):
return int(text) if text.isdigit() else text
def alphanum_key(key):
return [METHOD_NAME(c) for... |
14,725 | test sql check table | #
# -*- coding: utf-8 -*-
#
# Copyright (c) 2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
14,726 | dist handle | import os
# toolchains options
ARCH='arm'
CPU='cortex-m7'
CROSS_TOOL='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK... |
14,727 | move | #!/usr/bin/python3
"""
Transforms the tree to an ostree layout
Creates a basic fs tree in OSTree layout[1] from scratch and then picks
the relevenat bits from the tree and moves them over.
Then uses `rpm-ostree compose` to transform a "normal" file system tree
into an OSTree conforming layout (see [1]). Among other t... |
14,728 | models | # 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) AutoRest Code Generator.
# Changes ... |
14,729 | test matmul basic | #!/usr/bin/env python3
# Copyright (c) 2021 CINN 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 r... |
14,730 | 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... |
14,731 | get extensions | import os
import shutil
import subprocess
import sys
from .kphp_builder import KphpBuilder
from .file_utils import error_can_be_ignored
class KphpRunOnce(KphpBuilder):
def __init__(self, php_script_path, artifacts_dir, working_dir, php_bin,
extra_include_dirs=None, vkext_dir=None, use_nocc=False... |
14,732 | to advisory | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# VulnerableCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/vulnerablecode for support or download.
# See https://aboutcode.org for mor... |
14,733 | get zones output | # 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... |
14,734 | test fixed holidays | # python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2... |
14,735 | reset attribute types | from xsdata.codegen.mixins import RelativeHandlerInterface
from xsdata.codegen.models import Attr
from xsdata.codegen.models import AttrType
from xsdata.codegen.models import Class
from xsdata.formats.converter import converter
from xsdata.logger import logger
from xsdata.models.enums import DataType
class SanitizeAt... |
14,736 | fixed2csv | #!/usr/bin/env python
from codecs import iterdecode
from collections import namedtuple
from io import StringIO
import agate
def METHOD_NAME(f, schema, output=None, skip_lines=0, **kwargs):
"""
Convert a fixed-width file to csv using a CSV-formatted schema description.
A schema CSV must start with a hea... |
14,737 | test pickle serializer warns about mismatched versions | import importlib
import sys
from pathlib import Path
from types import ModuleType
from typing import Generator
import pytest
from prefect.packaging.serializers import (
ImportSerializer,
PickleSerializer,
SourceSerializer,
)
def foo(return_val="foo"):
return return_val
@pytest.mark.parametrize(
... |
14,738 | max torque | # Copyright 1996-2023 Cyberbotics Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
14,739 | test kubernetes model | """
Copyright (c) 2021, 2023, Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""
import os
from base_test import BaseTestCase
from wlsdeploy.aliases.aliases import Aliases
from wlsdeploy.aliases.wlst_modes import WlstModes
from wlsde... |
14,740 | on 200 | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
14,741 | test spacy featurizer | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import numpy as np
import pytest
from rasa_nlu import training_data, config
from rasa_nlu.config import RasaNLUModelConfig
from rasa_nlu.tokenizers.mitie_toke... |
14,742 | update shopify status | import json
import os
from base64 import b64encode
from aiohttp import ClientSession
from api import invoices, models, utils
from api.exceptions import BitcartError
from api.ext.moneyformat import currency_table
SHOPIFY_ORDER_PREFIX = "shopify-"
SHOPIFY_KEYWORDS = ["bitcoin", "btc", "bitcartcc", "bitcart"]
class S... |
14,743 | filter contour | from fontTools.misc.arrayTools import pairwise
from fontTools.pens.filterPen import ContourFilterPen
__all__ = ["reversedContour", "ReverseContourPen"]
class ReverseContourPen(ContourFilterPen):
"""Filter pen that passes outline data to another pen, but reversing
the winding direction of all contours. Compo... |
14,744 | prepare img | # coding=utf-8
# Copyright 2022 The HuggingFace Inc. team.
#
# 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... |
14,745 | repository homepage url |
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://aboutcode.org for more inf... |
14,746 | test trace less than 1 error | #!/usr/bin/env python
# coding: utf-8
import numpy as np
from cleanlab.benchmarking import noise_generation
import pytest
seed = 0
np.random.seed(0)
def test_main_pipeline(
verbose=False,
n=10,
valid_noise_matrix=True,
frac_zero_noise_rates=0,
):
trace = 1.5
py = [0.1, 0.1, 0.2, 0.6]
K =... |
14,747 | patch reactor | ###############################################################################
#
# The MIT License (MIT)
#
# Copyright (c) typedef int GmbH
#
# 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 ... |
14,748 | test parsers have same output | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import bz2
import gzip
import lzma
import os
import unittest
from io import BytesIO
from typing import Iterator, Set,... |
14,749 | test ask command nl | import unittest
from parameterized import parameterized
import hedy
class TestsKeywordSuggestions(unittest.TestCase):
def test_self_command_print(self):
invalid_command = "print"
keywords_en_level_1 = hedy.get_suggestions_for_language('en', 1)
closest = hedy.closest_command(invalid_comm... |
14,750 | get server info3 | # coding: utf-8
# pylint: skip-file
from socket import socket, AF_INET, SOCK_DGRAM
import sys
import threading
import time
NUM_MASTERSERVERS = 4
MASTERSERVER_PORT = 8300
TIMEOUT = 2
SERVERTYPE_NORMAL = 0
SERVERTYPE_LEGACY = 1
PACKET_GETLIST = "\x20\x00\x00\x00\x00\x00\xff\xff\xff\xffreqt"
PACKET_GETLIST2 = "\x20\... |
14,751 | import aliases | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
14,752 | forward | # Copyright 2018 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "license... |
14,753 | create | from django.db.models import Q
from rest_framework import serializers
from api.models import Person, Photo
from api.serializers.photos import GroupedPhotosSerializer
from api.serializers.PhotosGroupedByDate import get_photos_ordered_by_date
from api.util import logger
class GroupedPersonPhotosSerializer(serializers.... |
14,754 | execute subprocess | """Signingscript general utility functions."""
import asyncio
import functools
import hashlib
import json
import logging
import os
from asyncio.subprocess import PIPE, STDOUT
from dataclasses import dataclass
from shutil import copyfile
from signingscript.exceptions import FailedSubprocess, SigningServerError, Signing... |
14,755 | get sh identity | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2023 Bitergia
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This ... |
14,756 | versionbits in alert file | #!/usr/bin/env python3
# Copyright (c) 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 version bits warning system.
Generate chains with block versions that appear to be signalling unknown
... |
14,757 | precompute decompositions | """Utility script that was used to precompute disk and sphere footprints in
terms of a series of small 3x3 (or 3x3x3) footprints.
This is a crude, brute force implementation that checks many combinations and
retains the one that has the minimum error between the composite footprint and
the desired one.
The generated ... |
14,758 | open shutter 2 | # -*- coding: utf-8 -*-
"""
Created on Mon Aug 14 11:00:00 2019
@author: Giovanni Orlando
"""
from nplab.instrument.serial_instrument import SerialInstrument
from nplab.instrument.shutter import Shutter
from nplab.ui.ui_tools import QuickControlBox
from nplab.utils.notified_property import NotifiedProperty
class Ardu... |
14,759 | test pair | """
:codeauthor: Rahul Handay <rahulha@saltstack.com>
"""
import pytest
import salt.modules.bluez_bluetooth as bluez
import salt.utils.validate.net
from salt.exceptions import CommandExecutionError
from tests.support.mock import MagicMock, patch
class MockBluetooth:
"""
Mock class for bluetooth
"""... |
14,760 | can be cancelled | # -*- coding: utf-8 -*-
#
# RERO ILS
# Copyright (C) 2019-2022 RERO
# Copyright (C) 2019-2022 UCLouvain
#
# 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, version 3 of the License.
#
# Thi... |
14,761 | entry points | # The standard library importlib.metadata returns duplicate entrypoints
# for all python versions up to and including 3.11
# https://github.com/python/importlib_metadata/issues/410#issuecomment-1304258228
# see PR https://github.com/asdf-format/asdf/pull/1260
# see issue https://github.com/asdf-format/asdf/issues/1254
... |
14,762 | unwrap | import io
import socket
import ssl
from ..exceptions import ProxySchemeUnsupported
from ..packages import six
SSL_BLOCKSIZE = 16384
class SSLTransport:
"""
The SSLTransport wraps an existing socket and establishes an SSL connection.
Contrary to Python's implementation of SSLSocket, it allows you to cha... |
14,763 | write recordio multipart | # Copyright 2020 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/
#
# or in the "license" file acc... |
14,764 | api update all transaction records | ################################################
# Authors: Markus Hofmeister (mh807@cam.ac.uk) #
# Date: 12 Oct 2022 #
################################################
from flask import Blueprint, request, jsonify
from agent.errorhandling.exceptions import InvalidInput
from agent.datai... |
14,765 | stats block day | import datetime
import os
from env import Env
from utilities.proc import call, which
from utilities.stats.provider import provider
today = datetime.datetime.today()
yesterday = today - datetime.timedelta(days=1)
class StatsProvider(provider.BaseStatsProviderUx):
"""Not yet implemented"""
pass
def sarfile(... |
14,766 | on validation error | #!/usr/bin/env python
# -*- coding: utf-8 -*-
## Copyright (C) 2021 University of Oxford
##
## This file is part of Cockpit.
##
## Cockpit is free software: you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation, either version 3 of... |
14,767 | arrange | from __future__ import annotations
from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import TYPE_CHECKING, ClassVar, Iterable, NamedTuple
from ._spatial_map import SpatialMap
from .geometry import Offset, Region, Size, Spacing
if TYPE_CHECKING:
from typing_extensions import TypeAl... |
14,768 | 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
# --------------------------------... |
14,769 | is list of simple types | from __future__ import annotations
import itertools
import logging
from pathlib import Path
from typing import Any
from yaml.scanner import ScannerError
from yaml import YAMLError
from checkov.common.parsers.json import parse as json_parse
from checkov.common.parsers.yaml import loader
from checkov.common.resource_c... |
14,770 | time transpile from large qasm backend with | # This code is part of Qiskit.
#
# (C) Copyright IBM 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 derivative wor... |
14,771 | test basic ufunc at | import pytest
import numpy as np
from numpy.testing import assert_array_equal
from numpy.core._multiarray_umath import (
_discover_array_parameters as discover_array_params, _get_sfloat_dtype)
SF = _get_sfloat_dtype()
class TestSFloat:
def _get_array(self, scaling, aligned=True):
if not aligned:
... |
14,772 | forward | import numpy as np
from scipy.fftpack import dct, idct
class UniformTimeLine():
def __init__(self, T0, T1, NT, options={'Output':False}):
"""
Parameter
---------
T0: the initial time
T1: the end time
NT: the number of time segments
"""
self.T0 = T0
... |
14,773 | do lists | #!/usr/bin/env python
import sys
import os
import datetime
pathsvc = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..'))
pathlib = os.path.join(pathsvc, "opensvc")
completion_fpath = os.path.join(pathsvc, "usr", "share", "bash_completion.d", "opensvc.sh")
sys.path.insert(0, pathlib)
import command... |
14,774 | test cell widths | import pytest
from firedrake import *
import thetis.utility as utility
import thetis.utility3d as utility3d
import numpy
@pytest.fixture(scope="module")
def mesh2d():
return UnitSquareMesh(5, 5)
@pytest.fixture(scope="module")
def mesh(mesh2d):
fs = utility.get_functionspace(mesh2d, 'CG', 1)
bathymetry_... |
14,775 | set backlight active | # SPDX-License-Identifier: GPL-2.0-or-later
from openrazer_daemon.dbus_services import endpoint
def set_led_effect_common(self, zone: str, effect: str) -> None:
driver_path = self.get_driver_path(zone + '_led_effect')
with open(driver_path, 'w') as driver_file:
driver_file.write(effect)
@endpoint(... |
14,776 | test mysql flow | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
14,777 | connection made | # -*- coding: utf-8 -*-
"""
twisted.network_down_detector.py
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A fully-functional connection-observer using twisted.
Works on Python 2.7 as well as on 3.6
This example demonstrates basic concept of connection observer - entity
that is fully responsible for:
- observing data coming from ... |
14,778 | can apply updates | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ ... |
14,779 | run pre sub test | import logging
import time
import random
from autotest.client.shared import error
from virttest import utils_test
from virttest.utils_test.qemu import migration
@error.context_aware
def run(test, params, env):
"""
KVM multi-host migration test:
Migration execution progress is described in documentation
... |
14,780 | test remote iterator using remote call op | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
14,781 | get next | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... |
14,782 | get project | from rest_framework import viewsets
from .models import ListModel
from . import serializers
from utils.page import MyPageNumberPagination
from rest_framework.filters import OrderingFilter
from django_filters.rest_framework import DjangoFilterBackend
from rest_framework.response import Response
from .filter import Filte... |
14,783 | test read and write via obspy | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
The audio wav.core test suite.
"""
import os
import numpy as np
import pytest
from obspy import Stream, Trace, read
from obspy.core.util import NamedTemporaryFile
from obspy.io.wav.core import WIDTH2DTYPE
class TestCore():
"""
Test cases for audio WAV suppor... |
14,784 | schedule multibox transform loc | # 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... |
14,785 | manipulator | #!/usr/bin/env python3
###############################################################################
# Copyright (c) Intel Corporation - All rights reserved. #
# This file is part of the LIBXSMM library. #
# ... |
14,786 | insert handler | from random import choice
import toga
from toga.constants import COLUMN, ROW
from toga.style import Pack
bee_movies = [
{
"year": 2008,
"title": "The Secret Life of Bees",
"rating": "7.3",
"genre": "Drama",
},
{
"year": 2007,
"title": "Bee Movie",
"r... |
14,787 | test preprocess | import asyncio
from datetime import datetime
import numpy as np
import plotly.graph_objects as pgo
import plotly.io as pio
import pytest
from ohsome_quality_api.indicators.mapping_saturation.indicator import (
MappingSaturation,
)
from tests.integrationtests.utils import oqapi_vcr
class TestCheckEdgeCases:
... |
14,788 | get nameservers | """Module provider for luadns"""
import json
import logging
from argparse import ArgumentParser
from typing import List
import requests
from lexicon.exceptions import AuthenticationError
from lexicon.interfaces import Provider as BaseProvider
LOGGER = logging.getLogger(__name__)
class Provider(BaseProvider):
"... |
14,789 | from pretrained | # 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... |
14,790 | test warn if model has overridden optimization | # Copyright The Lightning AI team.
#
# 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... |
14,791 | load function | from parsl.app.errors import RemoteExceptionWrapper
from parsl.data_provider.files import File
from parsl.utils import get_std_fname_mode
import traceback
import sys
import pickle
# This scripts executes a parsl function which is pickled in 3 files:
#
# exec_parsl_function.py map_file function_file result_file
#
# map... |
14,792 | build arguments schema | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
14,793 | exec test | import os
import signal
from virttest import libvirt_version
from virttest import utils_misc
from virttest import utils_sriov
from virttest import utils_vdpa
from virttest import virsh
from virttest.libvirt_xml import nodedev_xml
from virttest.libvirt_xml import vm_xml
from virttest.utils_libvirt import libvirt_pcico... |
14,794 | test active dims range | #!/usr/bin/env python3
import unittest
import torch
from gpytorch.kernels import SpectralMixtureKernel
class TestSpectralMixtureKernel(unittest.TestCase):
def create_kernel(self, num_dims, **kwargs):
return SpectralMixtureKernel(num_mixtures=5, ard_num_dims=num_dims, **kwargs)
def create_data_no_b... |
14,795 | get maximum overview level | # coding: utf-8
"""Manage overviews of a dataset."""
from functools import reduce
import operator
import click
from . import options
import rasterio
from rasterio.enums import _OverviewResampling as OverviewResampling
def build_handler(ctx, param, value):
if value:
try:
if '^' in value:
... |
14,796 | test no compiler | """Tests for distutils.msvc9compiler."""
import sys
import unittest
import os
from distutils.errors import DistutilsPlatformError
from distutils.tests import support
from test.test_support import run_unittest
# A manifest with the only assembly reference being the msvcrt assembly, so
# should have the assembly comple... |
14,797 | selectable off | from collections.abc import Sequence
import numpy as np
from fury.lib import (
CellPicker,
DataObject,
HardwareSelector,
PointPicker,
PropPicker,
WorldPointPicker,
numpy_support,
)
class PickingManager:
"""Picking Manager helps with picking 3D objects."""
def __init__(self, vert... |
14,798 | test mark scanner index complete with partial | # Copyright 2017 The Forseti Security 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 ap... |
14,799 | set up | import shutil
import os
import inspect
import unittest
#############################################################
# Import ResearcherTestCase before importing any FedBioMed Module
from testsupport.base_case import ResearcherTestCase
#############################################################
from fedbiomed.rese... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.