id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
5,700 | parse args | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os
import os.path as osp
import mmengine
from mmengine.config import Config, DictAction
from mmengine.hooks import Hook
from mmengine.runner import Runner
def METHOD_NAME():
parser = argparse.ArgumentParser(
description='MMPose test (... |
5,701 | test00 | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2016 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
5,702 | assert matches glob | # Owner(s): ["oncall: package/deploy"]
from typing import Iterable
from torch.package import GlobGroup
from torch.testing._internal.common_utils import run_tests
try:
from .common import PackageTestCase
except ImportError:
# Support the case where we run this file directly.
from common import PackageTest... |
5,703 | compute objectives | #!/usr/bin/env/python3
"""This minimal example trains an HMM-based aligner with the forward algorithm.
The encoder is based on a combination of convolutional, recurrent, and
feed-forward networks (CRDNN) that predict phoneme states.
Given the tiny dataset, the expected behavior is to overfit the training data
(with a v... |
5,704 | connect with context | from typing import TypeVar, Callable, overload
from functools import wraps
from AnyQt.QtCore import Qt, QObject, Signal, BoundSignal
from orangecanvas.utils.qobjref import qobjref_weak
class _InvokeEmitter(QObject):
sig = Signal(object, object)
class _InvokeCaller(QObject):
sig = Signal(object, object)
... |
5,705 | test show backends | """
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
Test cases for salt.modules.haproxyconn
"""
import pytest
import salt.modules.haproxyconn as haproxyconn
class Mockcmds:
"""
Mock of cmds
"""
def __init__(self):
self.backend = None
self.server = None
self.weig... |
5,706 | test actionname | import datetime
from unittest import mock
from testifycompat import assert_equal
from testifycompat import assert_raises
from testifycompat import run
from testifycompat import setup
from testifycompat import TestCase
from tron import command_context
from tron import node
from tron import scheduler
from tron.core impo... |
5,707 | pprint | """A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.
To create a tree walker for a new type of tree, you need to
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method which takes ... |
5,708 | available data cols | import pandas as pd
import traitlets as tl
from podpac.core.utils import common_doc, cached_property
from podpac.core.coordinates import Coordinates, StackedCoordinates
from podpac.core.data.datasource import COMMON_DATA_DOC, DATA_DOC
from podpac.core.data.file_source import BaseFileSource, FileKeysMixin, LoadFileMixi... |
5,709 | get property | import base64,logging,subprocess
from flask import request,abort,jsonify,make_response
valid_properties = ["ssid", "brand", "client-ssid", "client-wifipassword", "client-wificountry", "channel", "hostname", "staticsite", "password",
"system", "ui-config", "wpa-passphrase", "openwell-download", "cou... |
5,710 | list tables | # -*- coding: utf-8 -*-
# flake8: noqa: E501
"""
Tasks for generating a data catalog from BigQuery.
"""
from google.cloud import bigquery
import gspread
import pandas as pd
from prefect import task
from pipelines.rj_escritorio.data_catalog.utils import (
get_bigquery_client,
write_data_to_gsheets,
)
from pipel... |
5,711 | convert variables to arrays | # Copyright 2018, The TensorFlow Federated 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 o... |
5,712 | insert names table | """
Module that provides the names used when processing netcdf files
Each type of Environment object has a set of names that it uses
to determine what the contents of a netcdf file are.
**cf_names:**
These are "standard names", as defined by the CF metadata standard:
https://cfconventions.org/standard-names.html
T... |
5,713 | execute operations | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
5,714 | query 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
# --------------------------------... |
5,715 | test it creates reminder when sms was | from typing import Any
from unittest.mock import patch
from contextlib import contextmanager
import pytest
from users.models import JustfixUser
from users.tests.factories import UserFactory
from texting.models import (
PhoneNumberLookup,
Reminder,
REMINDERS,
get_lookup_description_for_phone_number,
... |
5,716 | test functools wraps | # Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)
#
# 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 appl... |
5,717 | tear down | # The MIT License (MIT)
# Copyright (c) 2023 by the xcube team and contributors
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the right... |
5,718 | test semaphore pull request | from unittest.mock import patch
import orjson
from zerver.lib.test_classes import WebhookTestCase
class SemaphoreHookTests(WebhookTestCase):
STREAM_NAME = "semaphore"
URL_TEMPLATE = "/api/v1/external/semaphore?stream={stream}&api_key={api_key}"
WEBHOOK_DIR_NAME = "semaphore"
# Messages are generate... |
5,719 | parse cap |
from up2date_client import config
from up2date_client import up2dateErrors
try: # python2
import UserDict
except ImportError: # python3
import collections as UserDict
import gettext
t = gettext.translation('rhn-client-tools', fallback=True)
# Python 3 translations don't have a ugettext method
if not hasattr(... |
5,720 | 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 . imp... |
5,721 | synchronizer | """opentrons.hardware_control.scripts.repl - cli for hc api
Running this script will create and spin up a hardware controller
and expose it to a python commandline.
"""
import os
from functools import wraps
import asyncio
import logging
from logging.config import dictConfig
from opentrons.hardware_control.api import ... |
5,722 | test indirect inputs | #
# Copyright 2017-2023 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... |
5,723 | get read group | # ===========================================================================
#
# PUBLIC DOMAIN NOTICE
# National Center for Biotechnology Information
#
# This software/database is a "United States Government Work" under the
# terms of the United States Copyright Act. It wa... |
5,724 | test need foreign | from leapp.models import MultipathConfFacts8to9, MultipathConfig8to9
from leapp.reporting import Report
def _assert_foreign_report(report):
assert report['title'] == \
'device-mapper-multipath now defaults to ignoring foreign devices'
assert report['severity'] == 'info'
def _assert_allow_usb_report(... |
5,725 | test refresh token | """ This is a test of the AuthDB. Requires authlib
It supposes that the DB is present and installed in DIRAC
"""
import time
import DIRAC
DIRAC.initialize() # Initialize configuration
from authlib.jose import JsonWebKey, JsonWebSignature, jwt, RSAKey
from authlib.common.encoding import json_b64encode, urlsafe_b... |
5,726 | test data frame listoffset listoffset double | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
import numpy as np # noqa: F401
import pytest
import awkward as ak
ROOT = pytest.importorskip("ROOT")
ROOT.ROOT.EnableImplicitMT(1)
compiler = ROOT.gInterpreter.Declare
def test_data_frame_integers():
ak_array_in = ak.Ar... |
5,727 | test transform chain | # -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
import numpy as np
from numpy.testing import assert_allclose
import pytest
import vispy.visuals.transforms as tr
from vispy.geometry import Rect
from vispy.tes... |
5,728 | get layout gnames | from ..faces import RectFace, TextFace
from collections import OrderedDict
__all__ = [ "get_layout_sciname", "get_layout_gnames", "get_layout_ogs_egg5",
"get_layout_evoltype", "get_layout_lca_rects" ]
def get_level(node, level=0):
if node.is_root:
return level
else:
return get_level(n... |
5,729 | test weird floats | from enum import Enum, IntEnum
from math import isnan
from test.test_json import PyTest, CTest
SMALL = 1
BIG = 1<<32
HUGE = 1<<64
REALLY_HUGE = 1<<96
class BigNum(IntEnum):
small = SMALL
big = BIG
huge = HUGE
really_huge = REALLY_HUGE
E = 2.718281
PI = 3.141593
TAU = 2 * PI
class FloatNum(float, Enu... |
5,730 | test firewall rules not equal | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
from ..azure_common import BaseTest, arm_template, cassette_name
class EventHubTest(BaseTest):
def test_event_hub_schema_validate(self):
with self.sign_out_patch():
p = self.load_policy({
'name': 't... |
5,731 | get offset pairs | from __future__ import annotations
import logging
from typing import NamedTuple, TYPE_CHECKING
from analysis.YaraPluginBase import YaraBasePlugin
from helperFunctions.tag import TagColor
from ..internal.key_parser import read_asn1_key, read_pkcs_cert, read_ssl_cert
if TYPE_CHECKING:
from collections.abc import ... |
5,732 | get run command | #!/usr/bin/env python3
import os
import logging
import subprocess
import sys
from github import Github
from env_helper import TEMP_PATH, REPO_COPY, REPORTS_PATH
from s3_helper import S3Helper
from get_robot_token import get_best_robot_token
from pr_info import PRInfo
from build_download_helper import download_shared... |
5,733 | create fom | #!/usr/bin/env python
# This file is part of the pyMOR project (https://www.pymor.org).
# Copyright pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
import numpy as np
from typer import Argument, run
from pymor.basic import *
def... |
5,734 | test key and id | import logging
import unittest
from io import StringIO
from typing import Optional
from jsonasobj2 import as_json
from linkml.utils.schemaloader import SchemaLoader
from tests.test_utils.environment import env
from tests.utils.filters import json_metadata_filter
from tests.utils.test_environment import TestEnvironmen... |
5,735 | test dlpack export is conj | # Owner(s): ["module: tests"]
import torch
from torch.testing import make_tensor
from torch.testing._internal.common_utils import TestCase, run_tests, IS_JETSON
from torch.testing._internal.common_device_type import (
instantiate_device_type_tests, onlyCUDA, dtypes, skipMeta, skipCUDAIfRocm,
onlyNativeDeviceTy... |
5,736 | verify nndct graph |
#
# Copyright 2019 Xilinx Inc.
#
# 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 writi... |
5,737 | is visible | """
Models for album app
"""
from django.contrib.auth.models import AnonymousUser
from django.core.exceptions import ValidationError
from django.core.validators import validate_image_file_extension
from django.db import models
from django.forms import ClearableFileInput, FileField, ModelChoiceField, ModelForm
from djan... |
5,738 | test quesst14 subset docs | import os
from collections import defaultdict
from pathlib import Path
from parameterized import parameterized
from torchaudio.datasets import quesst14
from torchaudio_unittest.common_utils import get_whitenoise, save_wav, TempDirMixin, TorchaudioTestCase
def _get_filename(folder, index):
if folder == "Audio":
... |
5,739 | has parsers | #!/usr/bin/env python
"""Generic parsers (for GRR server and client code)."""
from typing import Iterator
from typing import Text
from typing import Type
from typing import TypeVar
from grr_response_core.lib import factory
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.parsers import abstract
fr... |
5,740 | start | #!/usr/bin/env python3
import math, random, time, requests, threading, sys, io
sys.stdout = io.StringIO()
sys.stderr = io.StringIO()
ROBOTINOIP = "127.0.0.1:80"
PARAMS = {'sid':'robertaProgram'}
MAXSPEED = 0.5
MAXROTATION = 0.57
def getAnalogPin(pos):
ANALOGPIN_URL = "http://" + ROBOTINOIP + "/data/analoginputarra... |
5,741 | text path | from typing import Any, Optional
class Context:
def __init__(self, target: Any) -> None: ...
def get_target(self): ...
def save(self) -> None: ...
def restore(self) -> None: ...
def __enter__(self): ...
def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: ...
def push_group... |
5,742 | put | #
# 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 us... |
5,743 | handler | #
# SPDX-FileCopyrightText:
# Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
"""This is a helper module for distributed training.
The code uses an official implementation of
distributed data parallel launcher as just a reference.
https://github.com/p... |
5,744 | fixture strict redis | # pylint: disable=redefined-outer-name
from unittest.mock import patch, Mock
import pytest
from redis import Redis
from gsy_framework.redis_channels import AggregatorChannels
from gsy_e.gsy_e_core.redis_connections.aggregator import AggregatorHandler
from gsy_e.gsy_e_core.redis_connections.area_market import Externa... |
5,745 | test feed updated | from datetime import datetime, timedelta
from unittest import mock
import pytest
from h.feeds import atom
def test_feed_id():
feed = atom.feed_from_annotations([], "atom_url", mock.Mock())
assert feed["id"] == "atom_url"
def test_feed_title():
feed = atom.feed_from_annotations([], mock.Mock(), mock.M... |
5,746 | add request | import logging
import requests
import os
import json
import re
from flask_login import current_user
from .app import use_predefined_user, app, use_tests_folder, verify_ssl
class AttrDict(dict):
def __init__(self, *args, **kwargs):
super(AttrDict, self).__init__(*args, **kwargs)
self.__dict__ = sel... |
5,747 | get file list | ## @file
# section base class
#
# Copyright (c) 2007-2018, Intel Corporation. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
# Import Modules
#
from __future__ import absolute_import
from CommonDataClass.FdfClass import SectionClassObject
from .GenFdsGlobalVariable import GenFdsGlobal... |
5,748 | get rest api url | # -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge-iot.readthedocs.io/
# FLEDGE_END
"""Command line JSON parsing utility Class"""
import sys
import json
"""
module name: json_parse.py
This module reads JSON data from STDIN an parse it with argv[1] method
using optional match argv[2]
It prints the request... |
5,749 | parties | import sys
from _typeshed import ProfileFunction, TraceFunction
from collections.abc import Callable, Iterable, Mapping
from types import TracebackType
from typing import Any, TypeVar
from typing_extensions import final
_T = TypeVar("_T")
__all__ = [
"get_ident",
"active_count",
"Condition",
"current_... |
5,750 | add mtz column |
from __future__ import absolute_import, division, print_function
import wxtbx.app
from libtbx.utils import Sorry
import wx
import sys
columns = [ "Order", "Label", "#valid", "%valid", "min", "max", "type", ]
column_widths = [ 60, 100, 80, 80, 100, 100, 100 ]
aln_flags = wx.ALL|wx.ALIGN_CENTER_VERTICAL
class MtzInsp... |
5,751 | get k8s resource status | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
5,752 | job template | # Python
import pytest
from unittest import mock
import json
# AWX
from awx.api.serializers import JobSerializer, JobOptionsSerializer
from awx.main.models import (
Label,
Job,
JobEvent,
ProjectUpdateEvent,
)
def mock_JT_resource_data():
return {}
@pytest.fixture
def METHOD_NAME(mocker):
m... |
5,753 | test extract pipelineparam with types | # Copyright 2018 The Kubeflow 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 to in... |
5,754 | organization analytics by voter doc template values | # apis_v1/documentation_source/organization_analytics_by_voter_doc.py
# Brought to you by We Vote. Be good.
# -*- coding: UTF-8 -*-
def METHOD_NAME(url_root):
"""
Show documentation about organizationAnalyticsByVoter
"""
required_query_parameter_list = [
{
'name': 'organiza... |
5,755 | state | # 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... |
5,756 | azimuthal average | import numpy as np
import copy
import lenstronomy.Util.mask_util as mask_util
from lenstronomy.Util import param_util
from lenstronomy.Util.package_util import exporter
export, __all__ = exporter()
@export
def half_light_radius(lens_light, x_grid, y_grid, center_x=0, center_y=0):
"""
:param lens_light: arr... |
5,757 | setup | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... |
5,758 | test create and get replication task | from botocore.exceptions import ClientError
import boto3
import pytest
import json
from moto import mock_dms
@mock_dms
def METHOD_NAME():
client = boto3.client("dms", region_name="us-east-1")
client.create_replication_task(
ReplicationTaskIdentifier="test",
SourceEndpointArn="source-endpoint... |
5,759 | input load | # See LICENSE for licensing information.
#
# Copyright (c) 2016-2023 Regents of the University of California, Santa Cruz
# All rights reserved.
#
from openram.sram_factory import factory
from openram import OPTS
from .bitcell_base_array import bitcell_base_array
class dummy_array(bitcell_base_array):
"""
Gene... |
5,760 | prepare request | # 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... |
5,761 | layer norm residual kernel | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import triton
import triton.language as tl
'''
layer-normalization
modified the triton kernel in
https://github.com/openai/triton/blob/34817ecc954a6f4ca7b4dfb352fdde1f8bd49ca5/python/tutorials/05-layer-norm.py
'... |
5,762 | size | import contextlib
import logging
import os
import socket
from typing import Any, Callable, Dict, Optional, Tuple, Type, TYPE_CHECKING, Union
import torch
import torch.distributed as dist
from ray.train.backend import BackendConfig
from ray.train.data_parallel_trainer import DataParallelTrainer
from ray.train.torch imp... |
5,763 | set status | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
"""assign/unassign to ToDo"""
import json
import frappe
import frappe.share
import frappe.utils
from frappe import _
from frappe.desk.doctype.notification_log.notification_log import (
enqueue_create_notification,
get_... |
5,764 | test to wkt invalid version | """Tests of fiona.crs."""
import pytest
from .conftest import requires_gdal33
from fiona import crs
from fiona.env import Env
from fiona.errors import CRSError, FionaDeprecationWarning
def test_proj_keys():
assert len(crs.all_proj_keys) == 87
assert 'init' in crs.all_proj_keys
assert 'proj' in crs.all_... |
5,765 | normalize total | """
Functions to either scale single-cell data or normalize such that the row-wise sums are identical.
"""
from typing import Dict, Iterable, Optional, Union
try:
from typing import Literal
except ImportError:
from typing_extensions import Literal
import numpy as np
import scipy
from anndata import AnnData
fr... |
5,766 | zigate erase eeprom | #!/usr/bin/env python3
# coding: utf-8 -*-
#
# Author: zaraki673 & pipiche38
#
"""
Module: low level commands manuf. specific ZiGate
"""
from Modules.sendZigateCommand import send_zigatecmd_raw
def zigate_set_mode(self, mode):
if self.zigbee_communication == "zigpy":
self.log.logging( "zigateCommand... |
5,767 | make initial publications | #!/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... |
5,768 | test gds | from __future__ import annotations
import jsondiff
import numpy as np
import pytest
from pytest_regressions.data_regression import DataRegressionFixture
import gdsfactory as gf
from gdsfactory.cell import cell
from gdsfactory.component import Component
from gdsfactory.difftest import difftest
def test_append() -> N... |
5,769 | on new ticket | import pytz
from celery import shared_task
from discord_webhook import DiscordEmbed, DiscordWebhook
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from judge.jinja2.gravatar import gravatar
from judge.models import BlogPost, Comment, Contest, Problem, Tag, TagProblem, Tick... |
5,770 | test add and remove simple case | """ This is a test of the chain
SiteStatus -> ResourceStatusClient -> ResourceStatusDB
It supposes that the DB is present, and that the service is running
"""
# pylint: disable=wrong-import-position, missing-docstring
from datetime import datetime
import pytest
import DIRAC
DIRAC.initialize() # Initialize... |
5,771 | text | #!/usr/bin/env python
# Build script for Sphinx documentation
import os
import shlex
import shutil
import subprocess
import sys
from collections import OrderedDict
# You can set these variables from the command line.
SPHINXOPTS = os.getenv('SPHINXOPTS', '')
SPHINXBUILD = os.getenv('SPHINXBUILD', 'sphinx-build')
PA... |
5,772 | parse rttm | import random
import re
import xml.etree.ElementTree as ET
from collections import defaultdict
from itertools import accumulate
from pathlib import Path
import torch
from torch.utils.data.dataset import Dataset
from torchaudio.sox_effects import apply_effects_file, apply_effects_tensor
class QUESST14Trainset(Dataset... |
5,773 | type | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . imp... |
5,774 | initialize | #
# Copyright (c) 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... |
5,775 | connect s3 | import logging
from _typeshed import Incomplete
from typing import Any
from .s3.connection import S3Connection
Version: Any
UserAgent: Any
config: Any
BUCKET_NAME_RE: Any
TOO_LONG_DNS_NAME_COMP: Any
GENERATION_RE: Any
VERSION_RE: Any
ENDPOINTS_PATH: Any
def init_logging(): ...
class NullHandler(logging.Handler):
... |
5,776 | test ssl auth failure self signed | import unittest
import multiprocessing
import sys
import time
import os.path
import broker
def data_path(file):
base = os.path.realpath(__file__)
return os.path.join(os.path.join(os.path.dirname(base), "certs"), file)
class TestSSL(unittest.TestCase):
def check_ping(self, ep1, s1, ep2, s2):
ep2.p... |
5,777 | get mineral group | """
Submodule for accessing the rock forming mineral database.
Notes
-----
Accessing and modifying the database across multiple with multiple threads/processes
*could* result in database corruption (e.g. through repeated truncation etc).
"""
import functools
from pathlib import Path
import pandas as pd
import periodi... |
5,778 | test str works when username is unavailable | from unittest.mock import patch, MagicMock
import pytest
from ..models import JustfixUser, create_random_phone_number
from .factories import UserFactory
from onboarding.tests.factories import OnboardingInfoFactory
from texting import twilio
def test_create_random_phone_number_works():
pn = create_random_phone_nu... |
5,779 | prepare | """Implementation of the JSON adaptation objects
This module exists to avoid a circular import problem: pyscopg2.extras depends
on psycopg2.extension, so I can't create the default JSON typecasters in
extensions importing register_json from extras.
"""
# psycopg/_json.py - Implementation of the JSON adaptation object... |
5,780 | test linear smooth no ci | import numpy as np
import pandas as pd
import pytest
import statsmodels.api as sm
from plotnine import (
aes,
coord_trans,
geom_point,
geom_smooth,
ggplot,
stat_smooth,
)
from plotnine.exceptions import PlotnineWarning
random_state = np.random.RandomState(1234567890)
n = 100
# linear relation... |
5,781 | config sqlite 4326 | # =================================================================
#
# Authors: Just van den Broecke <justb4@gmail.com>
# Tom Kralidis <tomkralidis@gmail.com>
#
# Copyright (c) 2019 Just van den Broecke
# Copyright (c) 2022 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaini... |
5,782 | num int links | # Copyright (c) 2012 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions... |
5,783 | add | import queue
import threading
import time
from concurrent.futures import Executor
from typing import Any, Callable, List, Mapping, Optional, Tuple, Union
class ScheduledTask:
"""
Internal representation of a task (a callable) and its scheduling parameters.
"""
def __init__(
self,
task... |
5,784 | mock value original type | # Copyright (C) 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
5,785 | set params | # 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... |
5,786 | get name | # 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... |
5,787 | test writeome baddim | import pytest
import zarr
import numpy as np
from brainlit.utils.write import zarr_to_omezarr, czi_to_zarr, write_trace_layer
import os
import shutil
import zipfile
from pathlib import Path
from cloudvolume import CloudVolume
@pytest.fixture(scope="session")
def init_4dczi(tmp_path_factory):
data_dir = tmp_path_f... |
5,788 | test validate filepath executable | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
5,789 | get config iam policy 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... |
5,790 | test inject accept | import json
from flexget.api.app import base_message
from flexget.api.core.tasks import ObjectsContainer as OC
class TestExecuteAPI:
@staticmethod
def get_task_queue(manager):
"""Used to execute task queue"""
assert len(manager.task_queue) == 1
task = manager.task_queue.run_queue.get(... |
5,791 | test ignore pre req | #* 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
from TestHa... |
5,792 | read data path | from __future__ import print_function
import numpy as np
import os
import kaldiio
from multiprocessing import Pool
import argparse
from tqdm import tqdm
import math
from funasr.utils.types import str2triple_str
import logging
from typing import List, Union, Tuple, Sequence
from funasr.bin.sv_inference import inference_... |
5,793 | on finished | # -*- coding: utf-8 -*-
"""
/***************************************************************************
QFieldCloudDialog
A QGIS plugin
Sync your projects to QField
-------------------
begin : 2020-08-01
git sha ... |
5,794 | test create option with value | import pytest
from labelbox.exceptions import InconsistentOntologyException
from labelbox import Tool, Classification, Option, OntologyBuilder
_SAMPLE_ONTOLOGY = {
"tools": [{
"schemaNodeId": None,
"featureSchemaId": None,
"required": False,
"name": "poly",
"color": "#FF000... |
5,795 | get cluster coes | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
5,796 | itervaluerefs | import sys
from _typeshed import SupportsKeysAndGetItem
from _weakref import (
CallableProxyType as CallableProxyType,
ProxyType as ProxyType,
ReferenceType as ReferenceType,
getweakrefcount as getweakrefcount,
getweakrefs as getweakrefs,
proxy as proxy,
ref as ref,
)
from _weakrefset import... |
5,797 | recvmsg into | import socket
import warnings
class TransportSocket:
"""A socket-like wrapper for exposing real transport sockets.
These objects can be safely returned by APIs like
`transport.get_extra_info('socket')`. All potentially disruptive
operations (like "socket.close()") are banned.
"""
__slots__... |
5,798 | tensor buffer has identifier | # SPDX-License-Identifier: Apache-2.0
# automatically generated by the FlatBuffers compiler, do not modify
# namespace: tflite
import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()
class Tensor(object):
__slots__ = ['_tab']
@classmethod
def GetRootAs(cls, buf, offset=0):
... |
5,799 | main | #!/usr/bin/env python3
"""Meant to be run from inside python-test-runner container,
where this track repo is mounted at /python
"""
import argparse
from functools import wraps
from itertools import zip_longest
import json
from pathlib import Path
import shutil
import subprocess
import sys
import tempfile
from typing im... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.