id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
14,500 | doit | #!/usr/bin/env python3
###############################################################################
# $Id$
#
# Project: OGR Python samples
# Purpose: Assemble polygon geometries from arcs fulled from an arc layer.
# Script is incomplete but shows use of many OGR features from
# Python.
# Author... |
14,501 | detect local database versions | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""This program fetches the latest version of the Lensfun database from the
Internet and places it on the local system. This way, the user can update the
database conveniently. Unfortunately, we have to take into account that the
Git database may have a too new format f... |
14,502 | test fingerprint changes due to config | import inspect
import os.path
import tempfile
from typing import Dict, Text, Any, Optional
from unittest.mock import Mock
from _pytest.monkeypatch import MonkeyPatch
import rasa.shared.utils.io
from rasa.core.policies.ted_policy import TEDPolicy
from rasa.engine.graph import ExecutionContext, GraphComponent
from rasa.... |
14,503 | write disk | import random
import re
import os
from avocado.core import exceptions
from avocado.utils import process
from virttest import error_context
from virttest import utils_misc
from virttest import env_process
from virttest import utils_numeric
@error_context.context_aware
def run(test, params, env):
"""
The foll... |
14,504 | test residue depth 1 a8 o | # Copyright 2018 by Francesco Gastaldello. All rights reserved.
#
# Converted by Francesco Gastaldello from an older unit test copyright 2002
# by Thomas Hamelryck.
#
# Merged related test files into one, by Joao Rodrigues (2020)
#
# This file is part of the Biopython distribution and governed by your
# choice of the "... |
14,505 | fetch resources | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import logging
import os
import oci.config
from c7n.actions import ActionRegistry
from c7n.filters import FilterRegistry
from c7n.manager import ResourceManager
from c7n.query import sources, MaxResourceLimit, TypeInfo
from c7n.utils impo... |
14,506 | name | # 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,507 | provision | """Sky backend interface."""
import typing
from typing import Dict, Generic, Optional
import sky
from sky.usage import usage_lib
from sky.utils import timeline
if typing.TYPE_CHECKING:
from sky import resources
from sky import task as task_lib
from sky.data import storage as storage_lib
Path = str
_Resou... |
14,508 | test read thread post updates unread notifications | from datetime import timedelta
from django.urls import reverse
from django.utils import timezone
from ...notifications.models import Notification
from .. import test
from .test_threads_api import ThreadsApiTestCase
class PostReadApiTests(ThreadsApiTestCase):
def setUp(self):
super().setUp()
sel... |
14,509 | set up | #
# @file TestL3Event.py
# @brief L3 Event unit tests
#
# @author Akiya Jouraku (Python conversion)
# @author Sarah Keating
#
# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
#
# DO NOT EDIT THIS FILE.
#
# This file was generated automatically by converting the file located at
# ... |
14,510 | add efi loader parameters | # Copyright (c) 2015 SUSE Linux GmbH. All rights reserved.
#
# This file is part of kiwi.
#
# kiwi 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 la... |
14,511 | start | #
# Support for the API of the multiprocessing package using threads
#
# multiprocessing/dummy/__init__.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
... |
14,512 | access provenance | from hs_access_control.models.privilege import UserResourcePrivilege, GroupResourcePrivilege, \
UserGroupPrivilege, GroupCommunityPrivilege
def coarse_permissions(u, r):
""" document the nature of permissions for resource r for user u """
results = []
# check raw user-resource privilege
if UserRe... |
14,513 | test prepare single qubit | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
14,514 | test initialize | #################################################################################
# WaterTAP Copyright (c) 2020-2023, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National Laboratory,
# National Renewable Energy Laboratory, and National Energy Technology
# Labo... |
14,515 | test eval preprocessing runs without errors | import datasets
from datasets import Dataset
import pytest
from transformers import AutoTokenizer
from primeqa.mrc.processors.preprocessors.eli5_fid import ELI5FiDPreprocessor
from tests.primeqa.mrc.common.base import UnitTest
class TestEli5Preprocessor(UnitTest):
@pytest.fixture(scope='session')
def eli5_exa... |
14,516 | patch server | import grpc
from ddtrace import Pin
from ddtrace import config
from ddtrace.internal.schema import schematize_service_name
from ddtrace.vendor.wrapt import wrap_function_wrapper as _w
from . import constants
from . import utils
from ..trace_utils import unwrap as _u
from .client_interceptor import create_client_inter... |
14,517 | on draw | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vispy: gallery 1
"""
Demonstrating a cloud of points.
"""
import numpy as np
from vispy import gloo
from vispy import app
from vispy.util.transforms import perspective, translate, rotate
vert = """
#version 120
// Uniforms
// ------------------------------------
unif... |
14,518 | build transitions array | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) OpenTX
#
# Based on code named
# th9x - http://code.google.com/p/th9x
# er9x - http://code.google.com/p/er9x
# gruvin9x - http://code.google.com/p/gruvin9x
#
# License GPLv2: http://www.gnu.org/licenses/gpl-2.0.html
#
# This program is free software... |
14,519 | get all details | # OpenVPN 3 Linux client -- Next generation OpenVPN client
#
# SPDX-License-Identifier: AGPL-3.0-only
#
# Copyright (C) 2019 - 2023 OpenVPN Inc <sales@openvpn.net>
# Copyright (C) 2019 - 2023 David Sommerseth <davids@openvpn.net>
#
##
# @file NetCfgManager.py
#
# @brief Python interface for the net.openvpn.v3.... |
14,520 | test canonical url | from collections import namedtuple
from unittest import mock
from councils.tests.factories import CouncilFactory
from data_finder.helpers import RoutingHelper
from django.core.management import call_command
from django.http import QueryDict
from django.test import TestCase
MockAddress = namedtuple(
"MockAddress",... |
14,521 | test connect url | from tests.test_helper import *
from braintree.test.nonces import Nonces
import sys
import urllib.parse as urlparse
class TestOAuthGateway(unittest.TestCase):
def setUp(self):
self.gateway = BraintreeGateway(
client_id="client_id$development$integration_client_id",
client_secret="cl... |
14,522 | test models artifact repo init with uc | from unittest import mock
from unittest.mock import Mock
import pytest
from mlflow import MlflowClient
from mlflow.entities.model_registry import ModelVersion
from mlflow.store.artifact.databricks_models_artifact_repo import DatabricksModelsArtifactRepository
from mlflow.store.artifact.models_artifact_repo import Mod... |
14,523 | test get view not found | import os
import pytest
from tempfile import TemporaryDirectory
from mindsdb.api.http.initialize import initialize_app
from mindsdb.migrations import migrate
from mindsdb.interfaces.storage import db
from mindsdb.utilities.config import Config
@pytest.fixture(scope="session", autouse=True)
def app():
old_minds_d... |
14,524 | openapi types | # Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations
from typing import List, Union, TYPE_CHECKING
from ... |
14,525 | sort function | # Copyright © 2021 Province of British Columbia
#
# 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 agr... |
14,526 | batches to batch | from __future__ import annotations
import functools
import itertools
import logging
import pickle
import typing as t
from typing import TYPE_CHECKING
from simple_di import Provide
from simple_di import inject
import bentoml
from ....exceptions import MissingDependencyException
from ...configuration.containers impor... |
14,527 | recv nowait | """Subinterpreters High Level Module."""
import time
import _xxsubinterpreters as _interpreters
# aliases:
from _xxsubinterpreters import (
ChannelError, ChannelNotFoundError, ChannelEmptyError,
is_shareable,
)
__all__ = [
'Interpreter', 'get_current', 'get_main', 'create', 'list_all',
'SendChannel'... |
14,528 | test returns matching loop | import asyncio
import pytest
from opentrons.util import async_helpers as subject
class TestAsyncContextManagerInThread:
"""Tests for `async_context_manager_in_thread()`."""
@staticmethod
def test_enters_and_exits() -> None:
"""It should enter and exit the given context manager appropriately, an... |
14,529 | test zero weights | # Copyright 2016 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,530 | init vault cluster | import time
from pathlib import Path
import hvac
import pulumi
import pulumi_vault as vault
from bridge.secrets.sops import read_yaml_secrets
from ol_infrastructure.lib.pulumi_helper import parse_stack
from ol_infrastructure.lib.vault import get_vault_provider
vault_config = pulumi.Config("vault_setup")
vault_server_... |
14,531 | test localtime daylight true dst true | import datetime
from email import utils
import test.support
import time
import unittest
import sys
import os.path
class DateTimeTests(unittest.TestCase):
datestring = 'Sun, 23 Sep 2001 20:10:55'
dateargs = (2001, 9, 23, 20, 10, 55)
offsetstring = ' -0700'
utcoffset = datetime.timedelta(hours=-7)
t... |
14,532 | request | import time
from datetime import datetime, timedelta
import backoff
import requests
import singer
from singer import metrics, utils
from requests.exceptions import ConnectionError
LOGGER = singer.get_logger()
class Server5xxError(Exception):
pass
class RateLimitError(Exception):
pass
class OutreachClien... |
14,533 | phis | '''Chemical Engineering Design Library (ChEDL). Utilities for process modeling.
Copyright (C) 2019, 2020 Caleb Bell <Caleb.Andrew.Bell@gmail.com>
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 wi... |
14,534 | test constructor | """Tests for Latex exporter"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import os.path
import re
import textwrap
from tempfile import TemporaryDirectory
from jinja2 import DictLoader
from nbformat import v4, write
from traitlets.config import Config
from .... |
14,535 | test render | from unittest.mock import patch
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from extras.models import IXAPI, ExportTemplate
from peering.models import AutonomousSystem
from utils.testing import MockedResponse
class ExportTemplateTest(TestCase):
@classmethod
de... |
14,536 | process args | from __future__ import absolute_import, division, print_function
import libtbx.phil
from libtbx.utils import Sorry, format_exception
import os
from six.moves import zip
op = os.path
class argument_interpreter(object):
def __init__(self,
master_phil=None,
home_scope=None,
argument_description... |
14,537 | test a line | """
Unit tests for stem.descriptor.microdescriptor.
"""
import unittest
import stem.descriptor
import stem.exit_policy
from stem.descriptor.microdescriptor import Microdescriptor
from test.unit.descriptor import get_resource
FIRST_ONION_KEY = """\
-----BEGIN RSA PUBLIC KEY-----
MIGJAoGBAMhPQtZPaxP3ukybV5LfofKQr20/l... |
14,538 | getautocommit | import decimal
from _typeshed import Incomplete, ReadableBuffer
from collections.abc import Sequence
from datetime import date, datetime, time
from types import TracebackType
from typing import Any, overload
from typing_extensions import Literal, TypeAlias
from .resultrow import ResultRow
apilevel: str
threadsafety: ... |
14,539 | remove nan or inf | # -*- coding: utf-8 -*-
# Copyright 2019 United Kingdom Research and Innovation
# Copyright 2019 The University of Manchester
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# htt... |
14,540 | load data | # pylint: disable=no-self-use
import os
import numpy as np
import pytest
from napari.layers import Image, Labels, Layer
from PartSegCore.mask.io_functions import LoadROIFromTIFF
from PartSegCore.napari_plugins.load_image import napari_get_reader as napari_get_reader_image
from PartSegCore.napari_plugins.load_mask_pr... |
14,541 | command executor | import logging
from typing import Awaitable, Optional, cast
from opentrons.types import Mount
from opentrons.protocol_api import labware
from opentrons_shared_data.labware.dev_types import LabwareDefinition
from robot_server.robot.calibration.pipette_offset.user_flow import (
PipetteOffsetCalibrationUserFlow,
)
fro... |
14,542 | translation store | import json
from typing import Optional
import pytest
from openfoodfacts.images import split_barcode
from robotoff.insights.question import (
CategoryQuestionFormatter,
LabelQuestionFormatter,
Question,
generate_selected_images,
get_display_image,
)
from robotoff.models import ProductInsight
from ... |
14,543 | extract data | # 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,544 | print memarr | #!/usr/bin/env python
# vim:sw=4 ts=4 et
# A version of examples/showxlat.c translated to Python.
# The script is not meant to be particularly useful, but it should
# demonstrate use of the libaddrxlat Python API.
#
# This file is in public domain.
from __future__ import print_function
import sys
import kdumpfile
im... |
14,545 | hparam column headers list | # Copyright 2023 IBM 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 writing, ... |
14,546 | collect tab points | from __future__ import absolute_import, division, print_function
from scitbx.source_generators.utils import join_open
from scitbx.source_generators.utils import write_this_is_auto_generated
import libtbx.load_env
import string
import os
from six.moves import range
this = "cctbx.source_generators.eltbx.generate_henke_c... |
14,547 | expected events | 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',
... |
14,548 | current | """Supervisor job manager."""
from collections.abc import Callable
from contextlib import contextmanager
from contextvars import ContextVar, Token
import logging
from typing import Any
from uuid import UUID, uuid4
from attrs import Attribute, define, field
from attrs.setters import convert as attr_convert, frozen, val... |
14,549 | test stake all | import pytest
from brownie import chain
# Set up gives each test Convex LP tokens
@pytest.fixture(scope="function", autouse=True)
def deposited(safe, curve, convex, threepool_lp, USDC):
amount = 50000 * 10 ** USDC.decimals()
curve.deposit(threepool_lp, amount, USDC)
amount = threepool_lp.balanceOf(safe)
... |
14,550 | get test value | """Provide a simple user friendly API to Aesara-managed memory."""
import copy
from contextlib import contextmanager
from functools import singledispatch
from typing import List, Optional
from aesara.graph.basic import Variable, _TypeType
from aesara.graph.utils import add_tag_trace
from aesara.link.basic import Cont... |
14,551 | test enum referenced constant | # coding=utf-8
# --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ... |
14,552 | get parreffilename | import json
import shutil
from pathlib import Path
from typing import Optional, Any
from timApp.auth.accesshelper import can_see_par_source
from timApp.document.docparagraph import DocParagraph, is_real_id
from timApp.document.document import Document
from timApp.document.documentparser import DocumentParser
from timA... |
14,553 | test set operating conditions | #################################################################################
# WaterTAP Copyright (c) 2020-2023, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National Laboratory,
# National Renewable Energy Laboratory, and National Energy Technology
# Labo... |
14,554 | test config runtime store | #!/usr/bin/python
import settestpath
# lots of useful util methods for building/tearing down
# test enviroments...
import testutils
from rhn.stringutils import ustr
from up2date_client import config
import unittest
test_up2date = "../etc-conf/up2date.config"
class TestConfig(unittest.TestCase):
def setUp(self... |
14,555 | test establish sse c copy sources unknown | ######################################################################
#
# File: test/unit/v0/test_copy_manager.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
from __future__ impo... |
14,556 | test retry project pipeline | """
GitLab API: https://docs.gitlab.com/ee/api/pipelines.html
"""
import pytest
import responses
from gitlab.v4.objects import (
ProjectPipeline,
ProjectPipelineTestReport,
ProjectPipelineTestReportSummary,
)
pipeline_content = {
"id": 46,
"project_id": 1,
"status": "pending",
"ref": "main... |
14,557 | post sync finished event | import logging
from zentral.core.events import register_event_type
from zentral.core.events.base import BaseEvent, EventMetadata, EventRequest
from zentral.core.queues import queues
logger = logging.getLogger('zentral.contrib.wsone.events')
ALL_EVENTS_SEARCH_DICT = {"tag": "wsone"}
# webhook events
class BaseWS... |
14,558 | quat2 pitch | import rospy
import threading
from math import asin, atan2, pi
from nav_msgs.msg import Odometry
def quat2Yaw(qw, qx, qy, qz):
'''
Translates from Quaternion to Yaw.
@param qw,qx,qy,qz: Quaternion values
@type qw,qx,qy,qz: float
@return Yaw value translated from Quaternion
'''
rotateZa... |
14,559 | instrument | # orm/scoping.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from .. import exc as sa_exc
from ..util import ScopedRegistry, ThreadLocalRegistry, ... |
14,560 | test invalid websocket protocol | import os
import time
import pytest
from jina import Client, Deployment, DocumentArray, Executor, requests
from jina._docarray import docarray_v2
from jina.helper import random_port
class SingleExecutorDeployment(Executor):
def __init__(self, init_sleep_time=0, *args, **kwargs):
super().__init__(*args, ... |
14,561 | announce post | from datetime import datetime, timedelta
from django.shortcuts import get_object_or_404, render, redirect
from authn.decorators.auth import require_auth, require_moderator_role, require_curator_role
from club.exceptions import AccessDenied
from comments.models import Comment
from common.data.labels import LABELS
from... |
14,562 | get sso cookie | #!/usr/bin/env python3
###Description: The tool reads cern web services behind SSO using user certificates
from __future__ import print_function
import os, urllib, urllib2, httplib, cookielib, sys, HTMLParser, re
from optparse import OptionParser
def getFile(path):
npath = os.path.expanduser(path)
while os.path.is... |
14,563 | wait for loaded | """
Module for providing common interface to test SLOF component.
Available functions:
- get_boot_content: Get the specified content of SLOF by reading the serial
log.
- wait_for_loaded: Wait for loading the SLOF.
- get_booted_devices: Get the device info which tried to load in the SLOF
... |
14,564 | main | '''
A script that benchmarks the queue performance, can be used to compare the performance
of the queue on a given branch vs the main branch. By default, runs 100 jobs in batches
of 20 and prints the average time per job. The inference time for each job (without the
network overhead of sending/receiving the data) is 0... |
14,565 | is converted same | # -*- coding: utf-8 -*-
# 3p
import mock
import unittest
import simplejson as json
# project
from emitter import (
remove_control_chars,
remove_undecodable_chars,
sanitize_payload,
serialize_and_compress_metrics_payload,
split_payload,
)
import os
FIXTURE_PATH = os.path.join(os.path.dirname(os.pa... |
14,566 | row fmt | from .pdg_format import _round, _strip
from iminuit._optional_dependencies import optional_module_for
import re
import numpy as np
def pdg_format(value, *errors):
if value is None:
strings, nexp = _round((0, *errors), None, None)
strings = strings[1:]
else:
strings, nexp = _round((valu... |
14,567 | test minimal config | # Copyright 2018 PerfKitBenchmarker 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... |
14,568 | register | # This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import numpy as np
from itertool... |
14,569 | get group users | from flask import current_app, g, jsonify, request
from flask_cors import cross_origin
from alerta.app import qb
from alerta.auth.decorators import permission
from alerta.exceptions import ApiError
from alerta.models.enums import Scope
from alerta.models.group import Group, GroupUsers
from alerta.models.user import Us... |
14,570 | info | # 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... |
14,571 | prepare values subset | #!/usr/bin/env python3
#
# USAGE: test_map_batch_ops.py
#
# Copyright (c) Emilien Gobillot
# Licensed under the Apache License, Version 2.0 (the "License")
from __future__ import print_function
from unittest import main, skipUnless, TestCase
from utils import kernel_version_ge
from bcc import BPF
import os
import cty... |
14,572 | shutdown | """
Proxy Minion to manage Cisco Nexus Switches (NX-OS) over the NX-API
.. versionadded:: 2019.2.0
Proxy module for managing Cisco Nexus switches via the NX-API.
:codeauthor: Mircea Ulinic <ping@mirceaulinic.net>
:maturity: new
:platform: any
Usage
=====
.. note::
To be able to use this module you need to... |
14,573 | test allocation | from tests.utilities.utilities import (
async_return,
run_async,
set_awaitable_return_value,
)
from tardis.interfaces.plugin import Plugin
from tardis.interfaces.siteadapter import ResourceStatus
from tardis.interfaces.state import State
from tardis.resources.drone import Drone
from tardis.resources.drones... |
14,574 | test process control | """test the IPython Kernel"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import asyncio
import os
import warnings
import pytest
if os.name == "nt":
pytest.skip("skipping tests on windows", allow_module_level=True)
async def test_direct_kernel_info_requ... |
14,575 | set log level |
import pathlib
from contextlib import contextmanager
from twisted.logger import (
FileLogObserver,
LogLevel,
formatEvent,
formatEventAsClassicLogText,
globalLogPublisher,
jsonFileLogObserver,
)
from twisted.logger import Logger as TwistedLogger
from twisted.python.logfile import LogFile
imp... |
14,576 | http log | #!/usr/bin/python
import sys
import json
import os
import argparse
columns = [
'count',
't_sum',
't_avg',
'operation',
'key'
]
parser = argparse.ArgumentParser()
parser.add_argument("--hide", choices=['count', 't_sum','t_avg','key'], nargs='... |
14,577 | hook | from __future__ import annotations
import pathlib
import urllib.parse
from typing import Any, Iterator, Sequence
from airflow.providers.google.suite.hooks.drive import GoogleDriveHook
from astro.constants import FileLocation
from astro.files.locations.base import BaseFileLocation
def _quote(s: str) -> str:
s =... |
14,578 | test dunder string | # pylint: disable=redefined-outer-name
from __future__ import annotations
import asyncio
import time
from pathlib import Path
import pytest
import bentoml
from bentoml.testing.utils import async_request
@pytest.mark.asyncio
async def test_api_server_load(host: str):
for _ in range(20):
status, _, _ = ... |
14,579 | get table | # 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,580 | test concat axis0 | import warnings
import pandas as pd
import pytest
from geopandas.testing import assert_geodataframe_equal
from pandas.testing import assert_index_equal
from shapely.geometry import Point
from geopandas import GeoDataFrame, GeoSeries
class TestMerging:
def setup_method(self):
self.gseries = GeoSeries([P... |
14,581 | main | #
# Copyright 2019 The FATE Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
14,582 | watch loop | import asyncio
import os
import sys
import zlib
from typing import Any, Callable, Dict, List, Optional
from tomodachi import logging
from tomodachi.options import Options
def crc(file_path: str) -> str:
prev = 0
with open(file_path, "rb") as f:
for line in f:
prev = zlib.crc32(line, prev)... |
14,583 | visit event | #!/usr/bin/env python3
#
# QAPI parser test harness
#
# Copyright (c) 2013 Red Hat Inc.
#
# Authors:
# Markus Armbruster <armbru@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2 or later.
# See the COPYING file in the top-level directory.
#
import argparse
import difflib
import os
impo... |
14,584 | optionxform | # vim: ft=python fileencoding=utf-8 sw=4 et sts=4
"""Provides functions and signals to handle a shared trash directory.
The functions delete and undeletes images from the user's Trash directory
in $XDG_DATA_HOME/Trash according to the freedesktop.org trash specification.
Module Attributes:
_files_directory: Path... |
14,585 | move one closer | from __future__ import annotations
from enum import Enum
from typing import TYPE_CHECKING
from .. import buttons
if TYPE_CHECKING:
from trezorlib.debuglink import DebugLink, LayoutContent
# Passphrases and addresses for both models
class CommonPass:
RANDOM_25 = "Y@14lw%p)JN@f54MYvys@zj'g"
RANDOM_25_ADD... |
14,586 | datasource | # 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,587 | test flatpak old | import subprocess
from unittest import mock
import pytest
from briefcase.exceptions import BriefcaseCommandError, UnsupportedHostError
from briefcase.integrations.flatpak import Flatpak
def test_short_circuit(mock_tools):
"""Tool is not created if already cached."""
mock_tools.flatpak = "tool"
tool = F... |
14,588 | train method2 | import logging
from mxnet import npx
from fedml.core import ClientTrainer
import mxnet as mx
from mxnet import gluon, autograd
from mxnet import nd
class MxModelTrainerCLS(ClientTrainer):
static_model = None
static_optimizer = None
npx.set_np()
def __init__(self, model, args):
super().__init... |
14,589 | verify simulated quantize | # 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,590 | create link | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
14,591 | test ravel broadcasted | import numpy
import pytest
import cupy
from cupy import testing
@pytest.mark.parametrize('shape', [(2, 3), (), (4,)])
class TestShape:
def test_shape(self, shape):
for xp in (numpy, cupy):
a = testing.shaped_arange(shape, xp)
assert cupy.shape(a) == shape
def test_shape_list... |
14,592 | status | # 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,593 | test new style bit equality | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
14,594 | setup particle fields | import numpy as np
from yt._typing import KnownFieldsT
from yt.fields.field_info_container import FieldInfoContainer
from yt.units.yt_array import YTArray
from yt.utilities.physical_constants import amu_cgs, boltzmann_constant_cgs
b_units = "code_magnetic"
ra_units = "code_length / code_time**2"
rho_units = "code_mas... |
14,595 | 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,596 | set gpio offset | # sfputil.py
#
# Platform-specific SFP transceiver interface for SONiC
#
import os
try:
import time
from sonic_sfp.sfputilbase import SfpUtilBase
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))
class SfpUtil(SfpUtilBase):
"""Platform-specific SfpUtil class"""
... |
14,597 | test ret const | # 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,598 | expand settings panel | import functools
import socket
import struct
import time
import module.device.method.scrcpy.const as const
def inject(control_type: int):
"""
Inject control code, with this inject, we will be able to do unit test
Args:
control_type: event to send, TYPE_*
"""
def wrapper(f):
@fun... |
14,599 | get authn by accr | from saml2 import extension_elements_to_elements
from saml2.authn_context import ippword
from saml2.authn_context import mobiletwofactor
from saml2.authn_context import ppt
from saml2.authn_context import pword
from saml2.authn_context import sslcert
from saml2.saml import AuthnContext
from saml2.saml import AuthnConte... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.