id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
298,100
test init2
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
298,101
mock gcp resource iter
# Copyright 2020 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...
298,102
register artifact dataset sources
import re import warnings from pathlib import Path from typing import Any, Dict, TypeVar from urllib.parse import urlparse from mlflow.artifacts import download_artifacts from mlflow.exceptions import MlflowException from mlflow.protos.databricks_pb2 import INVALID_PARAMETER_VALUE from mlflow.store.artifact.artifact_r...
298,103
preprocess
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # http://www.apache.org/licenses/LICENSE-2.0 # or in the "license" file...
298,104
torchhub docstring
from dataclasses import dataclass, asdict, replace from .common import ( SequentialSqueezeAndExcitationTRT, SequentialSqueezeAndExcitation, SqueezeAndExcitation, SqueezeAndExcitationTRT, ) from typing import Optional, Callable import os import torch import argparse from functools import partial @datac...
298,105
custom profile scores
# coding=utf-8 from __future__ import annotations import logging import re from app.config import get_settings from app.database import TableCustomScoreProfileConditions as conditions_table, TableCustomScoreProfiles as \ profiles_table logger = logging.getLogger(__name__) class Condition: """Base class fo...
298,106
repl
#@+leo-ver=5-thin #@+node:ekr.20140723122936.18137: * @file ../plugins/importers/xml.py """The @auto importer for the xml language.""" from __future__ import annotations import re from typing import TYPE_CHECKING from leo.core import leoGlobals as g # Required. from leo.plugins.importers.base_importer import Block, Im...
298,107
clear
""" This is an advanced Piccolo feature which allows runtime reflection of database tables. """ import asyncio import typing as t from dataclasses import dataclass from piccolo.apps.schema.commands.generate import get_output_schema from piccolo.table import Table class Immutable(object): def _immutable(self, *a...
298,108
resolve name
"""Utility code for constructing importers, etc.""" from ._bootstrap import MAGIC_NUMBER from ._bootstrap import cache_from_source from ._bootstrap import decode_source from ._bootstrap import source_from_cache from ._bootstrap import spec_from_loader from ._bootstrap import spec_from_file_location from ._bootstrap im...
298,109
test alternating good and bad gradients trigger
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
298,110
test aarch64 virt mem icount
# TCG Plugins tests # # These are a little more involved than the basic tests run by check-tcg. # # Copyright (c) 2021 Linaro # # Author: # Alex Bennée <alex.bennee@linaro.org> # # SPDX-License-Identifier: GPL-2.0-or-later import tempfile import mmap import re from boot_linux_console import LinuxKernelTest class P...
298,111
truth table
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
298,112
tear down
import io import locale import mimetypes import sys import unittest from test import support # Tell it we don't know about external files: mimetypes.knownfiles = [] mimetypes.inited = False mimetypes._default_mime_types() class MimeTypesTestCase(unittest.TestCase): def setUp(self): self.db = mimetypes.M...
298,113
test disable single
import pytest from cumulusci.core.exceptions import TaskOptionsError from cumulusci.tasks.metadata_etl import SetObjectSettings from cumulusci.tasks.salesforce.tests.util import create_task from cumulusci.utils.xml import metadata_tree MD = "{%s}" % metadata_tree.METADATA_NAMESPACE CUSTOMOBJECT_SETTINGS_XML = b"""<?...
298,114
test nested multiple withs and nested withs
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
298,115
get bmc version
############################################################################# # # Component contains an implementation of SONiC Platform Base API and # provides the components firmware management function # ############################################################################# try: import subprocess fr...
298,116
perform lookups
from threading import Thread from nfs_operations import cleanup_cluster, setup_nfs_cluster from cli.exceptions import ConfigError, OperationFailedError from utility.log import Log log = Log(__name__) def create_copy_files(mount_point, num_files, client1, client2): for i in range(1, num_files + 1): try:...
298,117
test smbstatusp
import doctest import pytest from insights.core.exceptions import ParseException, SkipComponent from insights.parsers import smbstatus from insights.parsers.smbstatus import SmbstatusS, Smbstatusp, Statuslist from insights.tests import context_wrap SMBSTATUSS = """ Service pid Machine Connected at ...
298,118
test autoclose
from __future__ import annotations from unittest.mock import Mock import pytest from kombu import Connection, Exchange, Queue from kombu.exceptions import ContentDisallowed class SimpleBase: def Queue(self, name, *args, **kwargs): q = name if not isinstance(q, Queue): q = self.__cl...
298,119
can edit index
#!/usr/bin/env python # -- coding: utf-8 -- # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (th...
298,120
reset to defaults cb
# Copyright (C) 2010 Adam Olsen # # 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, or (at your option) # any later version. # # This program is distributed in the hope that it w...
298,121
real to virtual
import time from math import inf from .. import _core from .._abc import Clock from .._util import Final from ._run import GLOBAL_RUN_CONTEXT ################################################################ # The glorious MockClock ################################################################ # Prior art: # ht...
298,122
test target grid generation
""" Tests for resistivity model to geotiff. """ import pytest import numpy as np from mtpy.utils import convert_modem_data_to_geogrid as conv def test_strip_padding(): grid_axis = [-2., -1., 0., 1., 2.] test = conv._strip_padding(grid_axis, 1) expected = [-1., 0., 1.] np.testing.assert_array_equal(te...
298,123
sub
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # Render the user / install guide in pdf and wiki formats # Outputs: userguide.wiki, UserGuide.pdf, install.wiki, INSTALL.pdf # Author: Alex Dumitrache <broscutamaker@gmail.com> # License: GPL import os, re, time, string import urllib from mkdoc_utils import system_or_e...
298,124
wrapper
# -*- coding: utf-8 -*- """ FTP client implementation """ import ftplib import re from typing import List, Optional def assert_connected(func): """ Decorator that asserts that the FTP client is connected before executing the decorated method """ def METHOD_NAME(self, *args, **kwargs): if not ...
298,125
compute kanban dashboard
# Copyright (C) 2020 KMEE - www.kmee.com.br # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html import json from odoo import _, fields, models from ..constants.fiscal import ( SITUACAO_EDOC_A_ENVIAR, SITUACAO_EDOC_AUTORIZADA, SITUACAO_EDOC_CANCELADA, SITUACAO_EDOC_DENEGADA, SITUACAO...
298,126
test unresolved builtin
from typing import TypeVar from astroid import nodes from pytest import skip from python_ta.typecheck.base import TypeFailFunction from .. import custom_hypothesis_support as cs def test_overload_function(): program = """ def foo(x, y=None): return x + 5 foo(5) foo(5, 6) """ ast_mo...
298,127
get child path
#!/usr/bin/python ############### # workspaceTree.py # # Copyright David Baddeley, 2012 # d.baddeley@auckland.ac.nz # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lic...
298,128
test invalid feature
from django.urls import reverse from sentry.testutils.cases import APITestCase class PromptsActivityTest(APITestCase): def setUp(self): super().setUp() self.login_as(user=self.user) self.org = self.create_organization(owner=self.user, name="baz") # self.project = self.create_proje...
298,129
get toolkit from name
import json import requests from sqlalchemy import Column, Integer, String, Boolean from superagi.models.base_model import DBBaseModel from superagi.models.tool import Tool marketplace_url = "https://app.superagi.com/api" # marketplace_url = "http://localhost:8001" class Toolkit(DBBaseModel): """ ToolK...
298,130
is supported
# Copyright 2019 Xilinx 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, ...
298,131
test truncate over preallocated area full
#!/usr/bin/env python3 # # Test for preallocate filter # # Copyright (c) 2020 Virtuozzo International GmbH. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or ...
298,132
convert
import time import os import sys import string import sys import zlib import struct import png #import the library opencv import cv2 def swap32(i): return struct.unpack("<I", struct.pack(">I", i))[0] def _clamp(n, smallest, largest): return max(smallest, min(n, largest)) def yuv422_to_rgb(bytesequence): im...
298,133
created resources
# pylint: disable=missing-docstring, redefined-outer-name import uuid from typing import Dict, Generator, List, Optional import pytest from fideslang import FidesModel, model_list from fides.config import FidesConfig from fides.core import api as _api from fides.core import api_helpers as _api_helpers from tests.ctl....
298,134
get shipment customer
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from datetime import date, timedelta import frappe from frappe.tests.utils import FrappeTestCase from erpnext.stock.doctype.delivery_note.delivery_note import make_shipment class TestShipment(FrappeTestCase): def test_shipment_...
298,135
ok
#!/usr/bin/env python # coding=utf-8 # Copyright (c) 2015 Remko Tronçon (https://el-tramo.be) # Released under the MIT license # See COPYING for details import base64 import sys import unittest if sys.hexversion >= 0x03000000: from io import StringIO else: from StringIO import StringIO # Log modes class Lo...
298,136
visit func arg int
from typing import Optional from antlr4.tree.Tree import ParseTree, TerminalNodeImpl from localstack.services.stepfunctions.asl.antlr.runtime.ASLIntrinsicLexer import ASLIntrinsicLexer from localstack.services.stepfunctions.asl.antlr.runtime.ASLIntrinsicParser import ( ASLIntrinsicParser, ) from localstack.servic...
298,137
on getblocktxn
#!/usr/bin/env python3 # Copyright (c) 2017-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file LICENSE or http://www.opensource.org/licenses/mit-license.php. """Test message sending before handshake completion. A node should never send anything other than VERSION...
298,138
pytest configure
import os import pytest import requests from datadog_checks.base.utils.platform import Platform from datadog_checks.dev import TempDir, docker_run, get_here from datadog_checks.dev.conditions import CheckDockerLogs, WaitFor HERE = get_here() @pytest.fixture(scope="session") def socks5_proxy(): proxy = "localho...
298,139
load user
# coding: utf-8 """ Conjunto de modelos relacionais para o controle da app (Usuarios, auditorias, logs, etc) Os modelos do catálogo do OPAC (periódicos, números, artigos) estão definidos na lib: opac_schema (ver requirements.txt) """ import os from flask import current_app from flask_login import UserMix...
298,140
port start
try: import time from sonic_sfp.sfputilbase import SfpUtilBase except ImportError as e: raise ImportError(str(e) + "- required module not found") class SfpUtil(SfpUtilBase): """Platform specific SfpUtill class""" _port_start = 1 _port_end = 56 _qsfp_port_start = 49 _ports_in_block = 5...
298,141
generate transformers runbook
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from dataclasses import dataclass, field from pathlib import Path from typing import Any, Dict, List, Type from unittest import TestCase from dataclasses_json import dataclass_json from lisa import LisaException, constants, schema, transformer ...
298,142
test get metric
import os import pytest from mongoengine import connect from kairon import Utility from kairon.shared.metering.constants import MetricType from kairon.shared.metering.metering_processor import MeteringProcessor from kairon.shared.metering.data_object import Metering class TestMetering: @pytest.fixture(autouse=...
298,143
header 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 # --------------------------------...
298,144
latex escape
# -*- coding: utf-8 -*- # # Copyright 2018-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 co...
298,145
rewrite helper
# Copyright 2022 The Kubeflow 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 ...
298,146
test quantize op
from caffe2.python import core, workspace import caffe2.python.hypothesis_test_util as hu import numpy as np def FakeQuantization8BitsRowwise(data): min_el = np.min(data, axis=1) max_el = np.max(data, axis=1) scale = (max_el - min_el) / 255. bias = min_el inv_scale = 1. / scale data = da...
298,147
unlink
#!/usr/bin/python3 import json import shutil import sys import yaml from brownie import accounts, network from brownie._config import BROWNIE_FOLDER, _get_data_folder from brownie.exceptions import ProjectNotFound, UnknownAccount from brownie.project import check_for_project, ethpm from brownie.utils import color, n...
298,148
prepare request
# 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...
298,149
test mask dtype
import numpy as np from skimage.measure import find_contours from skimage._shared.testing import assert_array_equal import pytest a = np.ones((8, 8), dtype=np.float32) a[1:-1, 1] = 0 a[1, 1:-1] = 0 x, y = np.mgrid[-1:1:5j, -1:1:5j] r = np.sqrt(x**2 + y**2) def test_binary(): ref = [[6.0, 1.5], [5.0...
298,150
platform linux
# -*- coding: utf-8 -*- # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2016 Toshio Kuratomi <tkuratomi@ansible.com> # (c) 2017-2018 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_func...
298,151
get segm stats
from __future__ import annotations import logging from itertools import chain from typing import List import numpy as np import pandas as pd from lithops.storage import Storage from sm.engine.annotation_lithops.executor import Executor from sm.engine.annotation_lithops.io import save_cobj, load_cobj, CObj, load_cobj...
298,152
on startup
import logging import urllib.parse from dataclasses import dataclass from typing import Any, TypeAlias import httpx from fastapi import FastAPI, HTTPException, status from models_library.services import ServiceKey, ServiceVersion from models_library.users import UserID from settings_library.catalog import CatalogSetti...
298,153
get indirect links
# -*- coding: utf-8 -*- import json import re from pyload.core.utils.purge import uniquify from ..base.simple_decrypter import SimpleDecrypter class ImgurCom(SimpleDecrypter): __name__ = "ImgurCom" __type__ = "decrypter" __version__ = "0.61" __status__ = "testing" __pattern__ = r"https?://(?:w...
298,154
yaml rule1
# Leo colorizer control file for yaml mode. # This file is in the public domain. # Properties for yaml mode. properties = { "indentNextLines": "\\s*([^\\s]+\\s*:|-)\\s*$", "indentSize": "2", "noTabs": "true", "tabSize": "2", "lineComment": "#", } # Attributes dict for yaml_main ruleset. yaml_main_...
298,155
disconnect
""" RSS parser for Evennia This connects an RSS feed to an in-game Evennia channel, sending messages to the channel whenever the feed updates. """ from django.conf import settings from twisted.internet import task, threads from evennia.server.session import Session from evennia.utils import logger RSS_ENABLED = set...
298,156
build ranges
#! /usr/bin/env python3 # Copyright (C) 2020 IBM Corp. # This program is 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...
298,157
test topdown
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import numpy as np from mmpose.datasets.datasets.wholebody import CocoWholeBodyDataset class TestCocoWholeBodyDataset(TestCase): def build_coco_wholebody_dataset(self, **kwargs): cfg = dict( ann_file='test_coco_w...
298,158
subscribe desired
# -*- coding: utf-8 -*- # vim:set ts=4 sw=4 et: # # Copyright 2015,2021 Vladimir Ermakov. # # This file is part of the mavros package and subject to the license terms # in the top-level LICENSE file of the mavros repository. # https://github.com/mavlink/mavros/tree/master/LICENSE.md import rclpy from geographic_msgs.m...
298,159
run
import timeit import traceback from ceph.ceph import CommandFailed from tests.cephfs.cephfs_utils import FsUtils from tests.cephfs.cephfs_utilsV1 import FsUtils as FsUtilsV1 from utility.log import Log log = Log(__name__) def METHOD_NAME(ceph_cluster, **kw): """ Mount CephFS on multiple clients, perform wri...
298,160
log os system
# # psuutil.py # Platform-specific PSU status interface for SONiC # import os.path import subprocess import logging from sonic_py_common.general import check_output_pipe try: from sonic_psu.psu_base import PsuBase except ImportError as e: raise ImportError(str(e) + "- required module not found") DEBUG = Fal...
298,161
explore boolean
import random from typing import Any, Dict, List, Union from ludwig.schema.metadata.parameter_metadata import ExpectedImpact # base types for ludwig config parameters. ParameterBaseTypes = Union[str, float, int, bool, None] def handle_property_type( property_type: str, item: Dict[str, Any], expected_impact: Exp...
298,162
test in memory cache storage wrapper get
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
298,163
dataset with reoccurring unknown words
# ---------------------------------------------------------------------------- # Copyright (C) 2021-2023 Deepchecks (https://www.deepchecks.com) # # This file is part of Deepchecks. # Deepchecks is distributed under the terms of the GNU Affero General # Public License (version 3 or later). # You should have received a ...
298,164
register credential definitions
# Copyright © 2022 Province of British Columbia # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
298,165
split pronunciation tags
import hashlib import re from typing import Dict, List, Optional, Union from wikitextprocessor import NodeKind, WikiNode from wiktextract.datautils import append_base_data from wiktextract.extractor.share import WIKIMEDIA_COMMONS_URL from wiktextract.page import clean_node from wiktextract.wxr_context import Wiktextr...
298,166
switch phases
import time from control import data from helpermodules import pub, timecheck from helpermodules.utils.error_counter import ErrorCounterContext from modules.chargepoints.external_openwb.config import OpenWBSeries from modules.common.abstract_chargepoint import AbstractChargepoint from modules.common.abstract_device im...
298,167
send message
import io import re import json import tempfile import contextlib from aiohttp import ClientSession, ClientTimeout from dffml.cli.cli import CLI from dffml import op, config, Definition, BaseSecret ACCESSTOKEN = Definition(name="access_token", primitive="str") ROOMNAME = Definition(name="room_name", primitive="str") ...
298,168
test search is limited to index name
# SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. # # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. # # Licensed to Elasticsearch B.V. under...
298,169
put auto follow pattern
from ..utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH class CcrClient(NamespacedClient): @query_params() def delete_auto_follow_pattern(self, name, params=None): """ `<https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-delete-auto-follow-pattern.html>`_ ...
298,170
on 200
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
298,171
message
# 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...
298,172
start
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # notic...
298,173
parse
# Copyright (c) nexB Inc. and others. All rights reserved. # ScanCode is a trademark of nexB Inc. # SPDX-License-Identifier: Apache-2.0 # See http://www.apache.org/licenses/LICENSE-2.0 for the license text. # See https://github.com/nexB/scancode-toolkit for support or download. # See https://aboutcode.org for more inf...
298,174
oem encode
import codecs import sys from _typeshed import ReadableBuffer from collections.abc import Callable from typing import overload from typing_extensions import Literal, TypeAlias # This type is not exposed; it is defined in unicodeobject.c class _EncodingMap: def size(self) -> int: ... _CharMap: TypeAlias = dict[int...
298,175
find in transport map
from __future__ import annotations from typing import Any, TYPE_CHECKING from dcs import Point from pydantic import BaseModel from game.server.leaflet import LeafletPoint if TYPE_CHECKING: from game import Game from game.theater import ControlPoint from game.transfers import MultiGroupTransport, Transpo...
298,176
is uplink
#!/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" BAS...
298,177
match
"""Fix incompatible imports and module references.""" # Authors: Collin Winter, Nick Edds # Local imports from .. import fixer_base from ..fixer_util import Name, attr_chain MAPPING = {'StringIO': 'io', 'cStringIO': 'io', 'cPickle': 'pickle', '__builtin__' : 'builtins', 'c...
298,178
read
import json class Vocabulary: def __init__(self, opencti): self.opencti = opencti self.properties = """ id name category { key fields { key } } """ def list(self, **kwar...
298,179
test calculate tool usage
import pytest from unittest.mock import MagicMock, patch from fastapi import HTTPException from superagi.apm.tools_handler import ToolsHandler from sqlalchemy.orm import Session from superagi.models.agent_config import AgentConfiguration from datetime import datetime import pytz @pytest.fixture def organisation_id():...
298,180
expand
# Copyright 2021 The JAX 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
298,181
object link
from django import forms from django.contrib import admin from django.forms import ModelForm, ModelMultipleChoiceField, CheckboxSelectMultiple from simple_history.admin import SimpleHistoryAdmin from django.contrib.admin.models import LogEntry, DELETION from django.utils.html import escape from django.urls import rever...
298,182
parse args
import argparse import logging import sys from typing import Any from crytic_compile import cryticparser from slither import Slither from slither.tools.properties.properties.erc20 import generate_erc20, ERC20_PROPERTIES from slither.tools.properties.addresses.address import ( Addresses, OWNER_ADDRESS, USE...
298,183
initialize field values
from game.world.managers.objects.ObjectManager import ObjectManager from game.world.managers.objects.guids.GuidManager import GuidManager from game.world.managers.objects.units.player.PlayerManager import PlayerManager from utils.ByteUtils import ByteUtils from utils.constants.ItemCodes import InventorySlots from utils...
298,184
event received start
# automatically generated by the FlatBuffers compiler, do not modify # namespace: proto import flatbuffers from flatbuffers.compat import import_numpy np = import_numpy() class EventReceived(object): __slots__ = ['_tab'] @classmethod def GetRootAs(cls, buf, offset=0): n = flatbuffers.encode.Get(...
298,185
highlighter
# 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 ...
298,186
inner function
# -*- coding: utf-8 -*- # # RERO ILS # Copyright (C) 2019-2022 RERO # Copyright (C) 2019-2022 UCLouvain # # 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. # # Thi...
298,187
mask center 2d
import numpy as np import lenstronomy.Util.util as util from lenstronomy.Util import param_util from lenstronomy.Util.package_util import exporter export, __all__ = exporter() @export def METHOD_NAME(center_x, center_y, r, x_grid, y_grid): """ :param center_x: x-coordinate of center position of circular ma...
298,188
get or create deployment directory
import logging import os import random import shutil import string import uuid import warnings from pathlib import Path import pytest from urllib3.exceptions import InsecureRequestWarning from _nebari.config import read_configuration, write_configuration from _nebari.deploy import deploy_configuration from _nebari.de...
298,189
configure
# This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # bu...
298,190
run cli
# # See top-level LICENSE.rst file for Copyright information # # -*- coding: utf-8 -*- """ desispec.pipeline.tasks.psf =========================== """ from __future__ import absolute_import, division, print_function from collections import OrderedDict from ..defs import (task_name_sep, task_state_to_int, task_int_t...
298,191
save gmt
############################################################ # Program is part of MintPy # # Copyright (c) 2013, Zhang Yunjun, Heresh Fattahi # # Author: Heresh Fattahi, 2013 # ############################################################ # Modified from...
298,192
get certified by
from enum import Enum import pandas as pd from flows.corps.event_filing_service import OtherEventFilings class AddressFormatType(str, Enum): BASIC = 'BAS' ADVANCED = 'ADV' FOREIGN = 'FOR' @classmethod def has_value(cls, value): return value in cls._value2member_map_ def METHOD_NAME(fi...
298,193
test propagation fails if binary not downloaded
from ipaddress import IPv4Address from threading import Event from typing import Callable, Tuple, Type from unittest.mock import MagicMock from uuid import UUID import pytest import requests import requests_mock from agent_plugins.exploiters.hadoop.src.hadoop_exploit_client import HadoopExploitClient from agent_plugin...
298,194
setup
""" Platformer Template If Python and Arcade are installed, this example can be run from the command line with: python -m arcade.examples.template_platformer """ from __future__ import annotations import arcade # --- Constants SCREEN_TITLE = "Platformer" SCREEN_WIDTH = 1000 SCREEN_HEIGHT = 650 # Constants used to ...
298,195
with key path
# pylint: disable=wrong-or-nonexistent-copyright-notice from typing import Any, Dict, FrozenSet, Iterable, Mapping, Tuple, TYPE_CHECKING, Union import numpy as np from cirq import linalg, protocols, value from cirq._compat import proper_repr from cirq.ops import raw_types if TYPE_CHECKING: import cirq class Mix...
298,196
forward single
# Copyright (c) OpenMMLab. All rights reserved. from typing import Any, List, Optional, Tuple import torch import torch.nn.functional as F from torch import nn from torch.autograd import Function from ..utils import ext_loader ext_module = ext_loader.load_ext( '_ext', ['dynamic_point_to_voxel_forward', 'dyna...
298,197
send account delete confirmation notification
from typing import Optional from urllib.parse import urlencode from django.contrib.auth.tokens import default_token_generator from ..core.notification.utils import get_site_context from ..core.notify_events import NotifyEventType from ..core.tokens import account_delete_token_generator from ..core.utils.url import pr...
298,198
test user with multiple organizations
import responses from sentry.integrations.slack.views.link_identity import build_linking_url from sentry.integrations.slack.views.unlink_identity import build_unlinking_url from sentry.models import Identity, IdentityStatus, OrganizationIntegration from sentry.testutils.cases import TestCase from sentry.testutils.help...
298,199
test init from info
# pylint: disable=protected-access, unused-argument, no-value-for-parameter from unittest import mock, TestCase from .test_common import setUp from radical.pilot.agent.launch_method.fork import Fork # ------------------------------------------------------------------------------ # class TestFork(TestCase): # -...