id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
12,600
metadata server enabled
from ScoutSuite.providers.base.resources.base import Resources from ScoutSuite.providers.gcp.facade.base import GCPFacade from ScoutSuite.providers.gcp.resources.gke.node_pools import NodePools from ScoutSuite.providers.utils import get_non_provider_id class Clusters(Resources): def __init__(self, facade: GCPFaca...
12,601
get attrs
# Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file. from . import win32 # from wincon.h class WinColor(object): BLACK = 0 BLUE = 1 GREEN = 2 CYAN = 3 RED = 4 MAGENTA = 5 YELLOW = 6 GREY = 7 # from wincon.h class WinStyle(object): NORMAL ...
12,602
threw
# Copyright The Caikit 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 writing...
12,603
decode
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved. # Copyright 2023 The Fairseq Authors, Microsoft Research, and the HuggingFace Inc. 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 o...
12,604
set level
import logging import os class Logging: """Class to handle modules logging. It is a wrapper class from logging standard python module. Args: logger_name (str): Logger name level (str): Logger level: DEBUG, INFO, WARNING, ERROR or CRITICAL stdout (boolean): True for add stodut stream h...
12,605
mock get stations
""" Unit testing for WFWX API code """ import asyncio from unittest.mock import patch, AsyncMock import pytest from fastapi import HTTPException from pytest_mock import MockFixture from app.wildfire_one.query_builders import (BuildQueryAllForecastsByAfterStart, BuildQueryAl...
12,606
test arrow types integers
# # Copyright (c) 2016-2022 Deephaven Data Labs and Patent Pending # import os import unittest from datetime import datetime from typing import List, Any import numpy as np import pandas as pd import pyarrow as pa import pyarrow.feather as feather import pyarrow.parquet as papq from deephaven import arrow as dharrow,...
12,607
is collinear
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function import itertools import scitbx.matrix from rstbx.dps_core.cell_assessment import unit_cell_too_small from rstbx.indexing_api import cpp_absence_test def METHOD_NAME(x,y): # X x Y cross product is zero return x[0]*y[1]-x[1]*y[...
12,608
fk field
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence from typing import Any from django import forms from django.contrib.admin.options import ModelAdmin from django.db.models import Model from django.db.models.fields import AutoField from django.forms import BaseForm from django.forms.boundfield...
12,609
on draw
# # Part of p5: A Python package based on Processing # Copyright (C) 2017-2019 Abhik Pal # # 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) ...
12,610
contains oom info
import asyncio import os import argparse from subprocess import PIPE, STDOUT import glob import sys import time import socket from contextlib import closing import uuid def gen_cmds(cmd=None, dir=None, doctest=False): if doctest: paths = glob.glob(os.path.join(dir, "**/*.py"), recursive=True) path...
12,611
is nice sentence
#!/usr/bin/python2 # -*- coding: utf-8; mode: Python; indent-tabs-mode: t; tab-width: 4; python-indent: 4 -*- # Copyright (C) 2012, 2014, 2015 Olga Yakovleva <yakovleva.o.v@gmail.com> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publ...
12,612
build storage options
from botocore.config import Config from mage_integrations.destinations.delta_lake.base import DeltaLake as BaseDeltaLake, main from mage_integrations.destinations.delta_lake.constants import MODE_OVERWRITE from mage_integrations.destinations.delta_lake_s3.utils import fix_overwritten_partitions from typing import Dict ...
12,613
test flightplan
from typing import List, cast from traffic.core.flightplan import ( Airway, CoordinatePoint, Direct, FlightPlan, Point, SpeedLevel, _ElementaryBlock, ) from traffic.data.basic.airways import Airways import pandas as pd class ExtraData(Airways): name = "extra_for_test" available =...
12,614
execute chunk
# There should be a readme.md file bundled with this script. Please refer to it if you have any questions. import math import psycopg2 import time from multiprocessing import Pool from os import environ from threading import Lock # DEFINE THIS ENVIRONMENT VARIABLE BEFORE RUNNING! # Obvs, this is the connection stri...
12,615
rbeta
# -*- coding: utf-8 -*- # Copyright (C) 2011-2012 Quang-Cuong Pham <cuong.pham@normalesup.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....
12,616
collection medias v1 chunk
from typing import List, Tuple from instagrapi.exceptions import CollectionNotFound from instagrapi.extractors import extract_collection, extract_media_v1 from instagrapi.types import Collection, Media class CollectionMixin: """ Helpers for collection """ def collections(self) -> List[Collection]: ...
12,617
parse time
import time from datetime import timedelta from typing import TYPE_CHECKING from module.base.button import Button from module.base.decorator import cached_property from module.base.utils import * from module.logger import logger from module.ocr.rpc import ModelProxyFactory from module.webui.setting import State if TY...
12,618
net share add
from _typeshed import Incomplete from win32.lib.pywintypes import error as error def NetGetJoinInformation() -> tuple[str, Incomplete]: ... def NetGroupGetInfo(server: str, groupname: str, level): ... def NetGroupGetUsers( server: str, groupName: str, level, resumeHandle: int = ..., prefLen: int = ... ) -> tuple[...
12,619
clear external paths
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) # Standard library imports import os.path as osp # Third party imports from qtpy.compat import getexistingdirectory from qtpy.QtCore import QEvent, Qt, Signal, Slot ...
12,620
from hdf
# coding: utf-8 # Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department # Distributed under the terms of "New BSD License", see the LICENSE file. from pyiron_atomistics.gpaw.pyiron_ase import AseJob from pyiron_atomistics.dft.job.generic import GenericDFTJob from py...
12,621
test multinode distrib cpu
import os import pytest import torch import ignite.distributed as idist from ignite.exceptions import NotComputableError from ignite.metrics.gan.inception_score import InceptionScore def calculate_inception_score(p_yx): p_y = torch.unsqueeze(p_yx.mean(axis=0), 0) kl_d = torch.kl_div(torch.log(p_y), p_yx) ...
12,622
test get anon
# Copyright 2020 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, s...
12,623
do fixup
# --- BEGIN COPYRIGHT BLOCK --- # Copyright (C) 2023 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). # See LICENSE for details. # --- END COPYRIGHT BLOCK --- from lib389.plugins import POSIXWinsyncPlugin from lib389.cli_conf import add_generic_plugin_parsers, generic_object_edit...
12,624
test prevent list blocks
""" Module with tests for Strings """ # ----------------------------------------------------------------------------- # Copyright (c) 2013, the IPython Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # -----...
12,625
test convert qasm recursive gate def
# Copyright (C) 2023 qBraid # # This file is part of the qBraid-SDK # # The qBraid-SDK is free software released under the GNU General Public License v3 # or later. You can redistribute and/or modify it under the terms of the GPL v3. # See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.ht...
12,626
get stats
import numpy as np class Mass: def __init__(self, model): """ Defines the ShellProperties object. Parameters ---------- model : BDF the BDF object """ self.model = model self.n = 0 self.conm1 = model.conm1 self.conm2 = mode...
12,627
test n dimensional xy z to hunt
# !/usr/bin/env python """Define the unit tests for the :mod:`colour.appearance.hunt` module.""" import contextlib import numpy as np import unittest from itertools import product from colour.appearance import ( VIEWING_CONDITIONS_HUNT, InductionFactors_Hunt, XYZ_to_Hunt, ) from colour.utilities import ( ...
12,628
a staticmethod
"""Something just to look at via pydoc.""" import types class A_classic: "A classic class." def A_method(self): "Method defined in A." def AB_method(self): "Method defined in A and B." def AC_method(self): "Method defined in A and C." def AD_method(self): "Method de...
12,629
test use scope
from collections.abc import MutableMapping import pytest import reactpy from reactpy import html from reactpy.backend import default as default_implementation from reactpy.backend._common import PATH_PREFIX from reactpy.backend.types import BackendType, Connection, Location from reactpy.backend.utils import all_imple...
12,630
list
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may ...
12,631
fortunes
import multiprocessing import os import pathlib from operator import itemgetter from random import randint, sample from typing import Annotated, AsyncIterable, Optional import asyncpg # type: ignore import jinja2 # type: ignore import uvicorn # type: ignore from pydantic import BaseModel, Field from starlette.respo...
12,632
get last result
# # Copyright (c) 2014-2015 Harvard, edX & OpenCraft # # This software's license gives you freedom; you can copy, convey, # propagate, redistribute and/or modify this program under the terms of # the GNU Affero General Public License (AGPL) as published by the Free # Software Foundation (FSF), either version 3 of the L...
12,633
c enum const
# # QAPI helper library # # Copyright IBM, Corp. 2011 # Copyright (c) 2013-2018 Red Hat Inc. # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # Markus Armbruster <armbru@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. # See the COPYING file in the top-level directory. import re f...
12,634
id
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
12,635
zip dir
import json import os import os.path as osp import shutil import zipfile import strax from .files import RUN_METADATA_PATTERN export, __all__ = strax.exporter() @export class ZipDirectory(strax.StorageFrontend): """ZipFile-based storage frontend for strax. All data for one run is assumed to be in a single ...
12,636
get device for
import sys import contextlib from functools import lru_cache import torch from modules import errors, shared if sys.platform == "darwin": from modules import mac_specific def has_mps() -> bool: if sys.platform != "darwin": return False else: return mac_specific.has_mps def get_cuda_dev...
12,637
get imported names
# Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com # # Part of "Nuitka", an optimizing Python compiler that is compatible and # integrates with CPython, but also works on its own. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in complianc...
12,638
select document
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # 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 ...
12,639
main
"""Export a YOLOv5 *.pt model to TorchScript, ONNX, CoreML formats Usage: $ python path/to/export.py --weights yolov5s.pt --img 640 --batch 1 """ import argparse import sys import time from pathlib import Path import torch import torch.nn as nn from torch.utils.mobile_optimizer import optimize_for_mobile FILE =...
12,640
toggle recording
#!/usr/bin/python3 # -*- coding: utf-8 -*- #****************************************************************************** # ZYNTHIAN PROJECT: Zynthian Core # # Zynthian Audio Recorder Class # # Copyright (C) 2015-2022 Fernando Moyano <jofemodo@zynthian.org> # Brian Walton <riban@zynthian.org>...
12,641
popup context menu from list
# A part of NonVisual Desktop Access (NVDA) # Copyright (C) 2022-2023 NV Access Limited # This file is covered by the GNU General Public License. # See the file COPYING for more details. from typing import ( Optional, ) import wx from gui import ( guiHelper, nvdaControls, ) from gui.dpiScalingHelper import DpiSca...
12,642
test split a two language post
import os import pytest from nikola.plugins.command.import_wordpress import ( modernize_qtranslate_tags, separate_qtranslate_tagged_langs, ) def legacy_qtranslate_separate(text): """This method helps keeping the legacy tests covering various corner cases, but plugged on the newer methods.""" tex...
12,643
setup module
"""Tests for the implementation of SYS_KaratsubaPrepare_54""" import os.path import pathlib from importlib import reload from types import SimpleNamespace from hypothesis import given from hypothesis import strategies as st import asm from gtemu import RAM, Emulator MAX_CYCLES = 54 SYS_DIR = (pathlib.Path(__file__...
12,644
status
# Copyright 2009-2012 Jaap Karssenberg <jaap.karssenberg@gmail.com> # Copyright 2010,2011 John Drinkwater <john@nextraweb.com> # Copyright 2012 Damien Accorsi <damien.accorsi@free.fr> import os import logging from zim.plugins.versioncontrol import VCSApplicationBase from zim.applications import Application logge...
12,645
test invalid endpoint
# (C) Datadog, Inc. 2022-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import logging import os import mock import pytest from requests import HTTPError from datadog_checks.arangodb import ArangodbCheck from datadog_checks.dev.http import MockResponse from datadog_checks.de...
12,646
broadcast to
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # 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...
12,647
set up
"""policy engine tests""" from django.core.cache import cache from django.test import TestCase from authentik.core.tests.utils import create_test_admin_user from authentik.lib.generators import generate_id from authentik.policies.dummy.models import DummyPolicy from authentik.policies.engine import PolicyEngine from a...
12,648
exit
import tornado from tornado.ioloop import IOLoop from ...provider import BaseContextProvider from ...provider import DefaultContextProvider from ...span import Span # tornado.stack_context deprecated in Tornado 5 removed in Tornado 6 # instead use DefaultContextProvider with ContextVarContextManager for asyncio _USE...
12,649
find terminal
import os import shutil from pathlib import Path from typing import Optional import yaml from core.gui import themes HOME_PATH: Path = Path.home().joinpath(".coregui") BACKGROUNDS_PATH: Path = HOME_PATH.joinpath("backgrounds") CUSTOM_EMANE_PATH: Path = HOME_PATH.joinpath("custom_emane") CUSTOM_SERVICE_PATH: Path = H...
12,650
gen token
# -*- coding: utf-8 -*- """ emmett.security --------------- Miscellaneous security helpers. :copyright: 2014 Giovanni Barillari Based on the code of web2py (http://www.web2py.com) :copyright: (c) by Massimo Di Pierro <mdipierro@cs.depaul.edu> :license: LGPLv3 (http://www.gnu.org/licenses...
12,651
vertex executable suffix
# Copyright (c) 2017 The University of Manchester # # 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 ...
12,652
endpoint visualization
import base64 import uuid from io import BytesIO from pathlib import Path from typing import TYPE_CHECKING, Any, Callable, Dict, Optional from flash.core.serve.dag.task import get from flash.core.serve.dag.visualize import visualize from flash.core.serve.execution import ( ComponentJSON, MergedJSON, TaskCo...
12,653
list by data box edge device
# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRe...
12,654
post operations
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
12,655
lstat
from collections.abc import Callable, Sequence from contextlib import AbstractContextManager from stat import S_IMODE as S_IMODE from types import TracebackType from typing import IO from typing_extensions import Literal, Self, TypeAlias import paramiko from paramiko import AuthenticationException as AuthenticationExc...
12,656
create dataset if needed
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
12,657
get solver
# (C) Copyright 2004-2023 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only under # the conditions described in the aforementioned license. The license # is also available online at...
12,658
get anion dopants
from typing import List, Tuple from pymatgen.util import plotting import smact from smact.structure_prediction import mutation, utilities class Doper: """ A class to search for n & p type dopants Methods: get_dopants, plot_dopants Attributes: original_species: A tuple which describes the co...
12,659
get next
# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRe...
12,660
list hpc cache skus
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
12,661
get test params
"""Multi Layer Perceptron Network (MLP) for classification.""" __author__ = ["James-Large", "AurumnPegasus"] __all__ = ["MLPClassifier"] from copy import deepcopy from sklearn.utils import check_random_state from sktime.classification.deep_learning.base import BaseDeepClassifier from sktime.networks.mlp import MLPN...
12,662
wait
__all__ = 'create_subprocess_exec', 'create_subprocess_shell' import subprocess from . import events from . import protocols from . import streams from . import tasks from .log import logger PIPE = subprocess.PIPE STDOUT = subprocess.STDOUT DEVNULL = subprocess.DEVNULL class SubprocessStreamProtocol(streams.FlowC...
12,663
get stale trial ids
import abc import copy from threading import Event from threading import Thread from types import TracebackType from typing import Callable from typing import List from typing import Optional from typing import Type import optuna from optuna._experimental import experimental_func from optuna.storages import BaseStorag...
12,664
test check metrics 1 13
# (C) Datadog, Inc. 2019-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import os import mock import pytest from datadog_checks.base.checks.kube_leader import ElectionRecordAnnotation from datadog_checks.kube_scheduler import KubeSchedulerCheck instance = {'prometheus_url'...
12,665
test build stack no resources
import os from unittest import TestCase from unittest.mock import patch, Mock from samcli.commands.validate.lib.exceptions import InvalidSamDocumentException from samcli.lib.iac.cfn.cfn_iac import CfnIacImplementation from samcli.lib.iac.plugins_interfaces import ( SamCliContext, SamCliProject, Stack, ...
12,666
test main
""" This test tests that i18n extraction (`paver i18n_extract -v`) works properly. """ import os import random import re import string import subprocess import sys from datetime import datetime, timedelta from unittest import TestCase from i18n import config, dummy, extract, generate from polib import pofile from py...
12,667
prepare
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
12,668
auth
import sys from _socket import _Address as _SourceAddress from _typeshed import ReadableBuffer, SizedBuffer from collections.abc import Sequence from email.message import Message as _Message from re import Pattern from socket import socket from ssl import SSLContext from types import TracebackType from typing import An...
12,669
test convert time units
from datetime import datetime, timedelta from itertools import chain import numpy as np import pandas as pd import pytest from featuretools.utils import convert_time_units, make_temporal_cutoffs from featuretools.utils.time_utils import ( calculate_trend, convert_datetime_to_floats, convert_timedelta_to_f...
12,670
get entry points
''' Parser objects for the Intel Hex file format. ''' import binascii import envi.const as e_const import vstruct from vstruct.primitives import * IHEX_REC_DATA = 0 IHEX_REC_EOF = 1 IHEX_REC_EXSEG = 2 # Extended Segment Address Records IHEX_REC_STARTSEG = 3 # The beginning code se...
12,671
get next
# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRe...
12,672
rotation
# Copyright 2021 The NetKet 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 applicable ...
12,673
daq waveforms
#!/usr/bin/env python """ Basic DAQ module functionality. Hazen 04/17 """ import numpy from PyQt5 import QtCore import storm_control.hal4000.halLib.halMessage as halMessage import storm_control.sc_hardware.baseClasses.hardwareModule as hardwareModule import storm_control.sc_library.halExceptions as halExceptions ...
12,674
test non help flag
#!/usr/bin/env python # # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list...
12,675
get providers
# Copyright (c) 2001-2022, Hove and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Hove (www.hove.com). # Help us simplify mobility and open public transport: #...
12,676
unary op
import itertools import numpy as np import scipy.special import torch from . import benchmark # A template class for elementwise operations. # A derived class will override the class instance to customize its behavior. class ElementBench(benchmark.Benchmark): # List of customization class variables. op_str ...
12,677
get context data
import django_filters from django.urls import reverse from django.utils.translation import gettext_lazy as _ from adhocracy4.categories import filters as category_filters from adhocracy4.exports.views import DashboardExportView from adhocracy4.filters import filters as a4_filters from adhocracy4.filters.widgets import...
12,678
on train begin
import math from pathlib import Path from peft import PeftModel import torch from transformers import ( TrainingArguments, TrainerCallback, TrainerControl, TrainerState, ) from transformers.trainer_utils import PREFIX_CHECKPOINT_DIR class SavePeftModelCallback(TrainerCallback): def on_save( ...
12,679
info
#!/usr/bin/env python # Line too long - pylint: disable=C0301 # Invalid name - pylint: disable=C0103 """ gp_era.py, based on gp_dbid.py Copyright (c) EMC/Greenplum Inc 2011. All Rights Reserved. """ import sys, os, stat, re import hashlib ERA_RE = re.compile(r"era\s*=\s*(\w+)") def METHOD_NAME(msg): self ...
12,680
webhook listener
import asyncio from typing import AsyncGenerator, Optional import httpx from loguru import logger from lnbits.settings import settings from .base import ( InvoiceResponse, PaymentResponse, PaymentStatus, StatusResponse, Unsupported, Wallet, ) class OpenNodeWallet(Wallet): """https://dev...
12,681
undeploy process
# # Author : Blasco Brauzzi, Fabrice Brito, Frank Löschau # # Copyright 2023 Terradue. All rights reserved. # # 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 wi...
12,682
exit
#! /usr/bin/env python """Tkinter-based GUI for websucker. Easy use: type or paste source URL and destination directory in their respective text boxes, click GO or hit return, and presto. """ from Tkinter import * import websucker import os import threading import Queue import time VERBOSE = 2 try: class Canc...
12,683
test get all file names delete files
import io import re from copy import copy import pytest from tests.monkey_island import InMemoryFileRepository, SingleFileRepository from monkey_island.cc import repositories from monkey_island.cc.repositories import FileRepositoryCachingDecorator @pytest.fixture def file_repository(): return FileRepositoryCach...
12,684
update metric collection
import logging from typing import List, Optional from localstack import config from localstack.aws.api import RequestContext from localstack.aws.chain import HandlerChain from localstack.http import Response from localstack.utils.aws.aws_stack import is_internal_call_context LOG = logging.getLogger(__name__) class ...
12,685
notify logged error
# Author: Marvin Pinto <me@marvinp.ca> # Author: Dennis Lutter <lad1337@gmail.com> import time import requests from sickchill import logger, settings from sickchill.oldbeard.classes import UIError from sickchill.oldbeard.common import ( NOTIFY_DOWNLOAD, NOTIFY_LOGIN, NOTIFY_LOGIN_TEXT, NOTIFY_SNATCH, ...
12,686
create autonomous system
from __future__ import annotations from seedemu.core import AutonomousSystem, InternetExchange, AddressAssignmentConstraint, Node, Graphable, Emulator, Layer from typing import Dict, List BaseFileTemplates: Dict[str, str] = {} BaseFileTemplates["interface_setup_script"] = """\ #!/bin/bash cidr_to_net() { ipcalc -...
12,687
test raise for status contains error message
import json import sqlite3 import ssl from contextlib import asynccontextmanager from typing import AsyncContextManager, AsyncIterator, Callable import aiohttp import certifi import pytest from aiohttp import web from yarl import URL from neuro_sdk import IllegalArgumentError, ServerNotAvailable from neuro_sdk._core ...
12,688
test local file is not accessilble
# Copyright 2017 The Forseti Security 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 ap...
12,689
test pooch missing
# encoding: utf-8 # ------------------------------------------------------------------------ # Copyright 2022 All Histolab Contributors # # 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 # # ...
12,690
validate resource extension
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
12,691
test step and cost autograd nesterov multiple
# Copyright 2018-2021 Xanadu Quantum Technologies 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...
12,692
set up class
# 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...
12,693
decrypt cookie
import json from urllib.parse import urlencode from urllib.request import urlopen from oauthlib.oauth2 import BackendApplicationClient from requests_oauthlib import OAuth2Session from django.conf import settings from .strategy_2 import Strategy2 def METHOD_NAME(cookie): strategy = Strategy2( signature_pu...
12,694
test short fourth line
# This file is part of Checkbox. # # Copyright 2015 Canonical Ltd. # # Checkbox is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, # as published by the Free Software Foundation. # # Checkbox is distributed in the hope that it will be useful, # but ...
12,695
output
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
12,696
callback
import time import unittest import os import tempfile import numpy as np from urh.util import util util.set_shared_library_path() from urh.dev.native.lib import hackrf from urh.dev.native.HackRF import HackRF class TestHackRF(unittest.TestCase): def callback_fun(self, buffer): print(buffer) fo...
12,697
compute labels
# (C) Copyright 2005-2021 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only under # the conditions described in the aforementioned license. The license # is also available online at...
12,698
test tracer dispatch
# # This source file is part of the EdgeDB open source project. # # Copyright 2019-present MagicStack Inc. and the EdgeDB 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...
12,699
get api policy 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 __all__ =...