id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
16,500
reopen
# Copyright 2015 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...
16,501
in continuous integration
import io import os import contextlib from dlt.common.typing import StrStr, StrAny, Literal, List from dlt.common.utils import filter_env_vars from dlt.version import __version__ TExecInfoNames = Literal["kubernetes", "docker", "codespaces", "github_actions", "airflow", "notebook", "colab","aws_lambda","gcp_cloud_fu...
16,502
barrel shuffle
"""Module used to handle setting and randomizing bonus barrels.""" import random import js import randomizer.Fill as Fill import randomizer.Lists.Exceptions as Ex from randomizer.Enums.Minigames import Minigames from randomizer.Enums.Settings import MinigameBarrels, MinigamesListSelected from randomizer.Lists.MapsAndE...
16,503
get service name
import datetime import pytz from flask_jwt_extended import current_user from sqlalchemy import event, func from sqlalchemy.sql import func as sql_func from sqlalchemy_utils import aggregated from app.models import db from app.models.base import SoftDeletionModel from app.models.feedback import Feedback from app.model...
16,504
conv bn
"""Tests for collecting layer histogram.""" import unittest from collections import OrderedDict import numpy as np import torch import torch.nn as nn from neural_compressor.utils import logger from neural_compressor.utils.collect_layer_histogram import LayerHistogramCollector class InvertedResidual(nn.Module): ...
16,505
test skip plugin
""" Copyright (c) 2017, 2019 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ import koji from atomic_reactor.plugins.koji_tag_build import KojiTagBuildPlugin from atomic_reactor.plugins.koji_import import KojiIm...
16,506
test register
import time from unittest.mock import MagicMock from cobbler.items.distro import Distro from cobbler.items.profile import Profile from cobbler.items.system import NetworkInterface, System from cobbler.modules.managers import dnsmasq from cobbler.templar import Templar def METHOD_NAME(): # Arrange & Act resul...
16,507
on user created
import typing from tracim_backend.lib.core.plugins import hookspec from tracim_backend.lib.utils.request import TracimContext from tracim_backend.models.auth import User from tracim_backend.models.call import UserCall from tracim_backend.models.data import Content from tracim_backend.models.data import UserRoleInWorks...
16,508
fpga filter
#!/usr/bin/env python3 # Copyright(c) 2019, Intel Corporation # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of con...
16,509
display name
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
16,510
test apply auto limit origin have limit
import unittest from redash.query_runner import BaseQueryRunner, BaseSQLQueryRunner from redash.utils import gen_query_hash class TestBaseSQLQueryRunner(unittest.TestCase): def setUp(self): self.query_runner = BaseSQLQueryRunner({}) def test_check_query_limit_no_limit(self): query = "SELECT ...
16,511
test eq ne and hash
# Copyright 2018 The Cirq Developers # # 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.0 # # Unless required by applicable law or agreed to in ...
16,512
lin reg
""" Copyright 2020 kivou.2000607@gmail.com This file is part of yata. yata 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 any later version. yata is dist...
16,513
volume using pressure function
# This file is part of BurnMan - a thermoelastic and thermodynamic toolkit for # the Earth and Planetary Sciences # Copyright (C) 2012 - 2022 by the BurnMan team, released under the GNU # GPL v2 or later. import numpy as np import scipy.optimize as opt from ..utils.math import bracket class Calibrant(object): ""...
16,514
test error
from __future__ import annotations import cftime import numpy as np import pandas as pd import pytest from icclim.icclim_exceptions import InvalidIcclimArgumentError from icclim.models.frequency import FrequencyRegistry, get_seasonal_time_updater from icclim.tests.testing_utils import stub_tas class Test_build_freq...
16,515
get emojis
from datetime import datetime from io import BytesIO from typing import Any, Dict, List, Optional, Tuple, Type, TypeVar, Union, overload from urllib3.util import Retry from github.AppAuthentication import AppAuthentication from github.ApplicationOAuth import ApplicationOAuth from github.Auth import Auth from github.A...
16,516
var dictionary
import os from datetime import datetime from unittest import mock import pandas as pd import pytest from O365.account import Account from viadot.exceptions import CredentialError from viadot.sources import Outlook @pytest.fixture def METHOD_NAME(): variables = { "mailbox_name": "random@random.com", ...
16,517
get file
import logging from django.conf import settings from django.db import models, router, transaction from django.urls import reverse from django.utils import timezone from django.utils.encoding import force_str from sentry.backup.scopes import RelocationScope from sentry.db.models import ( BoundedBigIntegerField, ...
16,518
is admin bot
import logging from typing import Dict, List, Optional, Tuple from robusta.core.model.env_vars import ROBUSTA_LOGO_URL from robusta.integrations.common.requests import HttpMethod, check_response_succeed, process_request _API_PREFIX = "api/v4" class MattermostClient: channel_id: str bot_id: str team_id: O...
16,519
set batch data
from __future__ import annotations import json from typing import TYPE_CHECKING, Any, ClassVar, List, Optional, Set, Union import great_expectations.exceptions as gx_exceptions from great_expectations.compatibility.typing_extensions import override from great_expectations.core.batch import ( Batch, BatchReque...
16,520
test prediction proba linear confidence
# -*- coding: utf-8 -*- from __future__ import division from __future__ import print_function import os import sys import unittest # noinspection PyProtectedMember from numpy.testing import assert_allclose from numpy.testing import assert_array_less from numpy.testing import assert_equal from numpy.testing import ass...
16,521
cns format
from __future__ import absolute_import, division, print_function # CNS 1.1 spacegroup.lib symbols sgtbx_lookup_symbol_as_cns_symbol = { "P1": "P1", "P-1": "P-1", "P121": "P2", "P1211": "P2(1)", "C121": "C2", "P1m1": "PM", "P1c1": "PC", "C1m1": "CM", "C1c1": "CC", "P12/m1": "P2/M", "P121/m1": "P2(1)/M", "C12/m1": "C2/M"...
16,522
test old ignite metric
# Copyright (c) MONAI Consortium # 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, so...
16,523
chunk list
import asyncio import datetime import gzip import hashlib import os import secrets import tempfile from pathlib import Path from random import choice from string import ascii_letters, ascii_lowercase, digits from typing import Any, Iterable, Optional, Tuple, Dict, Type import arrow from aiohttp import ClientSession fr...
16,524
std
#! /usr/bin/env python # # some fun with spherical nbody models - 30-aug-2018 Peter Teuben # # old default: # plummer_stats.csh tmp=exp1 nexp=100 mlo=1 mhi=1 # takes 90" on NEMO2/3, of which ~10" in mkplummer loop # # new default: # cluster_stats.py out='"Exp1"' nexp=100 mlo=1 mhi=1 # takes about 3",...
16,525
get sonarr rootfolder
# coding=utf-8 import os import requests import logging from app.config import settings from app.database import TableShowsRootfolder, TableShows from utilities.path_mappings import path_mappings from sonarr.info import get_sonarr_info, url_sonarr from constants import headers def METHOD_NAME(): apikey_sonarr =...
16,526
try call complex method
""" Overloads for ClassInstanceType for built-in functions that call dunder methods on an object. """ from functools import wraps import inspect import operator from numba.core.extending import overload from numba.core.types import ClassInstanceType def _get_args(n_args): assert n_args in (1, 2) return list(...
16,527
test dict items trailing comma
# 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, s...
16,528
service clicked
""" core node services """ import logging import tkinter as tk from tkinter import messagebox, ttk from typing import TYPE_CHECKING, Optional from core.api.grpc.wrappers import Node from core.gui.dialogs.configserviceconfig import ConfigServiceConfigDialog from core.gui.dialogs.dialog import Dialog from core.gui.theme...
16,529
test query
#!/usr/bin/env python # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Tests for pyvo.dal.sia """ from functools import partial import re import requests_mock import pytest from pyvo.dal.sia2 import search, SIA2Service, SIA2Query, SIAService, SIAQuery import astropy.units as u from astropy.coordin...
16,530
center camera to player
""" Platformer Game python -m arcade.examples.platform_tutorial.07_coins_and_sound """ from __future__ import annotations import arcade # Constants SCREEN_WIDTH = 1000 SCREEN_HEIGHT = 650 SCREEN_TITLE = "Platformer" # Constants used to scale our sprites from their original size CHARACTER_SCALING = 1 TILE_SCALING = ...
16,531
test validate classification prediction fail
import warnings import numpy as np import pandas as pd import pytest from sklearn.dummy import DummyClassifier from giskard.core.core import SupportedColumnTypes, SupportedModelTypes from giskard.core.dataset_validation import validate_column_categorization, validate_column_types from giskard.core.model_validation im...
16,532
make absolute
# Copyright 2022 Google Inc. 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 applicable law or a...
16,533
test ana grav forward
import unittest import pytest import discretize from SimPEG import maps from SimPEG.potential_fields import gravity from geoana.gravity import Prism import numpy as np import os def METHOD_NAME(tmp_path): nx = 5 ny = 5 # Define a mesh cs = 0.2 hxind = [(cs, 41)] hyind = [(cs, 41)] hzind =...
16,534
message filter
# -*- coding: utf-8 -*- # # RERO ILS # Copyright (C) 2019-2022 RERO # # 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, version 3 of the License. # # This program is distributed in the hope...
16,535
name
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
16,536
test apply auto limit error query
import unittest from redash.query_runner import BaseQueryRunner, BaseSQLQueryRunner from redash.utils import gen_query_hash class TestBaseSQLQueryRunner(unittest.TestCase): def setUp(self): self.query_runner = BaseSQLQueryRunner({}) def test_check_query_limit_no_limit(self): query = "SELECT ...
16,537
pid
import enum from _typeshed import Incomplete from collections.abc import Iterable from typing import Any, NamedTuple from psutil._common import ( ENCODING as ENCODING, ENCODING_ERRS as ENCODING_ERRS, AccessDenied as AccessDenied, NoSuchProcess as NoSuchProcess, TimeoutExpired as TimeoutExpired, ...
16,538
initialise community by default
from typing import Optional from ipv8.bootstrapping.dispersy.bootstrapper import DispersyBootstrapper from ipv8.configuration import ConfigBuilder, DISPERSY_BOOTSTRAPPER from ipv8.dht.churn import PingChurn from ipv8.dht.discovery import DHTDiscoveryCommunity from ipv8.dht.routing import RoutingTable from ipv8.messagi...
16,539
make test hg
"""Utility functions for use in tests.""" import subprocess import textwrap from os import chdir, environ, mkdir from os.path import abspath from os.path import join as pjoin from shutil import copytree from tempfile import mkdtemp import structlog from django.contrib.auth.models import User from django_dynamic_fixtu...
16,540
set temporary datasets path
# # 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...
16,541
harmonic
from .ctx_base import StandardBaseContext import math import cmath from . import math2 from . import function_docs from .libmp import mpf_bernoulli, to_float, int_types from . import libmp class FPContext(StandardBaseContext): """ Context for fast low-precision arithmetic (53-bit precision, giving at most ...
16,542
has live build id
# Bob build tool # Copyright (C) 2020 Jan Klötzke # # SPDX-License-Identifier: GPL-3.0-or-later from ..errors import BuildError from ..stringparser import IfExpression from ..tty import stepAction, INFO, TRACE from ..utils import asHexStr, hashDirectory, emptyDirectory from .scm import Scm, ScmAudit import base64 imp...
16,543
iterate zip
# Copyright (c) 2015, Google Inc. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WA...
16,544
testfunc2
#============================================================================= # MusE # Linux Music Editor # $Id:$ # # Copyright (C) 1999-2011 by Werner Schweer and others # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License # as publishe...
16,545
file object
# Copyright 2008-2015 Jaap Karssenberg <jaap.karssenberg@gmail.com> '''The ExportLinker object translates links in zim pages to URLS for the export content ''' import logging logger = logging.getLogger('zim.exporter') #~ import base64 from .layouts import ExportLayout from zim.formats import BaseLinker from zi...
16,546
make findings uniform guidance
from django.test import TestCase from audit.models import SingleAuditChecklist from .errors import err_findings_count_inconsistent from .check_findings_count_consistency import check_findings_count_consistency from .sac_validation_shape import sac_validation_shape from .utils import generate_random_integer from model_b...
16,547
create a action card of group1 type
# -*- coding: utf-8 -*- # # Copyright 2015 Telefonica Investigación y Desarrollo, S.A.U # # This file is part of perseo-fe # # perseo-fe 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 ...
16,548
url parameters
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
16,549
ftobytes
# 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 # distributed u...
16,550
str to array
""" Handlers for IPythonDirective's @doctest pseudo-decorator. The Sphinx extension that provides support for embedded IPython code provides a pseudo-decorator @doctest, which treats the input/output block as a doctest, raising a RuntimeError during doc generation if the actual output (after running the input) does no...
16,551
alpha num order
# # Copyright 2019-2020 Johannes Hoermann (U. Freiburg) # # matscipy - Materials science with Python at the atomic-scale # https://github.com/libAtoms/matscipy # # 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 Softw...
16,552
test conv bias relu
import copy import math import random import unittest import torch import torch.nn.functional as F HAS_CONV_BIAS_RELU = None try: from apex.contrib.conv_bias_relu import ConvBiasReLU, ConvBias, ConvBiasMaskReLU, ConvFrozenScaleBiasReLU except ImportError as e: HAS_CONV_BIAS_RELU = False else: HAS_CONV_BIA...
16,553
data processing delete string for object
#------------------------------------------------------------------------------- # DataProcessing #------------------------------------------------------------------------------- class DataProcessingAbstractAPI: @staticmethod def init_data_processing_environment(object): pass @staticmethod def finish_data_proce...
16,554
record scope change
# -*- coding: utf-8 -*- import os from unittest.mock import patch from oauthlib import signals from oauthlib.oauth2 import MobileApplicationClient from tests.unittest import TestCase @patch('time.time', new=lambda: 1000) class MobileApplicationClientTest(TestCase): client_id = "someclientid" uri = "https:/...
16,555
get metadata
""" Playlist module for retrieving playlist data from Spotify. """ import logging from dataclasses import dataclass from typing import Any, Dict, List, Tuple from spotdl.types.song import Song, SongList from spotdl.utils.spotify import SpotifyClient __all__ = ["Playlist", "PlaylistError"] logger = logging.getLogger...
16,556
frange step
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
16,557
test get processing device with settings with
# SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ # SPDX-FileCopyrightText: 2021 Janek Groehl # SPDX-License-Identifier: MIT from simpa.log.file_logger import Logger from simpa.utils.tags import Tags from simpa.utils.settings import Settings from simpa.utils.processing_device import get_proc...
16,558
test should throw an error if user
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
16,559
do setup
# --- BEGIN COPYRIGHT BLOCK --- # Copyright (C) 2022 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). # See LICENSE for details. # --- END COPYRIGHT BLOCK --- # import io import sys import pytest from lib389.cli_conf.pwpolicy import (create_user_policy, create_subtree_policy, ...
16,560
test bandpass filter
import unittest import numpy as np import time from tests.QtTestCase import QtTestCase from urh.controller.widgets.SignalFrame import SignalFrame from urh.signalprocessing.Filter import Filter class TestFilter(QtTestCase): def setUp(self): super().setUp() self.add_signal_to_form("unaveraged.coc...
16,561
set all switches to
import logging import numpy as np import time import h5py from os import path from qcodes.instrument.base import Instrument from qcodes.instrument.visa import VisaInstrument from qcodes.utils import validators as vals from qcodes.instrument.parameter import ManualParameter class QuTech_Duplexer(VisaInstrument): '...
16,562
update
# Copyright 2018 DeepMind Technologies Limited. 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 ...
16,563
change track
"""A dummy backend for use in tests. This backend implements the backend API in the simplest way possible. It is used in tests of the frontends. """ import pykka from mopidy import backend from mopidy.models import Playlist, Ref, SearchResult def create_proxy(config=None, audio=None): return DummyBackend.sta...
16,564
main
# Copyright 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
16,565
test json
#!/usr/bin/env python3 # group: rw quick # # Test for additional information emitted by qemu-img info on qcow2 # images # # Copyright (C) 2013 Red Hat, 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...
16,566
quantize
# Copyright 2017,2018,2019,2020,2021 Sony Corporation. # Copyright 2021 Sony Group Corporation. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
16,567
polynomial
""" Collection of Model instances for use with the odrpack fitting package. """ import numpy as np from scipy.odr.odrpack import Model __all__ = ['Model', 'exponential', 'multilinear', 'unilinear', 'quadratic', 'polynomial'] def _lin_fcn(B, x): a, b = B[0], B[1:] b.shape = (b.shape[0], 1) ret...
16,568
get list keywords
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# CatUserBot #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# # Copyright (C) 2020-2023 by TgCatUB@Github. # This file is part of: https://github.com/TgCatUB/catuserbot # and is released under the "GNU v3.0 License Agreement". # Please see: https://github.com/TgCatUB/catuserbot/blob/...
16,569
load from file
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
16,570
test popen
"""Tests for window_utils""" import sys import unittest import warnings if sys.platform != 'win32': raise unittest.SkipTest('Windows only') import _overlapped import _winapi import asyncio from asyncio import windows_utils from test import support def tearDownModule(): asyncio.set_event_loop_policy(None) ...
16,571
test nested loop
# 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...
16,572
static parse builder
# # 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...
16,573
record results
#!/usr/bin/env python # This file is part of the pyMOR project (https://www.pymor.org). # Copyright pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause) import numpy as np from typer import Argument, run from pymor.basic import * def...
16,574
get deployment at scope output
# 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...
16,575
save visualizations
# Copyright (c) 2021, Matthew Booker # # 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 w...
16,576
test compress no file
import os from unittest import mock from django.conf import settings from django.core.files import File from django.core.files.images import ImageFile from django.test import override_settings import kitsune.upload.tasks from kitsune.questions.tests import QuestionFactory from kitsune.sumo.tests import TestCase from ...
16,577
call method
# 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...
16,578
is image
# Copyright (C) 2021-2022 Intel Corporation # # SPDX-License-Identifier: MIT import os import re import hashlib import mimetypes import cv2 as cv from av import VideoFrame from enum import Enum from natsort import os_sorted from random import shuffle def rotate_image(image, angle): height, width = image.shape[:2]...
16,579
test shell plus print sql truncate
# -*- coding: utf-8 -*- import os import re import pytest import inspect from textwrap import dedent from django.core.management import call_command from django.db.models import Model from django.test import override_settings from django_extensions.management.commands import shell_plus def test_shell_plus_command(c...
16,580
get update background to launch
#!/usr/bin/env python3 # -*-coding:UTF-8 -* import datetime import os import sys sys.path.append(os.environ['AIL_BIN']) ################################## # Import Project packages ################################## from lib.ConfigLoader import ConfigLoader config_loader = ConfigLoader() r_db = config_loader.get_db_...
16,581
test add translation raises type error
# Copyright 2023 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
16,582
create peer request
import asyncio import concurrent import hashlib import struct import base58 from configured_logger import logger from messages import schema from messages.crypto import PublicKey, Signature from messages.network import (EdgeInfo, GenesisId, Handshake, PeerChainInfoV2, PeerMessage, Routed...
16,583
get resource link id
""" LTI consumer plugin models """ from urllib.parse import unquote from django.conf import settings from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from django.utils import translation from django.utils.functional import lazy from django.utils.translation import ge...
16,584
test classifier type check fail
# MIT License # # Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2020 # # 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 # r...
16,585
test trigger v2
from zerver.lib.test_classes import WebhookTestCase class PagerDutyHookTests(WebhookTestCase): STREAM_NAME = "pagerduty" URL_TEMPLATE = "/api/v1/external/pagerduty?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "pagerduty" def test_trigger(self) -> None: expected_message = "Incident [3...
16,586
connect
import logging import os import time import warnings from pathlib import Path from logging.handlers import BaseRotatingHandler import zmq from openpilot.common.logging_extra import SwagLogger, SwagFormatter, SwagLogFileFormatter from openpilot.system.hardware import PC if PC: SWAGLOG_DIR = os.path.join(str(Path.ho...
16,587
validate scopes
""" Classes that override default django-oauth-toolkit behavior """ from datetime import datetime, timedelta from django.contrib.auth import authenticate, get_user_model from django.db.models.signals import pre_save from django.dispatch import receiver from oauth2_provider.models import AccessToken from oauth2_provi...
16,588
upbc
"""Macros that implement bootstrapping for the upb code generator.""" load( "//bazel:upb_proto_library.bzl", "upb_proto_library", ) load( "//cmake:build_defs.bzl", "staleness_test", ) _stages = ["_stage0", "_stage1", ""] _protoc = "@com_google_protobuf//:protoc" _upbc_base = "//upbc:protoc-gen-upb" #...
16,589
calltypes
from collections import namedtuple from numba.core import types, ir from numba.core.typing import signature _CallableNode = namedtuple("BoundFunc", ["func", "sig"]) class ParforLoweringBuilder: """Helper class for building Numba-IR and lowering for Parfor. """ def __init__(self, lowerer, scope, loc): ...
16,590
test frames
# SPDX-License-Identifier: LGPL-3.0-or-other # Copyright (C) 2021 Contributors to the SLS Detector Package import pytest import subprocess import os import sys import time import datetime as dt sys.path.append(os.path.join(os.getcwd(), "bin")) from sls_detector import ExperimentalDetector, detectorSettings n_detector...
16,591
test message type assign by value
import copy import unittest from tests.utils_testing import get_path_for_data_file from urh import settings from urh.awre import AutoAssigner from urh.signalprocessing.Encoding import Encoding from urh.signalprocessing.Message import Message from urh.signalprocessing.MessageType import MessageType from urh.signalproce...
16,592
yield predictions
import sys, os import keras import numpy as np from skimage.io import imsave from .dataGenerator import getDataGenerator, BATCH_SIZE from .augmentators import generateReverseNormalizationFunction class DeepLearningModel(): def __init__(self, boxSize, saveModelFname, gpuList, batchSize, generatorLoss, trainingDataM...
16,593
loop start
# Copyright 2012 Martijn Pieters <mj@zopatista.com> # Copyright 2014 Eric Le Lay elelay.fr:dev # # 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 op...
16,594
assert same userreports
from functools import cached_property from sentry.models import Environment, UserReport from sentry.testutils.cases import APITestCase, SnubaTestCase from sentry.testutils.helpers.datetime import before_now, iso_format from sentry.testutils.silo import region_silo_test @region_silo_test(stable=True) class GroupUserR...
16,595
setup network
#!/usr/bin/env python3 # Copyright (c) 2014-2022 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the wallet accounts properly when there is a double-spend conflict.""" from decimal import Decimal...
16,596
exit worker
import time from typing import List, Dict import json import os import time import shutil import atexit import torch import torch.distributed as dist import json import matplotlib.pyplot as plt import matplotlib.colors as mcolors cmap = list(mcolors.TABLEAU_COLORS.values()) LOG_FOLDER = "record.log" MAX_WAIT_TIME =...
16,597
get ssh public key secret name
import os from typing import Dict from mage_ai.api.resources.GenericResource import GenericResource from mage_ai.data_preparation.preferences import get_preferences from mage_ai.data_preparation.shared.secrets import create_secret from mage_ai.data_preparation.sync import ( GIT_ACCESS_TOKEN_SECRET_NAME, GIT_SS...
16,598
get stats db
import chdb import config import chstrings import flask import contextlib from datetime import datetime from dataclasses import dataclass import functools def get_db(lang_code): localized_dbs = getattr(flask.g, '_localized_dbs', {}) db = localized_dbs.get(lang_code, None) if db is None: db = loca...
16,599
tear down
import os import json from django.urls import reverse from seaserv import seafile_api from seahub.test_utils import BaseTestCase class RepoCommitRevertTest(BaseTestCase): def setUp(self): self.user_name = self.user.username self.admin_name = self.admin.username self.repo_id = self.repo...