id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
1,600 | test international womens day | # python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2... |
1,601 | forms save | # flake8: noqa
from django.core.exceptions import ImproperlyConfigured
from django.db import transaction
from django.forms import models as model_forms
from django.forms.formsets import all_valid
from django.http import HttpResponseRedirect
from django.utils.encoding import force_str
from django.views import generic
... |
1,602 | test gravity attribute | #! /usr/bin/env python
"""
Unit tests for landlab.components.flexure.flexure
"""
import numpy as np
import pytest
from landlab import RasterModelGrid
from landlab.components import Flexure
(_SHAPE, _SPACING, _ORIGIN) = ((20, 20), (10e3, 10e3), (0.0, 0.0))
def test_method_names():
grid = RasterModelGrid((20, 20)... |
1,603 | test port bind failure recovery | """Tests for kernel connection utilities"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import errno
import json
import os
from tempfile import TemporaryDirectory
from typing import no_type_check
from unittest.mock import patch
import pytest
import zmq
from tr... |
1,604 | get versions | # -*- coding: utf-8 -*-
"""
(c) 2014-2020 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
Ralph Bean <rbean@redhat.com>
Michal Konecny <mkonecny@redhat.com>
"""
from anitya.lib import xml2dict
from anitya.lib.backends import BaseBackend
from anitya.lib.exceptions import AnityaPl... |
1,605 | test create python bundle | import unittest
from os.path import join
from unittest import mock
from pythonforandroid.recipes.python3 import (
NDK_API_LOWER_THAN_SUPPORTED_MESSAGE,
)
from pythonforandroid.util import BuildInterruptingException, build_platform
from tests.recipes.recipe_lib_test import RecipeCtx
class TestPython3Recipe(Recip... |
1,606 | list ports | """
Defines the OvsBridgeDevice class.
Copyright 2017 Red Hat, Inc.
Licensed under the GNU General Public License, version 2 as
published by the Free Software Foundation; see COPYING for details.
"""
__author__ = """
olichtne@redhat.com (Ondrej Lichtner)
"""
import re
import pprint
from lnst.Common.ExecCmd import ex... |
1,607 | get sp i temperature | """Class to interface with the SPI Rack Qutech Delft."""
from qblox_instruments import SpiRack
from qibo.config import log, raise_error
from qibolab.instruments.abstract import Instrument, InstrumentException
class SPI(Instrument):
property_wrapper = lambda parent, device, *parameter: property(
lambda se... |
1,608 | get available firmware version | #!/usr/bin/env python
########################################################################
# DELLEMC S5224F
#
# Module contains an implementation of SONiC Platform Base API and
# provides the Components' (e.g., BIOS, CPLD, FPGA, BMC etc.) available in
# the platform
#
##############################################... |
1,609 | on service removed | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from queue import Queue
from threading import Thread, Event
from time import time
from typing import Optional
from zeroconf import Zeroconf, ServiceBrowser, ServiceStateChange, ServiceInfo
from UM.Logger import Logger
from... |
1,610 | check if service unavailable response is received | #!/usr/bin/env python3
# ====================================
# Copyright (c) Microsoft Corporation. All rights reserved.
# ====================================
"""HttpClient base class."""
import os
import sys
import configuration3 as configuration
import serializerfactory
import locallogger
import re as regex
c... |
1,611 | compile | # ./python/air/backend/linalg_on_tensors.py -*- Python -*-
#
# Copyright (C) 2022, Xilinx Inc.
# Copyright (C) 2022, Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
import torch
import torch_mlir.ir
import torch_mlir.passmanager
from torch_mlir.dynamo import make_simple_dynamo_backend
import air.mlir.ir
i... |
1,612 | get cloudwatch client | # Copyright 2021 Collate
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software... |
1,613 | test get yearly contributions | from scrape_up import github
class UserTest():
def __init__(self, username):
self.username = username
#SetUp
self.user = github.Users(username=self.username)
def test_followers(self):
followers = self.user.followers()
return followers
def test_following(self):
... |
1,614 | list tokens redirect | # ContentDB
# Copyright (C) 2018-21 rubenwardy
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program... |
1,615 | out bounce | """
Define a series of easing functions for more natural-looking animations.
Taken from https://easings.net/ and translated from JavaScript.
"""
from math import cos, pi, sin, sqrt
def _in_out_expo(x: float) -> float:
"""https://easings.net/#easeInOutExpo"""
if 0 < x < 0.5:
return pow(2, 20 * x - 10)... |
1,616 | process py | import tensorflow as tf
import tensorflow_datasets as tfds
import tensorflow_text as tf_text
from transformers import TFBertForSequenceClassification
from transformers import TFDistilBertForSequenceClassification
tpu = tf.distribute.cluster_resolver.TPUClusterResolver()
tf.config.experimental_connect_to_cluster(tpu)
t... |
1,617 | test almost identical vectors | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
1,618 | test mark boundaries | import numpy as np
import pytest
from numpy.testing import assert_array_equal, assert_allclose
from skimage._shared.utils import _supported_float_type
from skimage.segmentation import find_boundaries, mark_boundaries
white = (1, 1, 1)
def test_find_boundaries():
image = np.zeros((10, 10), dtype=np.uint8)
i... |
1,619 | question | """A PyQt5 dialog to show a message and let the user check a box
Example usage:
checked = OptionalMessageDialog.msg(self, "Disclaimer",
"This is beta software, and you are using it at your own risk!",
)
said_yes, checked = OptionalMessageDialog.question(self, "QtW... |
1,620 | test invalid param | #!/usr/bin/env python
# Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), e... |
1,621 | test | #
# Copyright (C) 2001-2023 NLTK Project
# Author: Masato Hagiwara <hagisan@gmail.com>
# URL: <https://www.nltk.org/>
# For license information, see LICENSE.TXT
import sys
from nltk.corpus.reader import util
from nltk.corpus.reader.api import *
from nltk.corpus.reader.util import *
class ChasenCorpusReader(CorpusRe... |
1,622 | primary key | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ ... |
1,623 | forms | from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from typing import Any
from django import METHOD_NAME
from django.contrib.admin.options import ModelAdmin
from django.db.models import Model
from django.db.models.fields import AutoField
from django.METHOD_NAME import BaseForm
from django.METH... |
1,624 | main | #! /usr/bin/env python3
import os
from subprocess import call
import platform
import shutil
import time
dockerComposeFilename = 'docker-compose-coop.yml'
containerLocalHostAddressOrg = '127.0.0.1'
def AddVehicle(composeFile,containerLocalHostAddress,vehicleId,lastNetworkOctet,lastEndpointOctet,gossipBind,amasePort,... |
1,625 | test | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
1,626 | main | #!/usr/bin/env python3
import fnmatch
import os
import re
import ntpath
import sys
import argparse
def check_config_style(filepath):
bad_count_file = 0
def pushClosing(t):
closingStack.append(closing.expr)
closing << Literal( closingFor[t[0]] )
def popClosing():
closing << closing... |
1,627 | reslice | from multiprocessing import Pool
import warnings
import numpy as np
from scipy.ndimage import affine_transform
from dipy.utils.multiproc import determine_num_processes
def _affine_transform(kwargs):
with warnings.catch_warnings():
warnings.filterwarnings("ignore", message=".*scipy.*18.*",
... |
1,628 | load required audio | import os
from glob import glob
from typing import Dict, List
import librosa
import numpy as np
import torch
import torchaudio
from scipy.io.wavfile import read
from TTS.utils.audio.torch_transforms import TorchSTFT
def load_wav_to_torch(full_path):
sampling_rate, data = read(full_path)
if data.dtype == np.... |
1,629 | hex to int | #!/usr/bin/env python3
#
# Copyright (C), 2022 Intel Corporation.
# Copyright (c), 2018-2021, SISSA (International School for Advanced Studies).
#
# SPDX-License-Identifier: BSD-3-Clause
#
import sys, os
from decimal import Decimal
from copy import copy
import operator
import elementpath
# Allow this script to find t... |
1,630 | test inference superresolution fp16 | # coding=utf-8
# Copyright 2023 HuggingFace 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 ag... |
1,631 | test no composes html | # Copyright 2017-2019 Red Hat, Inc. and others.
#
# This file is part of Bodhi.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later... |
1,632 | dm hash buffer32 | # Copyright 2020-2023 The Defold Foundation
# Copyright 2014-2020 King
# Copyright 2009-2014 Ragnar Svensson, Christian Murray
# Licensed under the Defold License version 1.0 (the "License"); you may not use
# this file except in compliance with the License.
#
# You may obtain a copy of the License, together with FAQs... |
1,633 | qtapp loop nonblocking | # -*- coding: utf-8 -*-
import sys
import utool as ut
from wbia.guitool.__PYQT__ import GUITOOL_PYQT_VERSION # NOQA
from wbia.guitool.__PYQT__ import QtWidgets # NOQA
from wbia.guitool.__PYQT__ import QtCore
ut.noinject(__name__, '[guitool.main]', DEBUG=False)
IS_ROOT_WINDOW = False
QAPP = None
VERBOSE = '--verb... |
1,634 | init vars | #!/usr/bin/env python
#============================================================================
# Copyright (C) Microsoft Corporation, All rights reserved.
#============================================================================
import os
import imp
import re
import codecs
import shutil
import string
protoc... |
1,635 | test service enable | import pytest
import salt.utils.path
import salt.utils.platform
import salt.utils.systemd
from tests.support.case import ModuleCase
@pytest.mark.destructive_test
@pytest.mark.windows_whitelisted
class ServiceModuleTest(ModuleCase):
"""
Module testing the service module
"""
def setUp(self):
s... |
1,636 | test fetch guild | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021-present davfsa
#
# 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 t... |
1,637 | process project updates | """
This module contains signal handler for region outbox messages.
These receivers are triggered on the region silo as outbox messages
are drained. Receivers are expected to make local state changes (tombstones)
and perform RPC calls to propagate changes to Control Silo.
"""
from __future__ import annotations
from t... |
1,638 | get async read session | """ Setup database to perform CRUD transactions
"""
import logging
from typing import Generator, AsyncGenerator
from contextlib import contextmanager, asynccontextmanager
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, Session
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSe... |
1,639 | test auto encoder hp struct | # Copyright 2023 The Flax 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 wri... |
1,640 | set override | import contextlib
import functools
import inspect
import sys
from collections import defaultdict
from typing import DefaultDict, List, Optional, Tuple
class GeneratorStats:
_warn_cache: DefaultDict[str, int] = defaultdict(int)
_error_cache: DefaultDict[str, int] = defaultdict(int)
_traces: List[Tuple[Opti... |
1,641 | test backup cancel | #!/usr/bin/env python3
# group: rw
#
# Test nbd reconnect
#
# Copyright (c) 2019 Virtuozzo International GmbH.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, ... |
1,642 | is finished | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
1,643 | get models | import requests
import csv
import re
import requests
from collections import defaultdict
default_map_name = 'covid19map'
base_url = 'https://%s.elixir-luxembourg.org/minerva/api/'
resource_url = ('https://git-r3lab.uni.lu/covid/models/-/raw/master/'
'Integration/MINERVA_build/resources.csv')
def get_... |
1,644 | set data from form | from App.config import getConfiguration
from plone.base import PloneMessageFactory as _
from plone.base.interfaces import IBundleRegistry
from plone.registry.interfaces import IRegistry
from Products.CMFPlone.resources.browser.resource import update_resource_registry_mtime
from Products.Five.browser import BrowserView
... |
1,645 | test filter out disabled capabilities ignore partially | import sublime
from LSP.plugin.core.settings import read_client_config, update_client_config
from LSP.plugin.core.views import get_uri_and_position_from_location
from LSP.plugin.core.views import to_encoded_filename
from os import environ
from os.path import dirname, pathsep
from unittesting import DeferrableTestCase
i... |
1,646 | on request | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from typing import ( Union, Optional )
from azure.core.pipeline import PipelineRequest
from azure.core.pipeline.policies import ( SansIOHTTPPolicy, BearerTokenCredentia... |
1,647 | test 2 paragraphs long line | """
Python Markdown
A Python implementation of John Gruber's Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few years by Yuri Takhteyev (ht... |
1,648 | generate key pair | """
Ephemeral Elliptic Curve Diffie-Hellman (ECDH) key exchange
RFC 5656, Section 4
"""
from hashlib import sha256, sha384, sha512
from paramiko.common import byte_chr
from paramiko.message import Message
from paramiko.ssh_exception import SSHException
from cryptography.hazmat.backends import default_backend
from cryp... |
1,649 | is running | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
1,650 | tcsendbreak | import sys
from _typeshed import FileDescriptorLike
from typing import Any
from typing_extensions import TypeAlias
if sys.platform != "win32":
# Must be a list of length 7, containing 6 ints and a list of NCCS 1-character bytes or ints.
_Attr: TypeAlias = list[int | list[bytes | int]]
B0: int
B1000000... |
1,651 | write meson build | from __future__ import annotations
import errno
import shutil
import subprocess
from pathlib import Path
from ._backend import Backend
from string import Template
import warnings
class MesonTemplate:
"""Template meson build file generation class."""
def __init__(
self,
modulename: str,
... |
1,652 | test mack total parameter risk | ### Building out a dev environment with a working copy
### of R ChainLadder is difficult. These tests are
### Currently inactive, but available should the compatibility
### of the installs improve at a later date.
import numpy as np
import pytest
import chainladder as cl
try:
from rpy2.robjects.packages import ... |
1,653 | test algebraic field | """repr() printing tests."""
import pytest
from diofant import (FF, QQ, ZZ, Abs, Catalan, Dummy, E, EulerGamma, Float,
Function, GoldenRatio, I, ImmutableMatrix, Integer,
Matrix, Rational, Symbol, Wild, WildFunction, false,
field, grlex, nan, ones, oo, pi... |
1,654 | check sha1sum file | #!/usr/bin/env python
import argparse
import hashlib
import os
import sys
import requests
# Here I am disabling warnings as they pollute long download
# screens. However, I am passing a more readable warning to the user
# instructing them.
from requests.packages.urllib3.exceptions import InsecureRequestWarning
from t... |
1,655 | dict key | # MIT License
#
# Copyright The SCons Foundation
#
# 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 rights to use, copy, modify, merge, ... |
1,656 | calc partiality anisotropy set | from __future__ import absolute_import, division, print_function
from cctbx.array_family import flex
from scitbx.matrix import sqr, col
from cctbx.crystal_orientation import crystal_orientation, basis_type
import math
import numpy as np
class partiality_handler(object):
"""
mod_partiality:
1. Calculate partialit... |
1,657 | test get highest notification setting value | from sentry.models import User
from sentry.notifications.helpers import (
get_highest_notification_setting_value,
get_most_specific_notification_setting_value,
)
from sentry.notifications.types import (
NotificationScopeType,
NotificationSettingOptionValues,
NotificationSettingTypes,
)
from sentry.s... |
1,658 | install | #
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2022 Alex Richardson
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list... |
1,659 | get args parser | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
import argparse
import os
import sys
import os.path as osp
import torch
ROOT = os.getcwd()
if str(ROOT) not in sys.path:
sys.path.append(str(ROOT))
from yolov6.utils.events import LOGGER
from yolov6.core.inferer import Inferer
def METHOD_NAME(add_help=True):
pa... |
1,660 | test files |
import testing
from testing import value_eq,object_eq
from testing import divert_nexus_log,restore_nexus_log
associated_files = dict()
def get_filenames():
filenames = [
'Fe.aug-cc-pwcv5z-dk.0.bas',
'Fe.aug-cc-pwcv5z-dk.0.gbs',
'Fe.BFD_VQZ.bas',
'Fe.BFD_VQZ.gbs',
'Fe.stu... |
1,661 | test discover collision | # -----------------------------------------------------------------------------
# Copyright (c) 2012 - 2018, Anaconda, Inc. and Intake contributors
# All rights reserved.
#
# The full license is in the LICENSE file, distributed with this software.
# ----------------------------------------------------------------------... |
1,662 | get window geometry | "Zoom a window to maximum height."
import re
import sys
import tkinter
class WmInfoGatheringError(Exception):
pass
class ZoomHeight:
# Cached values for maximized window dimensions, one for each set
# of screen dimensions.
_max_height_and_y_coords = {}
def __init__(self, editwin):
self... |
1,663 | global msg domain lang | from django.utils.translation import gettext as _
from django.utils.translation import gettext_noop
from corehq.apps.translations.models import SMSTranslations
from corehq.util.translation import localize
MSG_GENERIC_ERROR = "sms.survey.restart"
MSG_TOUCHFORMS_DOWN = "sms.survey.temporarilydown"
MSG_TOUCHFORMS_ERROR ... |
1,664 | items | import numpy as np
from pyNastran.femutils.utils import unique2d
#from pyNastran.dev.bdf_vectorized.cards.elements.solid.ctetra4 import volume4
#from pyNastran.dev.bdf_vectorized.cards.elements.solid.chexa8 import quad_area_centroid
#from pyNastran.dev.bdf_vectorized.cards.elements.solid.cpenta6 import tri_area_centro... |
1,665 | test require login | from django.test import TestCase
from .testutils import *
# For now we just have sanity checks for the templates used
# This could be enhanced by verifying the context data
class HomeTestCase(TestCase):
def setUp(self):
pass
def test_template(self):
response = self.client.get(reverse('home'... |
1,666 | test asyncio | import asyncio
import collections
import sys
import time
import pytest
from ddtrace.profiling import _asyncio
from ddtrace.profiling import profiler
from ddtrace.profiling.collector import stack_event
from ddtrace.profiling.collector.stack import StackCollector
from . import _asyncio_compat
def patch_stack_collect... |
1,667 | test extend list deduplicated | import itertools
import inspect
import binascii
import pytest
from dlt.common.runners import Venv
from dlt.common.utils import (graph_find_scc_nodes, flatten_list_of_str_or_dicts, digest128, graph_edges_to_nodes, map_nested_in_place,
reveal_pseudo_secret, obfuscate_pseudo_secret, get_modu... |
1,668 | sort items | from __future__ import absolute_import, division, print_function
import wxtbx.bitmaps
from libtbx.queuing_system_utils import sge_utils
from libtbx.utils import Sorry
import wx
try :
from wx.lib.agw.genericmessagedialog import GenericMessageDialog
except ImportError :
GenericMessageDialog = wx.MessageBox
import s... |
1,669 | extract source | import requests
import os
from bs4 import BeautifulSoup
import urllib
import re
import time
import sys
from selenium import webdriver
__noted__ = "fixes shamelessly stolen from dunnousername without credit" # Just don't delete this
webpage = "http://beaumontpd.org/crime-statistics/"
"""
Click the links that lead to ... |
1,670 | eval residual | """
Homogenized nonlinear hyperelastic material with evolving microstructure
deformation in each macroscopic quadrature point.
Run in parallel using::
mpiexec -n 4 sfepy-run --app=bvp-mM --debug-mpi sfepy/examples/homogenization/nonlinear_hyperelastic_mM.py
"""
import numpy as nm
import six
from sfepy import data_... |
1,671 | create step outputs | import asyncio
import inspect
from typing import (
Any,
AsyncIterator,
Callable,
Iterator,
List,
Mapping,
Sequence,
Set,
TypeVar,
Union,
)
from typing_extensions import TypeAlias
import dagster._check as check
from dagster._core.definitions import (
AssetCheckEvaluation,
... |
1,672 | primary key | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ =... |
1,673 | test run through message interrupt save and | # -*- coding: utf-8 -*-
from SpiffWorkflow.task import TaskState
from SpiffWorkflow.bpmn.workflow import BpmnWorkflow
from SpiffWorkflow.bpmn.event import BpmnEvent
from SpiffWorkflow.bpmn.specs.event_definitions.message import MessageEventDefinition
from ..BpmnWorkflowTestCase import BpmnWorkflowTestCase
__author__ =... |
1,674 | 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... |
1,675 | create space path | from urllib.parse import urlparse
import squish
from os import makedirs
from os.path import exists, join
from helpers.SpaceHelper import get_space_id
from helpers.ConfigHelper import get_config, set_config
from helpers.SyncHelper import listenSyncStatusForItem
def substituteInLineCodes(value):
value = value.repla... |
1,676 | count max reuse followers | from flask import g, current_app
from werkzeug.local import LocalProxy
from udata.models import db, WithMetrics
from udata.core.organization.models import Organization
from udata.core.dataset.models import Dataset
from udata.core.reuse.models import Reuse
__all__ = ('Site', 'SiteSettings')
DEFAULT_FEED_SIZE = 20
... |
1,677 | test unicast missing port | """Functional tests for scanning.
The tests here are supposed to cover non-protocol specific aspects of
scanning, like scanning for a specific device or derive device model.
Two "generic" protocols (MRP and AirPlay) have been arbitrarily chosen
to have something to test with (could have been other protocols). They
are... |
1,678 | compilers minimum version | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.files import get, copy, rmdir, replace_in_file
from conan.tools.build import check_min_cppstd
from conan.tools.scm import Version
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
import os
requir... |
1,679 | remove by hash | """
ssh_key_management: Endpoints for managing SSH keys on the robot
"""
import contextlib
import functools
import hashlib
import ipaddress
import logging
import os
from typing import (
Any,
Generator,
IO,
List,
Tuple,
)
from aiohttp import web
from .handler_type import Handler
LOG = logging.get... |
1,680 | clean name | """
Copyright 2016, 2017 UFPE - Universidade Federal de Pernambuco
Este arquivo é parte do programa Amadeus Sistema de Gestão de Aprendizagem, ou simplesmente Amadeus LMS
O Amadeus LMS é um software livre; você pode redistribui-lo e/ou modifica-lo dentro dos termos da Licença Pública Geral GNU como publicada pela ... |
1,681 | tear down | # Copyright 2018 gevent contributors. See LICENSE for details.
import os
import unittest
import sys
from gevent import _config
class TestResolver(unittest.TestCase):
old_resolver = None
def setUp(self):
if 'GEVENT_RESOLVER' in os.environ:
self.old_resolver = os.environ['GEVENT_RESOLVER'... |
1,682 | log | import argparse
import os
import numpy as np
import timeit
import tensorflow as tf
import horovod.tensorflow as hvd
from tensorflow.keras import applications
# Benchmark settings
parser = argparse.ArgumentParser(description='TensorFlow Synthetic Benchmark',
formatter_class=argparse.Ar... |
1,683 | iterkeys | from _typeshed import StrPath, SupportsKeysAndGetItem
from collections.abc import Container, Iterable, Iterator, Mapping, MutableMapping, Sequence
from typing import TypeVar, overload
from typing_extensions import Literal, TypeAlias
from uuid import UUID
_T = TypeVar("_T")
_Token: TypeAlias = (
tuple[Literal["EMP... |
1,684 | test eval gives lambda custom globals | # Test the most dynamic corner cases of Python's runtime semantics.
import builtins
import unittest
from test.support import swap_item, swap_attr
class RebindBuiltinsTests(unittest.TestCase):
"""Test all the ways that we can change/shadow globals/builtins."""
def configure_func(self, func, *args):
... |
1,685 | test st video from url | # 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... |
1,686 | thread run | import logging
import re
import threading
from typing import Dict, Optional
from urllib.parse import urlparse
from flask import request
from requests.models import Request
from requests.structures import CaseInsensitiveDict
from localstack import config
from localstack.constants import APPLICATION_JSON, APPLICATION_X... |
1,687 | subnet resource 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 . im... |
1,688 | path and query | import json
import re
from datetime import datetime
from os.path import join
from urllib.parse import parse_qs, urlsplit
from django.core.files.base import ContentFile
from django.core.files.storage import DefaultStorage
from django.core.management.base import BaseCommand
from django.test import Client
def METHOD_NA... |
1,689 | test linear gradients 3 | """Test how gradients are drawn."""
from ..testing_utils import assert_no_logs
@assert_no_logs
def test_linear_gradients_1(assert_pixels):
assert_pixels('''
_____
_____
_____
BBBBB
BBBBB
RRRRR
RRRRR
RRRRR
RRRRR
''', '''<style>@page { siz... |
1,690 | test list subtitles movie no imdb | # -*- coding: utf-8 -*-
import pytest
import os
from subliminal_patch.providers.argenteam import ArgenteamProvider
from subliminal_patch.providers.argenteam import ArgenteamSubtitle
from subliminal_patch.core import Episode
from subzero.language import Language
@pytest.mark.parametrize(
"imdb_id,expected_id", [(... |
1,691 | pipeline | # Copyright (c) 2020-2022, NVIDIA CORPORATION & 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.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
1,692 | test module repr with name | # Test the module type
import unittest
import weakref
from test.support import run_unittest, gc_collect
from test.script_helper import assert_python_ok
import sys
ModuleType = type(sys)
class FullLoader:
@classmethod
def module_repr(cls, m):
return "<module '{}' (crafted)>".format(m.__name__)
class B... |
1,693 | clamp to origin | from PyQt5.QtCore import QObject, Qt
from PyQt5.QtGui import QColor, QCursor, QPainter, QPainterPath, QPixmap
from PyQt5.QtWidgets import QApplication, QGraphicsDropShadowEffect
from defconQt.tools.drawing import applyEffectToPixmap
_path = QPainterPath()
_path.moveTo(9, 7.3)
_path.lineTo(9, 24)
_path.lineTo(21, 12)
... |
1,694 | test compute gradient | #
# 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... |
1,695 | is marked for disconnect |
import time
import signal
import os
from ..common.trex_types import RC_OK, RC_ERR
from ..common.trex_req_resp_client import JsonRpcClient, BatchMessage, ErrNo as JsonRpcErrNo
class RRConnection(object):
'''
Manages a simple RR connection to the server
connection state object
describes t... |
1,696 | get xs | from collections import OrderedDict, namedtuple
from math import sin, cos, pi, sqrt, atan2
Box = namedtuple('Box', 'x y dx dy') # corner and size of a 2D shape
Padding = namedtuple('Padding', 'x y')
def clip_angles(a1, a2):
"Return the angles such that a1 to a2 extend at maximum from -pi to pi"
EPSILON = 1... |
1,697 | simulate | from campaign.campaign_main.campaign_7_2 import MAP
from module.campaign.campaign_base import CampaignBase
from module.config.config import AzurLaneConfig
from module.logger import logger
from module.map_detection.homography import Homography
from module.map_detection.utils import *
class Config:
pass
# Unive... |
1,698 | test expression table control | # 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 ... |
1,699 | set up | import unittest
from flood_forecast.transformer_xl.informer import Informer
from flood_forecast.transformer_xl.data_embedding import DataEmbedding
from flood_forecast.preprocessing.pytorch_loaders import TemporalLoader, TemporalTestLoader
from flood_forecast.temporal_decoding import decoding_function
import torch
cla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.