id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
9,700
get num slices
#!/usr/bin/python ################## # TiffDataSource.py # # Copyright David Baddeley, 2009 # d.baddeley@auckland.ac.nz # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the...
9,701
do the read
# Copyright (c) "Neo4j" # Neo4j Sweden AB [https://neo4j.com] # # This file is part of Neo4j. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2...
9,702
line to
from fontTools.pens.basePen import BasePen from functools import partial from itertools import count import sympy as sp import sys n = 3 # Max Bezier degree; 3 for cubic, 2 for quadratic t, x, y = sp.symbols("t x y", real=True) c = sp.symbols("c", real=False) # Complex representation instead of x/y X = tuple(sp.sy...
9,703
test two cl is in parallel test
import qt import slicer from slicer.ScriptedLoadableModule import * # # TwoCLIsInParallelTest # class TwoCLIsInParallelTest(ScriptedLoadableModule): def __init__(self, parent): parent.title = "TwoCLIsInParallelTest" # TODO make this more human readable by adding spaces parent.categories = ["Tes...
9,704
aut o techsuppor t global
""" Auto-generated show CLI plugin. Manually Edited to add show cli for "show auto_techsupport history" """ import click import tabulate import natsort import utilities_common.cli as clicommon def format_attr_value(entry, attr): """ Helper that formats attribute to be presented in the table output. Args: ...
9,705
point distances
import array import geohash import os import math import operator import six import ujson as json from collections import defaultdict, OrderedDict from leveldb import LevelDB from geodata.distance.haversine import haversine_distance class PointIndex(object): include_only_properties = None persistent_index ...
9,706
layout
from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps from conan.tools.files import get, copy, rmdir from conan.tools.METHOD_NAME import basic_layout from conan.errors import ConanInvalidConfiguration from conan.tools.microsoft import c...
9,707
get selection
from travertino.size import at_least from ..libs import GdkPixbuf, Gtk from .base import Widget from .table import TogaRow class Tree(Widget): def create(self): self.store = None # Create a tree view, and put it in a scroll view. # The scroll view is the _impl, because it's the outer con...
9,708
extended option
# Copyright 2021-2023 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 from __future__ import annotations import functools import logging import os import shutil from dataclasses import dataclass import click from vdk.internal.control.configuration.defaults_config import load_default_rest_api_url from vdk.internal....
9,709
run vm
# TCG Plugins tests # # These are a little more involved than the basic tests run by check-tcg. # # Copyright (c) 2021 Linaro # # Author: # Alex Bennée <alex.bennee@linaro.org> # # SPDX-License-Identifier: GPL-2.0-or-later import tempfile import mmap import re from boot_linux_console import LinuxKernelTest class P...
9,710
init ndim
import numpy as np from AnyQt.QtCore import Qt from Orange.data import Table, ContinuousVariable from Orange.widgets.settings import DomainContextHandler, ContextSetting from Orange.widgets.utils.itemmodels import DomainModel from Orange.widgets.widget import OWWidget, Input, Output, Msg from Orange.widgets import gu...
9,711
grad
""" Copyright 2013 Steven Diamond 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...
9,712
convert flat dict to nested dict
# Copyright 2022 MosaicML Composer authors # SPDX-License-Identifier: Apache-2.0 """Contains helper functions for auto-logging hparams.""" from enum import Enum from typing import Any, Dict, List, Tuple __all__ = ['extract_hparams', 'convert_nested_dict_to_flat_dict', 'convert_flat_dict_to_nested_dict'] def extrac...
9,713
get network
""" A route is a rule that specifies how certain packets should be handled by the virtual network. Routes are associated with virtual machine instances by tag, and the set of routes for a particular VM is called its routing table. For each packet leaving a virtual machine, the system searches that machine's routing tab...
9,714
test datasource store get by name
from typing import Callable, Dict from unittest import mock import pytest from great_expectations.core.serializer import DictConfigSerializer from great_expectations.data_context.cloud_constants import GXCloudRESTResource from great_expectations.data_context.store import DatasourceStore from great_expectations.data_c...
9,715
num pitches
# Copyright 2023 The Magenta 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 ...
9,716
run
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
9,717
main
#!/usr/bin/env python # -*- coding: utf-8 import sys import anvio import anvio.terminal as terminal import anvio.taxonomyops.trna as trnataxonomyops from anvio.errors import ConfigError, FilesNPathsError __author__ = "Developers of anvi'o (see AUTHORS.txt)" __copyright__ = "Copyleft 2015-2020, the Meren Lab (http:...
9,718
test resume must failure
import os import pickle import sys import numpy as np import pytest import wandb from wandb import wandb_sdk from wandb.errors import UsageError def test_log_code(wandb_init): run = wandb_init(mode="offline") with open("test.py", "w") as f: f.write('print("test")') with open("big_file.h5", "w") a...
9,719
send confirmation email
# Copyright 2021 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) from lxml import etree from odoo import fields, models from odoo.osv import expression from odoo.tools.safe_eval import safe_eval from odoo.addons.base.models.ir_ui_view import ( transfer_modifiers_to_node, transfer...
9,720
import users
import io import os from flask import current_app from linotp.lib.user import User from linotp.tests import TestController class TestAdminUserPrivilege(TestController): ADMIN_REALM = None ADMIN_RESOLVER = None def setUp(self): self.ADMIN_REALM = current_app.config["ADMIN_REALM_NAME"].lower() ...
9,721
aggregate labels
from collections import defaultdict from typing import Dict, List, Optional, Tuple, Union from haystack.schema import Label, MultiLabel def METHOD_NAME( labels: List[Label], add_closed_domain_filter: bool = False, add_meta_filters: Optional[Union[str, list]] = None, drop_negative_labels: bool = False...
9,722
parse from output
# Copyright 2023 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
9,723
read
# LocalStack Resource Provider Scaffolding v2 from __future__ import annotations import json import random import string from pathlib import Path from typing import Optional, Type, TypedDict import localstack.services.cloudformation.provider_utils as util from localstack.services.cloudformation.resource_provider impo...
9,724
test fetch from container
# # 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...
9,725
test lambda scheduler steps with optimizer single
# Copyright 2021 The HuggingFace Team. 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 applicabl...
9,726
test expand metrics
import pytest from sqlmesh.core import dialect as d from sqlmesh.core.metric import expand_metrics, load_metric_ddl from sqlmesh.core.metric.definition import _get_measure_and_dim_tables from sqlmesh.utils.errors import ConfigError def test_load_metric_ddl(): a = d.parse_one( """ -- description a ...
9,727
on 200
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
9,728
test 405 error
from django.utils.translation import gettext as _ from rest_framework.test import APIRequestFactory, APITestCase from . import error_views as views class ExceptionHandlerTests(APITestCase): """ Test the error handling responses """ maxDiff = None factory = APIRequestFactory() def assertErr...
9,729
test unpin all general forum topic messages
from typing import Optional from pytest import mark, param from aiogram.enums import ChatAction from aiogram.types import BufferedInputFile, Chat, ChatPermissions class TestChat: def test_ban_sender_chat(self): chat = Chat(id=-42, type="supergroup") method = chat.ban_sender_chat(sender_chat_id=...
9,730
test get order
""" Oanda interface custom unit tests. Copyright (C) 2021 Emerson Dove This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your opt...
9,731
direction
"""Metric model class.""" from __future__ import annotations from collections.abc import Callable, Sequence from datetime import date from typing import TYPE_CHECKING, cast from shared.utils.type import ( Direction, MetricId, Scale, SourceId, Status, SubjectId, TargetType, ) from .source...
9,732
circle size args
import pytest import os from simba.plotting.directing_animals_visualizer import DirectingOtherAnimalsVisualizer from simba.plotting.directing_animals_visualizer_mp import DirectingOtherAnimalsVisualizerMultiprocess IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true" class TestDirectingAnimalsVisualizer(object)...
9,733
symbolic
# Copyright (c) OpenMMLab. All rights reserved. from torch import nn from torch.autograd import Function from torch.autograd.function import once_differentiable from torch.nn.modules.utils import _pair from ..utils import ext_loader ext_module = ext_loader.load_ext( '_ext', ['deform_roi_pool_forward', 'deform_roi...
9,734
test issues request params
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # from unittest.mock import MagicMock import pendulum as pdm import pytest from source_sentry.streams import Events, Issues, ProjectDetail, Projects, SentryStreamPagination INIT_ARGS = {"hostname": "sentry.io", "organization": "test-org", "project": "test-pr...
9,735
write
# Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license import selectors import socket import ssl import struct import threading import time import aioquic.quic.configuration # type: ignore import aioquic.quic.connection # type: ignore import aioquic.quic.events # type: ignore import dns.excep...
9,736
test 9
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES). # # Copyright (c) 2018-2023 by the software own...
9,737
expected 1
# 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...
9,738
sortnum
"""Unit tests for the keyword only argument specified in PEP 3102.""" __author__ = "Jiwon Seo" __email__ = "seojiwon at gmail dot com" import unittest from test.support import run_unittest def posonly_sum(pos_arg1, *arg, **kwarg): return pos_arg1 + sum(arg) + sum(kwarg.values()) def keywordonly_sum(*, k1=0, k2):...
9,739
update function
import logging from io import BytesIO from zipfile import ZipFile import requests from django.conf import settings from google.cloud.functions_v1.services.cloud_functions_service import CloudFunctionsServiceClient from google.cloud.functions_v1.types import ( CloudFunction, EventTrigger, GenerateUploadUrlR...
9,740
read block schemas
""" Routes for interacting with block schema objects. """ from typing import List, Optional from uuid import UUID from fastapi import Body, Depends, HTTPException, Path, Query, Response, status from prefect.server import models, schemas from prefect.server.api import dependencies from prefect.server.database.dependen...
9,741
test index objects while reindexing
from unittest import mock from olympia.addons.indexers import AddonIndexer from olympia.addons.models import Addon from olympia.amo.tests import ESTestCase, TestCase, addon_factory from olympia.search.models import Reindexing from olympia.search.utils import get_es, index_objects, unindex_objects class TestGetES(EST...
9,742
is runner enabled
# Copyright (c) 2015-2016 ACSONE SA/NV (<http://acsone.eu>) # Copyright 2016 Camptocamp SA # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html) import logging from threading import Thread import time from odoo.service import server from odoo.tools import config try: from odoo.addons.server_environ...
9,743
remove tmpdir
#!/usr/bin/env python # coding: UTF-8 # Copyright (c) 2012-2016 Seafile Ltd. import sys import os import tempfile import shutil import subprocess import subprocess import atexit import optparse cwd = os.getcwd() #################### ### Common helper functions #################### def highlight(content, is_error=Fal...
9,744
default handler
# Copyright 2021-2023 VMware, Inc. # SPDX-License-Identifier: Apache-2.0 import logging import os import sys from dataclasses import dataclass from typing import Any from typing import cast from typing import Dict from typing import List from typing import Optional import click from vdk.api.plugin.hook_markers import ...
9,745
refresh
# # Copyright 2018-2022 GoPro Inc. # # 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...
9,746
set callback
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
9,747
write
import logging from odoo import _, api, fields, models from odoo.exceptions import UserError from odoo.addons.base_vat.models.res_partner import _eu_country_vat CODE_SPAIN = "ES" _logger = logging.getLogger(__name__) class ResPartner(models.Model): _inherit = "res.partner" ine_code = fields.Char( ...
9,748
test xcdecorator
# coding: utf-8 import sys import abipy.data as abidata import abipy.abilab as abilab import abipy.abio.decorators as ideco from abipy.core.testing import AbipyTest from abipy.abio.factories import * class DecoratorTest(AbipyTest): def setUp(self): # Si ebands si_structure = abilab.Structure.fro...
9,749
main
#! /usr/bin/env python ######################################################################## # File : dirac-stager-monitor-file # Author : Daniela Remenska ######################################################################## """ Give monitoring information regarding a staging file uniquely identified with (L...
9,750
check uri
from __future__ import annotations import urllib.parse from collections.abc import Iterable, Mapping from typing import Any, Literal, Optional, TypeVar, Union, get_args from mopidy import exceptions from mopidy.audio.constants import PlaybackState from mopidy.types import ( DistinctField, Query, QueryValu...
9,751
get top cryptocurrencies
from bs4 import BeautifulSoup import requests class CoinMarketCap: """ Create an instance of `CoinMarketCap` class ```python crypto = CoinMarketCap() ``` | Method | Details | | ---------------------------- | -...
9,752
populate symbol vector
# IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # $Source: src/build/tools/ebmc/symbols.py $ # # OpenPOWER HostBoot Project # # Contributors Listed Below - COPYRIGHT 2020 # [+] International Business Machines Corp. # # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not...
9,753
test delete customer gateway
from tests.compat import OrderedDict from tests.unit import unittest from tests.unit import AWSMockServiceTestCase from boto.vpc import VPCConnection, CustomerGateway class TestDescribeCustomerGateways(AWSMockServiceTestCase): connection_class = VPCConnection def default_body(self): return b""" ...
9,754
add to queue
from decouple import config from confluent_kafka import Consumer from datetime import datetime import os as _os import queue import requests import json from time import time, sleep #decryption = config('encrypted', cast=bool) decryption = False MessageCodec = None max_retry=3 Fetch, FetchEvent, PageEvent, GraphQ =...
9,755
test cityscapes stdc seg75 train dataloader
import unittest from typing import Type import pkg_resources import yaml from torch.utils.data import DataLoader, Dataset from super_gradients.training.dataloaders.dataloaders import ( cityscapes_train, cityscapes_val, cityscapes_stdc_seg50_train, cityscapes_stdc_seg50_val, cityscapes_stdc_seg75_v...
9,756
download failed
from Components.Task import PythonTask, Task, Job, job_manager as JobManager, Condition from Tools.Directories import fileExists from enigma import eTimer from os import path from shutil import rmtree, copy2, move class DeleteFolderTask(PythonTask): def openFiles(self, fileList): self.fileList = fileList def wor...
9,757
method
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
9,758
step delete
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # ------------------------------------------------------------------...
9,759
unix getpass
"""Utilities to get a password and/or the current user name. getpass(prompt[, stream]) - Prompt for a password, with echo turned off. getuser() - Get the user name from the environment or password database. GetPassWarning - This UserWarning is issued when getpass() cannot prevent echoing of the passw...
9,760
generate unsub topic action
import logging import grpc from couchers import errors, urls from couchers.constants import DATETIME_INFINITY from couchers.crypto import UNSUBSCRIBE_KEY_NAME, b64encode, generate_hash_signature, get_secret, verify_hash_signature from couchers.db import session_scope from couchers.models import GroupChatSubscription,...
9,761
old skyline
# -*- coding: utf-8 -*- """Tests for dataset analysis utilities.""" import itertools import unittest from typing import Iterable, Mapping import numpy as np import pandas from pykeen.datasets import Dataset, Nations from pykeen.datasets import analysis as dataset_analysis from pykeen.triples import analysis as trip...
9,762
last modified by 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 __all__ =...
9,763
test finance denied
# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. import pytest from jinja2.runtime import Context from sqlalchemy.orm import Session from pycroft.model.config i...
9,764
partial constant body request
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ """Customize generated code here. Follow our quickstart for examples: https://aka.ms/azsdk/python/dpcodegen/python/customize """ from typing import Any, Dict, List, cas...
9,765
pillar cache dir
""" unit tests for the pillar runner """ import logging import os import shutil import pytest import salt.runners.pillar as pillar_runner import salt.utils.files import salt.utils.gitfs import salt.utils.msgpack from tests.support.mock import MagicMock, mock_open, patch log = logging.getLogger(__name__) @pytest.f...
9,766
test isnt match
# -*- coding: utf-8 -*- import os from subprocess import PIPE, STDOUT from mock import Mock import pytest from tests.utils import CorrectedCommand, Rule from thefuck import const from thefuck.exceptions import EmptyCommand from thefuck.system import Path from thefuck.types import Command class TestCorrectedCommand(o...
9,767
dataset
######################################################################### # # Copyright (C) 2018 OSGeo # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at...
9,768
test disk quota default
''' copyright: Copyright (C) 2015-2022, Wazuh Inc. Created by Wazuh, Inc. <info@wazuh.com>. This program is free software; you can redistribute it and/or modify it under the terms of GPLv2 type: integration brief: File Integrity Monitoring (FIM) system watches selected files and triggering ale...
9,769
set rpm
from __future__ import annotations from enum import Enum import asyncio from typing import Optional, Dict from opentrons.drivers import utils from opentrons.drivers.command_builder import CommandBuilder from opentrons.drivers.asyncio.communication import AsyncResponseSerialConnection from opentrons.drivers.heater_sha...
9,770
save plot
#!/usr/bin/env python """Make graphics and example image for coordinate tutorial Expects MNI nonlinear template t1 and t2 images in directory of script - specifically these files: * mni_icbm152_t1_tal_nlin_asym_09a.nii * mni_icbm152_t2_tal_nlin_asym_09a.nii Requires nipy and matplotlib. Executing this script genera...
9,771
date to date number
# 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...
9,772
dump
# cython: auto_cpdef=True """ Python Lexical Analyser Converting NFA to DFA """ from __future__ import absolute_import from . import Machines from .Machines import LOWEST_PRIORITY from .Transitions import TransitionMap def nfa_to_dfa(old_machine, debug=None): """ Given a nondeterministic Machine, return a n...
9,773
get notifyicondataw
''' Defines ctypes windows api. ''' __all__ = ('GUID', 'get_DLLVERSIONINFO', 'MAKEDLLVERULL', 'get_NOTIFYICONDATAW', 'CreateWindowExW', 'WindowProc', 'DefWindowProcW', 'get_WNDCLASSEXW', 'GetModuleHandleW', 'RegisterClassExW', 'UpdateWindow', 'LoadImageW', 'Shell_NotifyIconW...
9,774
update label
################################################################# # seSceneGraphExplorer.py # Originally from SceneGraphExplorer.py # Altered by Yi-Hong Lin, yihhongl@andrew.cmu.edu, 2004 # # we need a customized SceneGraphExplorer. # # Do forget to check the seTree. # ##################################################...
9,775
test42
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2021 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it a...
9,776
tag frequency
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://www.apache.org/licenses/LICENSE-2.0 # # or in the "license...
9,777
grav pot
__author__ = "sibirrer" import numpy as np import scipy.special as special from lenstronomy.LensModel.Profiles.base_profile import LensProfileBase __all__ = ["SPP"] class SPP(LensProfileBase): """Class for circular power-law mass distribution.""" param_names = ["theta_E", "gamma", "center_x", "center_y"] ...
9,778
send error and close
import time import threading from DIRAC import gLogger, S_ERROR from DIRAC.Core.Utilities.ThreadScheduler import gThreadScheduler class TransportPool: def __init__(self, logger=False): if logger: self.log = logger else: self.log = gLogger self.__modLock = threading....
9,779
controller
#!/usr/bin/env python # # Copyright (C) 2016 GNS3 Technologies Inc. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # ...
9,780
visit individual node
from typing import Mapping, MutableMapping, Optional, Set from snuba.clickhouse.query_dsl.accessors import get_time_range_estimate from snuba.query import ProcessableQuery from snuba.query.composite import CompositeQuery from snuba.query.conditions import BooleanFunctions from snuba.query.data_source.join import Indiv...
9,781
find longest common time window from list
#!/usr/bin/env python """ This module contains helper functions for miscellaneous stuff. Calculations, optimisations, .... @UofA, 2013 (LK) """ import sys import os import numpy as np import ctypes def METHOD_NAME(lo_time_windows, sampling_rate): """ Determine the longest consecutive time window, in whic...
9,782
mock jwt decode
# -------------------------------------------------------------------------- # 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 cause incor...
9,783
get imported symbol
import types import sys from pyrevit import EXEC_PARAMS, HOST_APP, DOCS from pyrevit import PyRevitException from pyrevit import framework from pyrevit.coreutils.logger import get_logger from pyrevit import DB, UI #pylint: disable=W0401 from pyrevit.revit.db import * from pyrevit.revit.db import query from pyrevit.re...
9,784
write
# # This file is part of Dragonfly. # (c) Copyright 2007, 2008 by Christo Butcher # Licensed under the LGPL. # # Dragonfly is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software Foundation, either version 3 of the L...
9,785
global function hook
import pytest import spytest.framework as stf from utilities.common import get_proc_name def trace(fmt, *args): if args: stf.dtrace(fmt % args) else: stf.dtrace(fmt) def unused_pytest_collect_file(parent, path): trace("\n%s: start", get_proc_name()) trace("{} {}".format(parent, path)...
9,786
parameterize
import os import unittest import collections import email from email.message import Message from email._policybase import compat32 from test.support import load_package_tests from test.test_email import __file__ as landmark # Load all tests in package def load_tests(*args): return load_package_tests(os.path.dirnam...
9,787
checkpoint
import json from typing import List import pandas as pd import pytest from great_expectations import DataContext from great_expectations.METHOD_NAME import Checkpoint from great_expectations.core.util import convert_to_json_serializable from great_expectations.data_context.types.base import CheckpointConfig from grea...
9,788
ping hail backend
from collections import defaultdict from django.db.models import F, Min import requests from reference_data.models import Omim, GeneConstraint, GENOME_VERSION_LOOKUP from seqr.models import Sample, PhenotypePrioritization from seqr.utils.search.constants import PRIORITIZED_GENE_SORT from seqr.utils.xpos_utils import M...
9,789
runner
import math import textwrap import sys import pytest import threading import traceback import time import numpy as np from numpy.testing import IS_PYPY from . import util class TestF77Callback(util.F2PyTest): sources = [util.getpath("tests", "src", "callback", "foo.f")] @pytest.mark.parametrize("name", "t,t...
9,790
system data
# 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...
9,791
test xml case d full
""" tests.unit.xmlutil_test ~~~~~~~~~~~~~~~~~~~~ """ import xml.etree.ElementTree as ET import salt.utils.xmlutil as xml from tests.support.unit import TestCase class XMLUtilTestCase(TestCase): """ Tests that salt.utils.xmlutil properly parses XML data and returns as a properly formatted dictiona...
9,792
pre change open basedir
from .signals import * from plogical.pluginManagerGlobal import pluginManagerGlobal class pluginManager: @staticmethod def preWebsiteCreation(request): return pluginManagerGlobal.globalPlug(request, preWebsiteCreation) @staticmethod def postWebsiteCreation(request, response): return p...
9,793
test import relative delta all
import sys import pytest HOST_IS_WINDOWS = sys.platform.startswith('win') def test_import_version_str(): """ Test that dateutil.__version__ can be imported""" from dateutil import __version__ def test_import_version_root(): import dateutil assert hasattr(dateutil, '__version__') # Test that date...
9,794
test get backend aliases
import threading from contextlib import contextmanager from unittest.mock import patch import pytest import celery.contrib.testing.worker as contrib_embed_worker from celery.app import backends from celery.backends.cache import CacheBackend from celery.exceptions import ImproperlyConfigured from celery.utils.nodename...
9,795
plan
# 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...
9,796
inputhook wx2
"""Enable wxPython to be used interactively in prompt_toolkit """ import sys import signal import time from timeit import default_timer as clock import wx def ignore_keyboardinterrupts(func): """Decorator which causes KeyboardInterrupt exceptions to be ignored during execution of the decorated function. ...
9,797
set up
# This code is part of Qiskit. # # (C) Copyright IBM 2020, 2023. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
9,798
test track mouse position
"""Test render window interactor""" import time import pytest import pyvista as pv from pyvista import _vtk def empty_callback(): return @pytest.mark.needs_vtk_version(9, 1) def test_observers(): pl = pv.Plotter() # Key events with pytest.raises(TypeError): pl.add_key_event('w', 1) ...
9,799
re map severity
""" Faraday Penetration Test IDE Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/) See the file 'doc/LICENSE' for the license information """ import re import xml.etree.ElementTree as ET from urllib.parse import urlparse from faraday_plugins.plugins.plugin import PluginXMLFormat __author__ = "Francisco ...