id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
15,500 | test has valid padding |
import struct
from tests import TestCase
from mutagen.id3._util import BitPaddedInt, unsynch
class BitPaddedIntTest(TestCase):
def test_negative(self):
self.assertRaises(ValueError, BitPaddedInt, -1)
def test_zero(self):
self.assertEquals(BitPaddedInt(b'\x00\x00\x00\x00'), 0)
def tes... |
15,501 | send request | # 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 may ... |
15,502 | test process insight same product | from datetime import datetime, timedelta
import pytest
from robotoff.models import ProductInsight
from robotoff.scheduler import process_insights
from robotoff.types import ServerType
from ..models_utils import ProductInsightFactory, clean_db
DEFAULT_SERVER_TYPE = ServerType.off
@pytest.fixture(autouse=True)
def ... |
15,503 | 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... |
15,504 | test check config against spec or exit | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import json
import logging
import os
import shutil
import sys
import traceback
from collections.abc import Mapping
from pathlib import Path
import jsonref
import pytest
from airbyte_cdk.models.airbyte_protocol import ConnectorSpecification, FailureType
fro... |
15,505 | do get | import unittest
import os
import json
from unittest.mock import patch
import threading
from test.support.os_helper import EnvironmentVarGuard
from urllib.parse import urlparse
from http.server import BaseHTTPRequestHandler, HTTPServer
from google.cloud import bigquery
from google.auth.exceptions import DefaultCredent... |
15,506 | test search prefix | #!/usr/bin/env python
import logging
import unittest
import sys
import os
MODULE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, MODULE_DIR + '/..')
sys.path.insert(0, MODULE_DIR + '/../pynipap')
sys.path.insert(0, MODULE_DIR + '/../nipap')
sys.path.insert(0, MODULE_DIR + '/../nipap-cli')
from ni... |
15,507 | test call | # Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp
import random
import tempfile
from unittest import TestCase, mock
import mmcv
import mmengine
import numpy as np
import torch
from mmocr.apis.inferencers import TextRecInferencer
from mmocr.utils.check_argument import is_type_list
from mmocr.utils.... |
15,508 | assert cleared | #!/usr/bin/env python3
import unittest
from copy import copy, deepcopy
from threading import Lock
import rospy
from mil_tools import thread_lock
from navigator_alarm_handlers import NetworkLoss
from ros_alarms import AlarmBroadcaster, AlarmListener
from std_msgs.msg import Header
lock = Lock()
class killtest(unitte... |
15,509 | purge scaffolding | from project.util.rename_dict_keys import with_keys_renamed
from project.util.session_mutation import SessionFormMutation
from typing import Any, Dict, Optional, Tuple
import graphene
from graphql import ResolveInfo
import pydantic
from findhelp.models import is_lnglat_in_nyc
# This should change whenever our scaffo... |
15,510 | 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... |
15,511 | mkpath | """distutils.dir_util
Utility functions for manipulating directories and directory trees."""
__revision__ = "$Id$"
import os
import errno
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log
# cache for by mkpath() -- in addition to cheapening redundant calls,
# eliminat... |
15,512 | get account | """
Swift utility class
===================
Author: Anthony Stanton <anthony.stanton@gmail.com>
"""
import logging
import sys
from errno import EEXIST
from os import makedirs
from os.path import dirname, isdir
import salt.utils.files
# Get logging started
log = logging.getLogger(__name__)
HAS_SWIFT = False
try:
... |
15,513 | chain negotiation | # Copyright (C) 2015, 2016 GoSecure Inc.
"""
Telnet Transport and Authentication for the Honeypot
@author: Olivier Bilodeau <obilodeau@gosecure.ca>
"""
from __future__ import annotations
import time
import uuid
from twisted.conch.telnet import AlreadyNegotiating, TelnetTransport
from twisted.protocols.policies imp... |
15,514 | user api url | """ Core models. """
import hashlib
from urllib.parse import urljoin
from django.conf import settings
from django.contrib.auth.models import AbstractUser
from django.contrib.sites.models import Site
from django.core.cache import cache
from django.db import models
from django.utils.translation import gettext_lazy as _... |
15,515 | launch | from pymongo import UpdateOne
from bson.objectid import ObjectId
from openpype.pipeline import AvalonMongoDB
from openpype_modules.ftrack.lib import (
CUST_ATTR_ID_KEY,
query_custom_attributes,
BaseEvent
)
class SyncLinksToAvalon(BaseEvent):
"""Synchronize inpug linkts to avalon documents."""
#... |
15,516 | print formatted | import sys;
import math;
savedNames = ['3d-cube', '3d-raytrace', 'base64', 'crypto-aes', 'crypto-md5', 'crypto-sha1', 'date-format-tofte', 'date-format-xparb', 'n-body', 'regex-dna', 'tagcloud', 'towers.c', 'container.cpp', 'dry.c', 'n-body.c', 'quicksort.c', 'gcc-loops.cpp', 'hash-map', 'float-mm.c', 'bigfib.cpp', 'c... |
15,517 | test casestatus list get user context | import urllib.parse
from django.contrib.auth.models import User
from django.test import TestCase
from dfirtrack_main.models import Casestatus
class CasestatusViewTestCase(TestCase):
"""casestatus view tests"""
@classmethod
def setUpTestData(cls):
# create object
Casestatus.objects.creat... |
15,518 | check match | # https://www.wordunscrambler.net/word-list/wordle-word-list
# for the list of words
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.firefox.service import Service as FirefoxService
from webdriver_manager.firefox import GeckoDriverManager
from pynput import keyboard
i... |
15,519 | logged | """
Logging wrapper and shared instance
"""
import json
import logging
from functools import partial, wraps
import click
import six
_DATE_FORMAT = "%Y-%m-%dT%H:%M:%S%z"
class LogOutputFormat(object):
TEXT = "text"
JSON = "json"
DEFAULT = TEXT
_all = [TEXT, JSON]
class JsonLogFormatter(logging.Forma... |
15,520 | location | # 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... |
15,521 | read mapping | """
Registration tools
"""
import numpy as np
import nibabel as nib
from dipy.align.imwarp import DiffeomorphicMap
from dipy.align import syn_registration
import dipy.core.gradients as dpg
from dipy.align.streamlinear import whole_brain_slr
__all__ = ["syn_register_dwi", "write_mapping", "read_mapping",
... |
15,522 | get all | from typing import List, Optional
from pydantic.error_wrappers import ErrorWrapper, ValidationError
from sqlalchemy.sql.expression import true
from dispatch.exceptions import NotFoundError
from dispatch.project import service as project_service
from .models import (
CasePriority,
CasePriorityCreate,
Case... |
15,523 | cfg | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils.weight_norm as weightNorm
from torch.autograd import Variable
import sys
def conv3x3(in_planes, out_planes, stride=1):
return weightNorm(nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=True))
c... |
15,524 | test make migration plans | from __future__ import absolute_import
from __future__ import unicode_literals
import re
from collections import namedtuple
from nose.tools import assert_equal
from commcare_cloud.commands.terraform.terraform_migrate_state import get_migrations, \
Migration, make_migration_plans, MigrationPlan
from six.moves impo... |
15,525 | check users and groups one fails one | from dagster import (
AssetMaterialization,
ExpectationResult,
In,
MetadataValue,
Nothing,
Out,
Output,
file_relative_path,
graph,
op,
)
MARKDOWN_EXAMPLE = "markdown_example.md"
raw_files = [
"raw_file_users",
"raw_file_groups",
"raw_file_events",
"raw_file_frie... |
15,526 | matvec backward | __all__ = ["FirstDerivative"]
from typing import Callable, Union
import numpy as np
from numpy.core.multiarray import normalize_axis_index
from pylops import LinearOperator
from pylops.utils._internal import _value_or_sized_to_tuple
from pylops.utils.backend import get_array_module
from pylops.utils.decorators impor... |
15,527 | extend | #\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\#
from GangaCore.Core.exceptions import GangaException
from GangaCore.GPIDev.Lib.Dataset import Dataset
from GangaCore.GPIDev.Schema import Schema, Version, SimpleItem, GangaFileItem
from GangaCore.GPIDev.Base.Proxy import getName
import Gan... |
15,528 | test set resume buttons | #!/usr/bin/env python3
import unittest
from typing import Dict, List
from panda import Panda
from panda.tests.libpanda import libpanda_py
import panda.tests.safety.common as common
from panda.tests.safety.common import CANPackerPanda
class Buttons:
UNPRESS = 1
RES_ACCEL = 2
DECEL_SET = 3
CANCEL = 6
class Gm... |
15,529 | kw only | from iminuit.util import describe, make_func_code
from iminuit.typing import Annotated, Gt, Lt, Ge, Le, Interval
from math import ldexp
import platform
from functools import wraps
import pytest
import numpy as np
from numpy.typing import NDArray
is_pypy = platform.python_implementation() == "PyPy"
def test_function(... |
15,530 | can view reviews | import rules
from django.db.models import Q
from pretalx.person.permissions import can_change_submissions, is_reviewer
from pretalx.submission.models import SubmissionStates
@rules.predicate
def has_submissions(user, obj):
event = obj.event
return event.submissions.filter(speakers__in=[user]).exists()
@rul... |
15,531 | benchmark | #!/usr/bin/python3
#
# Protocol Buffers - Google's data interchange format
# Copyright 2023 Google LLC. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
... |
15,532 | name | import copy
import time
from typing import List, Text, Optional
from rasa.core.actions import action
from rasa.core.actions.loops import LoopAction
from rasa.core.channels import OutputChannel
from rasa.shared.core.domain import Domain
from rasa.shared.core.events import (
Event,
UserUtteranceReverted,
Act... |
15,533 | init | from tapiriik.services import *
from .service_record import ServiceRecord
from tapiriik.database import db, cachedb
from bson.objectid import ObjectId
# Really don't know why I didn't make most of this part of the ServiceBase.
class Service:
# These options are used as the back for all service record's configurat... |
15,534 | test encrypt decrypt raw | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
15,535 | test structured get config has all attributes | # Copyright 2020 The AutoKeras 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 i... |
15,536 | is debug enabled | # Copyright 2019 ICON Foundation
#
# 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... |
15,537 | test username | #!/usr/bin/env pmpython
#
# Copyright (c) 2022 Oracle and/or its affiliates.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# 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; eit... |
15,538 | test reject requests with escaped slashes missing | import pytest
from tests.utils import econf_compile, econf_foreach_hcm, module_and_mapping_manifests
def _test_hcm(yaml, expectations={}):
# Compile an envoy config
econf = econf_compile(yaml)
# Make sure expectations pass for each HCM in the compiled config
def check(typed_config):
for key,... |
15,539 | fit | """Linear/Quadratic Discriminant Analysis (LDA/QDA) model from sklearn"""
import datatable as dt
import numpy as np
from h2oaicore.models import CustomModel
from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis, LinearDiscriminantAnalysis
from sklearn.preprocessing import LabelEncoder
from h2oaicore.s... |
15,540 | extract positions | from datetime import datetime, timedelta
import numpy as np
import pandas as pd
from prefect import Flow, task
from sqlalchemy import text
from src.read_query import read_query
from src.utils.anonymization import DataAnonymizer
da = DataAnonymizer()
@task(checkpoint=False)
def extract_last_positions():
query =... |
15,541 | get next step | # Janssen Project software is available under the Apache License (2004). See http://www.apache.org/licenses/ for full text.
# Copyright (c) 2020, Janssen Project
#
# Author: Yuriy Movchan
#
from io.jans.service.cdi.util import CdiUtil
from io.jans.as.server.security import Identity
from io.jans.model.custom.script.typ... |
15,542 | 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... |
15,543 | test flush rewind | """ Tests for netcdf """
import os
from os.path import join as pjoin, dirname
from io import BytesIO
from glob import glob
from contextlib import contextmanager
import numpy as np
import pytest
from ..netcdf import netcdf_file
TEST_DATA_PATH = pjoin(dirname(__file__), 'data')
N_EG_ELS = 11 # number of elements f... |
15,544 | test progress stop | import inspect
import os
import subprocess
import time
def _webClientResource():
from girder.api import access
from girder.api.describe import describeRoute, Description
from girder.api.rest import Resource
from girder.constants import ROOT_DIR, registerAccessFlag
from girder.exceptions import Res... |
15,545 | play | import hassapi as hass
from queue import Queue
import sys
from threading import Thread
from threading import Event
import time
#
# App to manage announcements via TTS and stream sound files to Sonos
#
# Provides methods to enqueue TTS and Media file requests and make sure that only one is executed at a time
# Volume o... |
15,546 | orthogonal | # -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
API Issues to work out:
- MatrixTransform and STTransform both have 'scale' and 'translate'
attributes, but they are used in very different ways. It ... |
15,547 | install test | # Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import inspect
from llnl.util.filesystem import working_dir
import spack.builder
import spack.package_base
from spack.dir... |
15,548 | get profile | import abc
import numpy
import pyresample
from scipy.interpolate import interp1d
import data.geo as geo
class Model(metaclass=abc.ABCMeta):
"""Abstract base class for models."""
def __init__(self, nc_data):
self.nc_data = nc_data
@property
@abc.abstractmethod
def depths(self) -> numpy.... |
15,549 | test aot eager | # Owner(s): ["module: dynamo"]
import functools
import unittest
import torch
import torch._dynamo
import torch._dynamo.test_case
from torch._dynamo.backends.debugging import ExplainWithBackend
from torch._dynamo.backends.onnxrt import has_onnxruntime
from torch._dynamo.backends.tvm import has_tvm
from torch._dynamo.t... |
15,550 | configure | from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
import os
required_conan_version = ">=1.53.0"
class FreeImageConan(... |
15,551 | hexdigits | #
# ICRAR - International Centre for Radio Astronomy Research
# (c) UWA - The University of Western Australia, 2016
# Copyright by UWA (in the framework of the ICRAR)
# All rights reserved
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser G... |
15,552 | get regexs | #!/usr/bin/env python3
# Copyright 2015 The Kubernetes 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 appl... |
15,553 | test delete | # Copyright 2023 Avaiga Private Limited
#
# 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 ... |
15,554 | requirements | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
from conan.tools.mi... |
15,555 | claim build requests | # 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... |
15,556 | savefn | # coding: utf-8
# Copyright 2019 Hirofumi Inaguma
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import argparse
import pytest
import torch
from espnet.nets.pytorch_backend.e2e_st_transformer import E2E
from espnet.nets.pytorch_backend.transformer import plot
def make_arg(**kwargs):
defaults = dic... |
15,557 | get drake path | """
Python bindings for
`Drake: Model-Based Design and Verification for Robotics
<https://drake.mit.edu/>`_.
This Python API documentation is a work in progress. Most of it is generated
automatically from the C++ API documentation, and thus may have some
C++-specific artifacts. For general overview and API documentati... |
15,558 | assert circmean | import pytest
import numpy as np
from unittest import TestCase
from scipy.stats import circmean
from pingouin import read_dataset
from pingouin.circular import convert_angles, _checkangles
from pingouin.circular import (
circ_axial,
circ_corrcc,
circ_corrcl,
circ_mean,
circ_r,
circ_rayleigh,
... |
15,559 | durations | #!/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='... |
15,560 | test rp verifies exchange | import random
from concurrent.futures import Future
from unittest import mock
import pika
from globus_compute_endpoint.endpoint.rabbit_mq import (
RabbitPublisherStatus,
ResultPublisher,
)
_MOCK_BASE = "globus_compute_endpoint.endpoint.rabbit_mq.result_publisher."
q_info = {"queue_publish_kwargs": {}}
def M... |
15,561 | test never expired if connected | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta
import erfa
import pytest
import astropy.time.core
from astropy.time import Time, update_leap_seconds
from astropy.utils import iers
from astropy.utils.exceptions ... |
15,562 | test directory | import pathlib
import pytest
from numpy.testing import assert_array_equal
from functools import partial
import zarr
from zarr.core import Array
from zarr.storage import DirectoryStore, NestedDirectoryStore, FSStore
from zarr.tests.util import have_fsspec
needs_fsspec = pytest.mark.skipif(not have_fsspec, reason="ne... |
15,563 | test get largest value | #!/usr/bin/env python
"""
_MathAlgos_t_
Test class for basic Math Algorithms
"""
import unittest
from WMCore.Algorithms import MathAlgos
class MathAlgoTest(unittest.TestCase):
"""
Tests for basic Math Algorithms
"""
def setUp(self):
"""
Do nothing
"""
return
... |
15,564 | search page | # -*- coding: utf-8 -*-
import json
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseForbidden
from django.shortcuts import render
from haystack.query import SearchQuerySet
from courses.models import Course
from schools.models import School
from users.models... |
15,565 | setup | # Copyright 2015 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 accompa... |
15,566 | test matomo response json valid | """Tests for the periodic CLI stats commands."""
# pylint: disable=redefined-outer-name
from __future__ import annotations
from typing import Dict, List, Optional, Union
import httpx
import pytest
from respx import MockRouter
from funnel.cli.periodic import stats as cli_stats
MATOMO_URL = 'https://matomo.test/'
... |
15,567 | help | #!/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... |
15,568 | test correct config | # -*- coding: utf-8 -*-
import pytest
import os
from ckan.cli.cli import ckan
from ckan.cli import CKANConfigLoader
from ckan.exceptions import CkanConfigurationException
def test_without_args(cli):
"""Show help by default.
"""
result = cli.invoke(ckan)
assert u'Usage: ckan' in result.output
ass... |
15,569 | check value | # 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... |
15,570 | set up | from unittest.mock import patch
from dimagi.utils.couch.undo import is_deleted, soft_delete
from corehq.apps.linked_domain.applications import link_app
from corehq.apps.linked_domain.tests.test_linked_apps import BaseLinkedAppsTest
from corehq.apps.linked_domain.ucr import create_linked_ucr, update_linked_ucr
from co... |
15,571 | value | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
15,572 | layout | import os
from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import copy, get, replace_in_file, rmdir
from conan.tools.scm import Version
from conan.errors import ConanInvalidConfiguration
requi... |
15,573 | submit task | import logging
import os
from abc import ABC
from concurrent.futures import Future, ThreadPoolExecutor
from threading import Semaphore, Thread
from typing import Dict, Iterable, List, Optional, TypeVar
from tqdm import tqdm
from ..utils.ratelimit import RateLimiter
logger = logging.getLogger(__name__)
T = TypeVar("... |
15,574 | get output | from django.db.models import F
from django.db.transaction import non_atomic_requests
from django.http import JsonResponse
from django.urls import reverse
from django.views.decorators.cache import cache_control
from olympia.addons.models import Addon
from olympia.amo.reverse import override_url_prefix
from olympia.amo.... |
15,575 | test basic | import os
import subprocess
import sys
import time
import pytest
import fsspec
from fsspec import open_files
from fsspec.implementations.ftp import FTPFileSystem
ftplib = pytest.importorskip("ftplib")
here = os.path.dirname(os.path.abspath(__file__))
@pytest.fixture()
def ftp():
pytest.importorskip("pyftpdlib"... |
15,576 | compute path angle | from __future__ import annotations
from itertools import count
from typing import TYPE_CHECKING, Union, cast
from impunity import impunity
from pitot import aero
from typing_extensions import Annotated
import numpy as np
import numpy.typing as npt
from ..core import types as tt
if TYPE_CHECKING:
from ..core im... |
15,577 | test double big byteorder | # Copyright 2020. ThingsBoard
#
# 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 ... |
15,578 | pyfunctype | import sys
from _ctypes import (
POINTER as POINTER,
RTLD_GLOBAL as RTLD_GLOBAL,
RTLD_LOCAL as RTLD_LOCAL,
ArgumentError as ArgumentError,
Array as Array,
CFuncPtr as _CFuncPtr,
Structure as Structure,
Union as Union,
_CanCastTo as _CanCastTo,
_CArgObject as _CArgObject,
_CDa... |
15,579 | assert not ispipe | import os
import stat
try:
from pathlib import Path
except ImportError:
try:
# Python 2 backport
from pathlib2 import Path
except ImportError:
class Path(object):
"""Dummy for isinstance checks"""
pass
__all__ = ['assert_path_exists', 'assert_not_path_exist... |
15,580 | convert example | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
15,581 | test upload to with project and xform | # -*- coding: utf-8 -*-
"""
Test MetaData model.
"""
from onadata.apps.logger.models import Instance, Project, XForm
from onadata.apps.main.models.meta_data import MetaData, unique_type_for_form, upload_to
from onadata.apps.main.tests.test_base import TestBase
from onadata.libs.utils.common_tags import (
GOOGLE_SHE... |
15,582 | test estop detector builder | """Test the estop.detector module."""
import pytest
from mock import AsyncMock
from typing import Type, List
from opentrons_hardware.hardware_control.estop.detector import (
EstopSummary,
EstopDetector,
)
from opentrons_hardware.firmware_bindings.utils import (
UInt8Field,
)
from opentrons_shared_data.erro... |
15,583 | build | #
# Copyright (c) 2022, Neptune Labs Sp. z o.o.
#
# 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... |
15,584 | get rl config | import logging
import pytest
from tests.utils import econf_foreach_cluster
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s test %(levelname)s: %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
)
logger = logging.getLogger("ambassador")
from ambassador import IR, Config, EnvoyConfig
from ambassado... |
15,585 | get lock | import ctypes
from collections.abc import Callable, Iterable, Sequence
from ctypes import _CData, _SimpleCData, c_char
from multiprocessing.context import BaseContext
from multiprocessing.synchronize import _LockLike
from types import TracebackType
from typing import Any, Generic, Protocol, TypeVar, overload
from typin... |
15,586 | remove | import re
import string
from typing import List
ALLOWED_CHARACTERS = string.ascii_letters + "_0123456789"
class FieldEditor:
"""Allows user to edit the project data tables
The field editor is used for two different purposes:
* Managing data tables (adding and removing fields)
* Editing the tables' ... |
15,587 | second app uncompiled | import pytest
from briefcase.commands import PackageCommand
from briefcase.commands.base import full_options
from briefcase.config import AppConfig
from briefcase.console import Console, Log
from ...utils import create_file
class DefaultPackageCommand(PackageCommand):
# An instance of PackageCommand that inheri... |
15,588 | test create logs with task run id | import uuid
import pendulum
import pytest
from prefect import api, models
async def test_create_logs(flow_run_id, tenant_id):
where_clause = {
"tenant_id": {"_eq": tenant_id},
"flow_run_id": {"_eq": flow_run_id},
}
logs_count = await models.Log.where(where_clause).count()
dt = pendu... |
15,589 | test get completions basic | # Copyright (C) 2021 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd... |
15,590 | test xfail reraises non specified exception | # This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Copyright the Hypothesis Authors.
# Individual contributors are listed in AUTHORS.rst and the git log.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the... |
15,591 | test service reports unknown | import json
import os
import pytest
from mock import MagicMock
from datadog_checks.base.errors import CheckException
from datadog_checks.vespa import VespaCheck
HERE = os.path.dirname(os.path.abspath(__file__))
def test_no_consumer_raises():
check = VespaCheck("vespa", {}, {})
with pytest.raises(CheckExcep... |
15,592 | dump downstream relations | #
# 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... |
15,593 | test pyramid | """Maximum flow algorithms test suite on large graphs.
"""
import bz2
import os
import pickle
import pytest
import networkx as nx
from networkx.algorithms.flow import (
boykov_kolmogorov,
build_flow_dict,
build_residual_network,
dinitz,
edmonds_karp,
preflow_push,
shortest_augmenting_path... |
15,594 | test operations | # -*- coding: utf-8 -*-
import logging
import os
import tempfile
import numpy as np
from dipy.io.streamline import load_tractogram
from scilpy.io.fetcher import fetch_data, get_testing_files_dict, get_home
from scilpy.tractograms.tractogram_operations import flip_sft, \
shuffle_streamlines, perform_tractogram_ope... |
15,595 | layout | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
from conan.tools.mi... |
15,596 | run once | """
The base class for all Prefect REST API loop services.
"""
import asyncio
import signal
from typing import List
import anyio
import pendulum
from prefect.logging import get_logger
from prefect.server.database.dependencies import inject_db
from prefect.server.database.interface import PrefectDBInterface
class Lo... |
15,597 | l2cap complete | #!/usr/bin/env python3
# BlueKitchen GmbH (c) 2022
# parse PacketLogger and reconstruct GATT DB
import sys
import datetime
import struct
def as_hex(data):
str_list = []
for byte in data:
str_list.append("{0:02x} ".format(byte))
return ''.join(str_list)
def as_bd_addr(data):
str_list = []
for byte in data:... |
15,598 | get limits | import time
import gevent
from mxcubecore.BaseHardwareObjects import Device
from mxcubecore.HardwareObjects.abstract.AbstractMotor import AbstractMotor
class PX1DetectorDistance(Device, AbstractMotor):
MOVESTARTED = 0
NOTINITIALIZED = 0
UNUSABLE = 0
READY = 2
MOVING = 4
ONLIMIT = 1
stat... |
15,599 | init parameter widget | # ***************************************************************************
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.