id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
19,800
get mem ranges
# Copyright (c) 2021 Arm Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
19,801
verify trace roundtrip
# 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...
19,802
applications
# 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 ...
19,803
build update subs data
#!/usr/bin/env python3 """ Copyright 2020 The Magma Authors. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASI...
19,804
test service fault
import logging import pytest from asyncua import Client from asyncua import ua from asyncua import Node _logger = logging.getLogger(__name__) pytestmark = pytest.mark.asyncio async def METHOD_NAME(server, admin_client): request = ua.ReadRequest() request.TypeId = ua.FourByteNodeId(999) # bad type! wit...
19,805
add sort1
import numpy as np from pyNastran.utils.numpy_utils import integer_types from pyNastran.op2.result_objects.op2_objects import ScalarObject from pyNastran.f06.f06_formatting import write_floats_13e, write_imag_floats_13e class AppliedLoadsVectorArray(ScalarObject): def __init__(self, data_code, is_sort1, isubcase,...
19,806
test validate series
""" module for testing the functions clean_address() and validate_address() """ import logging import numpy as np import pandas as pd import pytest from ...clean import clean_address, validate_address LOGGER = logging.getLogger(__name__) @pytest.fixture(scope="module") # type: ignore def df_addresses() -> pd.Data...
19,807
sample multiple translation async
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ """ FILE: sample_translate_multiple_inputs_async.py DESCRIPTION: This sample demonstrates how to begin translating with documents in multiple source containers to ...
19,808
configure loader modules
import pytest import salt.states.rvm as rvm from tests.support.mock import MagicMock, patch @pytest.fixture def METHOD_NAME(): return { rvm: { "__opts__": {"test": False}, "__salt__": { "cmd.has_exec": MagicMock(return_value=True), "config.option": ...
19,809
strictly left of
# Copyright (C) 2013-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from .base import ischema_names from ... import types as sqltypes __all__ = ('INT4RANGE', 'INT8RANGE'...
19,810
ifdel
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <phil@secdev.org> # This program is published under a GPLv2 license """ Routing and handling of network interfaces. """ from __future__ import absolute_import import scapy.consts from scapy....
19,811
check the response has not the key
# -*- coding: utf-8 -*- """ # Copyright 2015 Telefonica Investigacion y Desarrollo, S.A.U # # This file is part of Orion Context Broker. # # Orion Context Broker 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 Foun...
19,812
fetch children
from rest_framework.request import Request from rest_framework.response import Response from rest_framework.views import APIView from django.db.models.functions import Length from django.db.models import Q from usaspending_api.common.cache_decorator import cache_response from usaspending_api.common.validator.tinyshiel...
19,813
modula3 rule6
# Leo colorizer control file for modula3 mode. # This file is in the public domain. # Properties for modula3 mode. properties = { "commentEnd": "*)", "commentStart": "(*", } # Attributes dict for modula3_main ruleset. modula3_main_attributes_dict = { "default": "null", "digit_re": "", "escape": "\...
19,814
save arrays
# 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 ...
19,815
realdev
import os from stat import * import core.exceptions as ex from utilities.files import protected_mount, getmount from utilities.mounts.freebsd import Mounts from utilities.proc import qcall from . import BaseFs DRIVER_GROUP = "fs" DRIVER_BASENAME = "" def try_umount(self): cmd = ['umount', self.mount_point] ...
19,816
test keywords variable
import os import pytest from parso.utils import PythonVersionInfo from jedi.inference.gradual import typeshed from jedi.inference.value import TreeInstance, BoundMethod, FunctionValue, \ MethodValue, ClassValue from jedi.inference.names import StubName TYPESHED_PYTHON3 = os.path.join(typeshed.TYPESHED_PATH, 'std...
19,817
test delete layer
#! /usr/bin/env python3 # # BitBake Toaster Implementation # # SPDX-License-Identifier: GPL-2.0-only # # Copyright (C) 2013-2016 Intel Corporation # from django.urls import reverse from tests.browser.selenium_helpers import SeleniumTestCase from orm.models import Layer, Layer_Version, Project, LayerSource, Release fr...
19,818
train test step
# Copyright (c) OpenMMLab. All rights reserved. from unittest.mock import MagicMock import torch from mmaction.registry import MODELS from mmaction.structures import ActionDataSample from mmaction.testing import get_recognizer_cfg from mmaction.utils import register_all_modules def METHOD_NAME(cfg, input_shape): ...
19,819
is valid
# coding: utf-8 # /*########################################################################## # # Copyright (C) 2016-2018 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
19,820
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...
19,821
test signature help available
# Copyright (C) 2021 ycmd contributors # # This file is part of ycmd. # # ycmd is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # ycmd...
19,822
test
import sys from _typeshed import Incomplete, StrOrBytesPath from collections.abc import Iterable from tkinter import Button, Entry, Frame, Listbox, Misc, Scrollbar, StringVar, Toplevel, commondialog from typing import IO, ClassVar from typing_extensions import Literal if sys.version_info >= (3, 9): __all__ = [ ...
19,823
test timeout with config
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
19,824
deserialize
# 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...
19,825
is alive
import datetime import os import tempfile from wsgiref.util import FileWrapper from django.conf import settings from django.utils.translation import gettext as _ from couchexport.models import Format from dimagi.utils.django.email import send_HTML_email from soil import ( BlobDownload, CachedDownload, Dow...
19,826
delay export
# Copyright 2019 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import base64 import json import operator from dateutil.relativedelta import relativedelta from odoo import _, api, fields, models from odoo.exceptions import UserError from odoo.addons.web.controllers.export import CSVExp...
19,827
test calculate points
import base64 import hmac import struct from django.conf import settings from django.test import TestCase from django.utils import timezone from django.utils.encoding import force_bytes from judge.models import Profile from judge.models.tests.util import CommonDataMixin, create_contest, create_contest_participation ...
19,828
points2 d a
import numpy as np import pytest from backend import center_and_normalize_points from backend import compute_fundamental_matrix_np from backend import compute_sampson_distance from backend import triangulate_points_np from backend import triangulate_points_cv @pytest.fixture() def METHOD_NAME(): return np.array([...
19,829
parse
import argparse import collections import dataclasses import enum import os import re class _Part(enum.Enum): MAJOR = 0 MINOR = 1 PATCH = 2 @classmethod def choices(cls): return [part.name.lower() for part in cls] @dataclasses.dataclass(frozen=True) class _Version: major: int mi...
19,830
test column type
import unittest import six import test_engine import testutil from formula_prompt import ( values_type, column_type, referenced_tables, get_formula_prompt, convert_completion, ) from objtypes import RaisedException from records import Record as BaseRecord, RecordSet as BaseRecordSet class FakeTable(object): de...
19,831
iter lines
# Licensed under a 3-clause BSD style license - see PYFITS.rst import operator import warnings from astropy.utils import indent from astropy.utils.exceptions import AstropyUserWarning class VerifyError(Exception): """ Verify exception class. """ class VerifyWarning(AstropyUserWarning): """ Ver...
19,832
build debug options
import json import urllib.parse as urllib_parse class DebugOptions(object): __slots__ = [ 'just_my_code', 'redirect_output', 'show_return_value', 'break_system_exit_zero', 'django_debug', 'flask_debug', 'stop_on_entry', 'max_exception_stack_frames',...
19,833
test location extraction
from typing import Optional, Dict, Any from unittest import mock import pytest from django.test import TestCase from django.test import override_settings from mainapp.functions.document_parsing import ( extract_locations, extract_from_file, extract_persons, ) from mainapp.models import File, Person from m...
19,834
ptx cp async barrier
# 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...
19,835
test bad connection remote pin test
import pytest import jwt import os import time from api.authenticator import ( PatronData, ) from api.config import ( Configuration, temp_config, ) from api.firstbook2 import ( FirstBookAuthenticationAPI, MockFirstBookAuthenticationAPI, ) from api.circulation_exceptions import ( RemoteInitia...
19,836
stop all running tasks
import abc import logging import uuid from threading import RLock, Event from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED, FIRST_EXCEPTION from arctic._config import ARCTIC_ASYNC_NWORKERS from arctic.exceptions import AsyncArcticException ABC = abc.ABCMeta('ABC', (object,), {}) def _looping_t...
19,837
abort requested
""" Flowblade Movie Editor is a nonlinear video editor. Copyright 2012 Janne Liljeblad. This file is part of Flowblade Movie Editor <https://github.com/jliljebl/flowblade/>. Flowblade Movie Editor is free software: you can redistribute it and/or modify it under the terms of the GNU General Public ...
19,838
filter data mode
from abc import ABC, abstractmethod import pandas as pd import numpy as np import xarray import hashlib import warnings from ..plot import dashboard from ..utilities import list_standard_variables class ArgoDataFetcherProto(ABC): @abstractmethod def to_xarray(self, *args, **kwargs) -> xarray.Dataset: ...
19,839
test change email address api
import json import pytest from django.conf import settings from django.contrib.auth.tokens import default_token_generator from django.core import mail from django.urls import reverse from djoser import utils from djoser.email import PasswordResetEmail from rest_framework import status from rest_framework.test import A...
19,840
fuse motion
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
19,841
generate test cases
#!/usr/bin/env python # Copyright 2019 Google LLC # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import argparse import codecs import os import re import sys import yaml sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) ...
19,842
test user import e2e
# Copyright (c) Facebook, Inc. and its affiliates. import contextlib import io import os import sys import unittest from mmf.common.registry import registry from mmf.utils.configuration import get_mmf_env from mmf.utils.env import import_user_module, setup_imports from mmf.utils.general import get_mmf_root from mmf_c...
19,843
get location stack
import abc import contextlib import dataclasses import functools from typing import List, Mapping, Optional, Tuple import weakref from magma.backend.mlir.common import WithId, default_field, constant from magma.backend.mlir.print_opts import PrintOpts from magma.backend.mlir.printer_base import PrinterBase from magma....
19,844
print logical operator
# -*- coding: utf-8 -*- # # python_expression_printer.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 t...
19,845
predict different args
from __future__ import annotations import asyncio import os import typing as t from typing import TYPE_CHECKING import numpy as np import pandas as pd import pydantic from fastapi import FastAPI from PIL.Image import Image as PILImage from PIL.Image import fromarray from starlette.requests import Request import bent...
19,846
difference
""" frozen (immutable) data structures to support MultiIndexing These are used for: - .names (FrozenList) - .levels & .codes (FrozenNDArray) """ import warnings import numpy as np from pandas.util._decorators import deprecate_kwarg from pandas.core.dtypes.cast import coerce_indexer_dtype from pandas.core.base i...
19,847
super fmt
""" Gradient descent ================== An example demoing gradient descent by creating figures that trace the evolution of the optimizer. """ import numpy as np import matplotlib.pyplot as plt import scipy as sp import sys, os sys.path.append(os.path.abspath("helper")) from cost_functions import ( mk_quad, ...
19,848
policy
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os from fairseq import checkpoint_utils, tasks import sentencepiece as spm import torch try: from simuleval import READ_ACTION, W...
19,849
test can start processing
from unittest import TestCase from lamden.nodes.queue_base import ProcessingQueue import time import asyncio class TestProcessingQueue(TestCase): def setUp(self): self.processing_queue = ProcessingQueue() def tearDown(self): self.processing_queue.stop() self.processing_queue.flush() ...
19,850
on update
""" Move with a Sprite Animation Simple program to show basic sprite usage. Artwork from https://kenney.nl If Python and Arcade are installed, this example can be run from the command line with: python -m arcade.examples.sprite_move_animation """ from __future__ import annotations import arcade import random SCREE...
19,851
srdf
from __future__ import print_function import sys import core.exceptions as ex from utilities.lazy import lazy from env import Env from drivers.array.symmetrix import Arrays from core.pool import BasePool LOCK_NAME = "symmetrix_create_disk" class Pool(BasePool): type = "symmetrix" capabilities = ["roo", "rwo...
19,852
refresh product versions from db
import abc import logging from typing import Dict, List, Optional from gear import Database, transaction from .pricing import Price log = logging.getLogger('billing_manager') def product_version_to_resource(product: str, version: str) -> str: return f'{product}/{version}' class ProductVersions: def __ini...
19,853
setup
"""Machinery for documenting traitlets config options with Sphinx. This includes: - A Sphinx extension defining directives and roles for config options. - A function to generate an rst file given an Application instance. To make this documentation, first set this module as an extension in Sphinx's conf.py:: ext...
19,854
test solve batch complex
# 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...
19,855
create truck
import datetime from typing import List import pytest import sqlalchemy from asgi_lifespan import LifespanManager from fastapi import FastAPI from httpx import AsyncClient from tests.settings import DATABASE_URL from tests.test_inheritance_and_pydantic_generation.test_inheritance_concrete import ( # type: ignore ...
19,856
newmark critical accel
from typing import Union import numpy as np g: float = 9.81 def METHOD_NAME( factor_of_safety: Union[float, np.ndarray], slope: Union[float, np.ndarray] ) -> Union[float, np.ndarray]: """ Calculates the critical acceleration, i.e. the acceleration at which the slope fails. :param factor_of_safet...
19,857
is subnet address
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library 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 2.1 of the License, ...
19,858
get fake skill
""" This package contains fake data for testing LibreLingo-related packages. The fake data is returned using the types from [librelingo-types](https://pypi.org/project/librelingo-types/). ## Usage ```python from librelingo_fakes import fakes fakes.course1 # This is a Course() object fakes.course2 # This is anothe...
19,859
resize nearest
import numpy as np from numba import njit, prange @njit("void(f4[:, :, :], f4[:, :, :])", cache=True, nogil=True, parallel=True) def _resize_nearest_multichannel(dst, src): """ Internal method. Resize image src to dst using nearest neighbors filtering. Images must have multiple color channels, i.e. :...
19,860
test track changes twice
import tkinter import pytest from porcupine import get_main_window, utils from porcupine.textutils import Change, Changes, change_batch, create_peer_widget, track_changes @pytest.fixture(scope="function") def text_and_events(): text = tkinter.Text(get_main_window()) text.config(undo=True) # must be before ...
19,861
test dev start runs all services
import inspect import watchfiles from typer import Option import prefect from prefect.cli.dev import agent_process_entrypoint, start_agent from prefect.testing.cli import invoke_and_assert from prefect.testing.utilities import AsyncMock, MagicMock def METHOD_NAME(monkeypatch): """ Test that `prefect dev sta...
19,862
cf snapshots
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
19,863
test dataset 2 d aggregate partial hm
import logging from unittest import SkipTest import numpy as np try: import cudf except ImportError: raise SkipTest("Could not import cuDF, skipping cuDFInterface tests.") from holoviews.core.data import Dataset from holoviews.core.spaces import HoloMap from .base import HeterogeneousColumnTests, Interface...
19,864
test gas price config
#!/usr/bin/python3 import pytest from brownie import compile_source from brownie.exceptions import VirtualMachineError from brownie.network.transaction import TransactionReceipt code = """ pragma solidity ^0.6.0; contract Foo { fallback () external payable {} } """ def test_to_string(accounts): """Can send...
19,865
button app
from os import name import os.path from math import isclose from textwrap import dedent from kivy.app import App from kivy.clock import Clock from kivy import lang from kivy.tests import GraphicUnitTest, async_run, UnitKivyApp class AppTest(GraphicUnitTest): def test_start_raw_app(self): lang._delayed_st...
19,866
buttonbox
"""Contains the WidgetPropertiesDialog class.""" __all__ = ['WidgetPropertiesDialog'] import Pmw import tkinter as tk class WidgetPropertiesDialog(tk.Toplevel): """Class to open dialogs to adjust widget properties.""" def __init__(self, propertyDict, propertyList = None, parent = None, tit...
19,867
get requested version
"""HTTP API versioning logic, utilities, and dependencies.""" from fastapi import Header, Request, Response, status from typing import Union from typing_extensions import Literal, Final from robot_server.errors import ErrorDetails API_VERSION: Final[int] = 4 """The current version of the HTTP API used by the server. ...
19,868
job object dict
"""Interface layer for pykube library shared between Galaxy and Pulsar.""" import logging import os import re import uuid try: from pykube.config import KubeConfig from pykube.http import HTTPClient from pykube.objects import ( Job, Pod ) except ImportError as exc: KubeConfig = None...
19,869
teardown module
import pytest from django.urls import reverse from lxml import etree from taiga.users.models import User from tests import factories as f from tests.utils import disconnect_signals, reconnect_signals pytestmark = pytest.mark.django_db NAMESPACES = { "sitemapindex": "http://www.sitemaps.org/schemas/sitemap/0....
19,870
remove channel handler
import asyncio import json import sys import os import aiohttp_cors as aiohttp_cors from aiohttp import web from pubnub import utils from pubnub.callbacks import SubscribeCallback from pubnub.enums import PNStatusCategory, PNOperationType from pubnub.pubnub_asyncio import PubNubAsyncio d = os.path.dirname PUBNUB_RO...
19,871
policy list
# 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 ._en...
19,872
test create
"""factories to help testing Quipucords.""" from unittest import mock import pytest from api.models import DeploymentsReport, Source, SourceOptions, SystemFingerprint from tests.factories import DeploymentReportFactory, SourceFactory @pytest.mark.django_db class TestDeploymentsReportFactoryFingerprints: """Tes...
19,873
print info
import os import signal import subprocess import time from setproctitle import setproctitle from ipaddress import ip_address from doreah.control import mainfunction from doreah.io import col from doreah.logging import log from . import __pkginfo__ as pkginfo from .pkg_global import conf from .proccontrol import task...
19,874
bu links from id
import logging import requests from requests.packages.urllib3.util import Retry from .base import BaseInventory, InventoryError logger = logging.getLogger('zentral.contrib.inventory.backends.sal') class InventoryClient(BaseInventory): source_config_secret_attributes = ['private_key'] def __init__(self, conf...
19,875
set on select
from travertino.size import at_least from ..libs import Gdk, Gio, GLib, Gtk from .base import Widget from .internal.buttons.refresh import RefreshButton from .internal.buttons.scroll import ScrollButton from .internal.rows.texticon import TextIconRow # TODO: Verify if right clicking a row currently works with touch ...
19,876
test wait till done
import uuid from labelbox import parser import pytest from labelbox.schema.annotation_import import AnnotationImportState, MEAPredictionImport from labelbox.data.serialization import NDJsonConverter """ - Here we only want to check that the uploads are calling the validation - Then with unit tests we can check the typ...
19,877
test tool and model
"""These are basic tests to make sure that C++ classes were wrapped properly. There shouldn't be any python-specifc tests here. """ import os import unittest import opensim as osim test_dir = os.path.join(os.path.dirname(os.path.abspath(osim.__file__)), 'tests') # Silence warning messages i...
19,878
start server
''' Serve up a fake SSH server acting as device CLI ''' import sys import argparse from pathlib import Path import crypt import asyncio import asyncssh from suzieq.shared.utils import get_sq_install_dir class MySSHServerSession(asyncssh.SSHServerSession): '''Customised ssh server session for serving precanned o...
19,879
test get order lines
import json import pytest from mollie.api.error import DataConsistencyError from mollie.api.objects.order_line import OrderLine from .utils import assert_list_object ORDER_ID = "ord_kEn1PlbGa" LINE_ID = "odl_dgtxyl" def METHOD_NAME(client, response): """Retrieve lines of a single order by order ID.""" res...
19,880
write output
import json import pickle import re import yaml from docopt import docopt from cli.cephadm.cephadm import CephAdm from cli.utilities.packages import Rpm, SubscriptionManager from cli.utilities.utils import ( exec_command_on_container, get_container_images, get_disk_list, get_kernel_version, get_re...
19,881
test find missing executables
import zipfile import pytest from pyodide_build.common import ( check_wasm_magic_number, environment_substitute_args, extract_wheel_metadata_file, find_missing_executables, get_num_cores, make_zip_archive, parse_top_level_import_name, repack_zip_archive, ) @pytest.mark.parametrize( ...
19,882
test get all files retrieval error
import io import re from pathlib import Path from unittest.mock import Mock, patch import pytest from tests.monkey_island.utils import assert_linux_permissions, assert_windows_permissions from tests.utils import raise_ from common.utils.environment import is_windows_os from monkey_island.cc import repositories from m...
19,883
save and display gradcam
""" Title: Grad-CAM class activation visualization Author: [fchollet](https://twitter.com/fchollet) Date created: 2020/04/26 Last modified: 2021/03/07 Description: How to obtain a class activation heatmap for an image classification model. Accelerator: NONE """ """ Adapted from Deep Learning with Python (2017). ## Setu...
19,884
create handler
import base64 import os import queue import socketserver from threading import Thread from software.logger.logger import createLogger from software import py_constants logger = createLogger(__name__) import proto from google.protobuf.any_pb2 import Any class ThreadedUnixListener: def __init__( self, uni...
19,885
direct url from link
import logging from pip._internal.models.direct_url import ( DIRECT_URL_METADATA_NAME, ArchiveInfo, DirectUrl, DirectUrlValidationError, DirInfo, VcsInfo, ) from pip._internal.utils.typing import MYPY_CHECK_RUNNING from pip._internal.vcs import vcs try: from json import JSONDecodeError exc...
19,886
load dataset
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import numpy as np from fairseq.data import ( ConcatSentencesDataset, data_utils, Dictionary, IdDataset, Neste...
19,887
bitwise xor
""" Ethereum Virtual Machine (EVM) Bitwise Instructions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. contents:: Table of Contents :backlinks: none :local: Introduction ------------ Implementations of the EVM bitwise instructions. """ from ethereum.base_types import U256, U256_CEIL_VALUE from .. i...
19,888
test pre phase
import pytest import rules from adhocracy4.projects.enums import Access from adhocracy4.test.helpers import freeze_phase from adhocracy4.test.helpers import freeze_post_phase from adhocracy4.test.helpers import freeze_pre_phase from adhocracy4.test.helpers import setup_phase from adhocracy4.test.helpers import setup_u...
19,889
get args
''' The recon subsystem for monitoring well known library calls and identifying dangerous calling mechanisms. NOTE: This subsystem pretty much assumes some intel-like conventions... Recon Format Chars: A - A NULL terminated ascii string U - A NULL terminated utf-16le string P - A platform width pointer ...
19,890
test random write
#!/usr/bin/env python3 # group: rw # # Tests for shrinking images # # Copyright (c) 2016-2017 Parallels International GmbH # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of t...
19,891
need feature generation
#!/usr/bin/python3 -i # # Copyright (c) 2019-2020 Valve Corporation # Copyright (c) 2019-2020 LunarG, Inc. # # 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 wit...
19,892
on post instantiation
# Copyright (c) <2021> Side Effects Software 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list ...
19,893
use pk only optimization
# Copyright (c) 2015 Presslabs SRL # # 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 writ...
19,894
update tracking solr
# encoding: utf-8 import datetime import csv from typing import NamedTuple, Optional import click import ckan.model as model import ckan.logic as logic from ckan.cli import error_shout class ViewCount(NamedTuple): id: str name: str count: int @click.group(name=u'tracking', short_help=u'Update tracki...
19,895
add labels to image
""" Generates hardened images """ import os import logging import tempfile import backoff from consts import Consts from utils import Utils class HardenGenerator: """ Harden generation command handler """ def __init__( self, orchestrator, config_name, config_d...
19,896
sig type
# Original code taken from mcuboot project at: # https://github.com/mcu-tools/mcuboot # Git SHA of the original version: a8e12dae381080e898cea0c6f7408009b0163f9f # # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance w...
19,897
test ci keep build dir single src
# Copyright (c) 2014-present PlatformIO <contact@platformio.org> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
19,898
do add
""" Test script for the 'cmd' module Original by Michael Schneider """ import cmd import sys from test import test_support import re import unittest import StringIO class samplecmdclass(cmd.Cmd): """ Instance the sampleclass: >>> mycmd = samplecmdclass() Test for the function parseline(): >>> my...
19,899
fixable
#!/usr/bin/env python data = { "default_prefix": "OSVC_COMP_GROUP_", "example_value": """ { "tibco": { "gid": 1000, }, "tibco1": { "gid": 1001, } } """, "description": """* Verify a local system group configuration * A minus (-) prefix to the group name indicates the user should not exist """, ...