id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
10,300
test groups list users notfound
''' test groups ''' import uuid import pytest from tenable.errors import NotFoundError from tests.checker import check from tests.pytenable_log_handler import log_exception @pytest.fixture(name='group') def fixture_group(request, api): ''' Fixture to create group ''' group = api.groups.create(str(uuid....
10,301
add fc branch
# Copyright (c) OpenMMLab. All rights reserved. from typing import Tuple import torch.nn as nn from mmcv.cnn import ConvModule from mmengine.model import BaseModule, ModuleList from torch import Tensor from mmdet.models.backbones.resnet import Bottleneck from mmdet.registry import MODELS from mmdet.utils import Confi...
10,302
generate dataset
from unittest.mock import MagicMock import numpy as np import pandas as pd import pytest from pandas.testing import assert_frame_equal from pyod.models.lof import LOF from autogluon.eda import AnalysisState from autogluon.eda.analysis import AnomalyDetector, AnomalyDetectorAnalysis def test_AnomalyDetector(): d...
10,303
add node instance
""" Copyright 2020 Inmanta 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 ...
10,304
state space estimator
# 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...
10,305
not installed
# Copyright 2022 The Matrix.org Foundation C.I.C. # # 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 la...
10,306
type
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
10,307
constant like
# /usr/bin/env python3.6 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification,...
10,308
add noise
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Daniel Strohmeier <daniel.strohmeier@tu-ilmenau.de> # Martin Luessi <mluessi@nmr.mgh.harvard.edu> # # License: BSD-3-Clause import math import numpy as np from scipy.signal import lfilter from ..cov import Covariance, compute_whitener fro...
10,309
proxy profiling service
from datetime import datetime from typing import Any, Dict, Optional from urllib.parse import urlencode, urlparse import brotli import sentry_sdk import urllib3 from django.conf import settings from django.http import HttpResponse as SentryResponse from parsimonious.exceptions import ParseError from urllib3.response i...
10,310
bar
import pytest from mock import patch, sentinel, Mock, MagicMock from pymongo.errors import AutoReconnect, OperationFailure, DuplicateKeyError, ServerSelectionTimeoutError from arctic.decorators import mongo_retry, _get_host from arctic.hooks import register_log_exception_hook def test_mongo_retry(): retries = [2...
10,311
new relation
"""Classes related (dependency, implementation) adapter connections.""" from __future__ import annotations from gaphor import UML from gaphor.core.modeling import Element, Presentation from gaphor.diagram.connectors import ( Connector, DirectionalRelationshipConnect, RelationshipConnect, ) from gaphor.dia...
10,312
test security context
############################################################################## # # Copyright (c) 2005 Zope Foundation and Contributors. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS I...
10,313
get pytket circuits
# 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...
10,314
name
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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 fr...
10,315
tags
# 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...
10,316
get num h bonds
"""Utilities for processing and interfacing with the OpenFF Toolkit.""" from typing import TYPE_CHECKING, Union import networkx as nx import numpy as np from openff.toolkit import Molecule, Topology from openff.toolkit.topology._mm_molecule import _SimpleMolecule from openff.toolkit.typing.engines.smirnoff import Forc...
10,317
test
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import re from spack.package import * class Rccl(CMakePackage): """RCCL (pronounced "Rickle") is a stand-alone libr...
10,318
mock notice
""" Unit tests for PathFinder only for functions that I added """ from unittest import mock import pytest import random from DIRAC import S_OK, S_ERROR import DIRAC.ConfigurationSystem.Client.LocalConfiguration doc_description = """ This is an example of a typical team description. With indents and explanatory inse...
10,319
test state repr includes message and type
from uuid import UUID, uuid4 import pendulum import pydantic import pytest from prefect.deprecated.data_documents import DataDocument from prefect.server.schemas.states import ( AwaitingRetry, Completed, Failed, Late, Pending, Retrying, Running, Scheduled, State, StateDetails, ...
10,320
add user
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2018-2022 The MobileCoin Foundation import argparse import json from flask import Flask, render_template, request from tinydb import TinyDB, Query import os,sys sys.path.insert(1, os.path.realpath(os.path.join(os.path.pardir, "lib"))) import mobilecoin ...
10,321
hessian
__author__ = "gipagano" import numpy as np from lenstronomy.LensModel.Profiles.base_profile import LensProfileBase __all__ = ["ConstMag"] class ConstMag(LensProfileBase): """This class implements the macromodel potential of Diego et al. <https://www.aanda.org/articles/aa/pdf/2019/07/aa35490-19.pdf>`_ C...
10,322
looksgood
""" Find all undefined reference targets and attempt to determine if they are code by emulation behaviorial analysis. (This module works best very late in the analysis passes) """ import envi import vivisect import vivisect.exc as v_exc from envi.archs.i386.opconst import * import vivisect.impemu.monitor as viv_imp_mo...
10,323
test notification html strip check with html
from django.contrib.auth import get_user_model from django_tenants.test.cases import TenantTestCase from model_bakery import baker from model_bakery.recipe import Recipe from notifications.models import Notification, new_notification class NotificationModelTest(TenantTestCase): def setUp(self): User = ...
10,324
lispify ast2
#!/usr/bin/env python """lispify_ast - returns a tuple representation of the AST Uses 2.5's _ast, not other AST implementations in CPython, since these are not used by the compilation phase. And that's what we're interested in. Since this is a tuple, we can directly compare, and this is going to be handy when compari...
10,325
column names
# Licensed to Modin Development Team under one or more contributor license agreements. # See the NOTICE file distributed with this work for additional information regarding # copyright ownership. The Modin Development Team licenses this file to you under the # Apache License, Version 2.0 (the "License"); you may not u...
10,326
getitem
from typing import List, Optional, Tuple, Union import torch from jaxtyping import Bool, Float from torch import Tensor from ..utils.generic import _to_helper from ._linear_operator import _is_noop_index, IndexType, LinearOperator class MaskedLinearOperator(LinearOperator): r""" A :obj:`~linear_operator.op...
10,327
define
import asyncio import aiohttp from fhempy.lib.generic import FhemModule from .. import fhem, utils BASE_URL = "http://www.wienerlinien.at/ogd_realtime/monitor?rbl={}" DEPARTURES = { "first": {"key": 0, "name": "{} first departure"}, "next": {"key": 1, "name": "{} next departure"}, } class wienerlinien(Fhe...
10,328
project dashboard
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license. """ import json import random from uuid import uuid4 from locust import HttpUser, TaskSet, between, task class UserWorksWithProject(TaskSet): d...
10,329
clone signature
from _typeshed import Incomplete from typing import Any from braintree.add_on import AddOn as AddOn from braintree.address import Address as Address from braintree.amex_express_checkout_card import AmexExpressCheckoutCard as AmexExpressCheckoutCard from braintree.android_pay_card import AndroidPayCard as AndroidPayCar...
10,330
length
""" Helper for looping over sequences, particular in templates. Often in a loop in a template it's handy to know what's next up, previously up, if this is the first or last item in the sequence, etc. These can be awkward to manage in a normal Python loop, but using the looper you can get a better sense of the context....
10,331
test add df with series contains na
# pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring import pandas as pd from tests.test_data import DataWithAssets from tests.utils.import_modifiers import RaiseImportError class TestDf(DataWithAssets): def test_add_df_if_pandas_not_installed(self) -> None: with...
10,332
construct content list
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import sys import re import os import locale from functools import reduce def XmlToString(content, encoding="utf-8", pretty=False): """ Writes the XML conten...
10,333
test only host
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import mock import pytest from datadog_checks.base import AgentCheck from datadog_checks.base.errors import ConfigurationError from datadog_checks.proxysql import ProxysqlCheck from .common import creat...
10,334
addredeem
import random import typing from datetime import datetime from discord.ext import commands from helpers.converters import FetchUserConverter, TimeDelta, strfdelta from . import mongo class Administration(commands.Cog): """Commands for bot administration.""" def __init__(self, bot: commands.Bot): s...
10,335
test write invalid index
import pathlib import pytest from salt.wheel import file_roots def _make_temp_root_file(root, *subpaths, binary=False, dir_only=False): """ Creates a file under the specified subpaths of the given root with the filepath as its content. """ full_path = pathlib.Path(root, *subpaths) full_path.pare...
10,336
test nested jit metadata
# Copyright 2020 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...
10,337
exp
"""paddle backend implementation""" from packaging.version import Version import paddle if Version(paddle.__version__) != Version("0.0.0"): raise RuntimeError("DeepXDE requires PaddlePaddle==0.0.0(develop).") if paddle.device.is_compiled_with_cuda(): paddle.device.set_device("gpu") lib = paddle def data_t...
10,338
test main pipeline verbose
#!/usr/bin/env python # coding: utf-8 import numpy as np from cleanlab.benchmarking import noise_generation import pytest seed = 0 np.random.seed(0) def test_main_pipeline( verbose=False, n=10, valid_noise_matrix=True, frac_zero_noise_rates=0, ): trace = 1.5 py = [0.1, 0.1, 0.2, 0.6] K =...
10,339
test search with spaces only
import unittest from datetime import date from io import StringIO from django.core import management from wagtail.search.query import MATCH_ALL from wagtail.search.tests.test_backends import BackendTests from wagtail.test.search import models class ElasticsearchCommonSearchBackendTests(BackendTests): def METHOD...
10,340
max extents
# Authors: William Mill (bill@billmill.org) # License: BSD 3 clause import numpy as np class DrawTree: def __init__(self, tree, parent=None, depth=0, number=1): self.x = -1.0 self.y = depth self.tree = tree self.children = [ DrawTree(c, self, depth + 1, i + 1) for i, c...
10,341
initialize
# # ICRAR - International Centre for Radio Astronomy Research # (c) UWA - The University of Western Australia, 2015 # Copyright by UWA (in the framework of the ICRAR) # All rights reserved # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser G...
10,342
location
# 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...
10,343
drawing color
from PyQt5.QtCore import QObject, Qt from PyQt5.QtGui import QColor, QCursor, QPainter, QPainterPath, QPixmap from PyQt5.QtWidgets import QApplication, QGraphicsDropShadowEffect from defconQt.tools.drawing import applyEffectToPixmap _path = QPainterPath() _path.moveTo(9, 7.3) _path.lineTo(9, 24) _path.lineTo(21, 12) ...
10,344
hop
from typing import List, Optional import pandas as pd from graphistry.Plottable import Plottable from .filter_by_dict import filter_by_dict def METHOD_NAME(self: Plottable, nodes: Optional[pd.DataFrame] = None, hops: Optional[int] = 1, to_fixed_point: bool = False, direction: str = 'forward', edg...
10,345
tfvariable sequential updates
# 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...
10,346
create public dns namespace
"""Handles incoming servicediscovery requests, invokes methods, returns responses.""" import json from moto.core.common_types import TYPE_RESPONSE from moto.core.responses import BaseResponse from .models import servicediscovery_backends, ServiceDiscoveryBackend class ServiceDiscoveryResponse(BaseResponse): def ...
10,347
rgamma
# -*- 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....
10,348
get state
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
10,349
build requirements
from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.env import Environment, VirtualBuildEnv from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir from cona...
10,350
set up
# Copyright 2013 by Saket Choudhary. Based on test_Clustalw_tool.py by Peter # Cock . # # This code is part of the Biopython distribution and governed by its # license. Please see the LICENSE file that should have been included # as part of this package. """Tests for calling BWA.""" from Bio import MissingExternalD...
10,351
list
# 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...
10,352
test gradients
# 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...
10,353
create
# Copyright 2015 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
10,354
quantile
# Copyright (c) 2023 Intel Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writ...
10,355
decrypt blob
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- from json...
10,356
init fleet with gloo
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
10,357
authenticate user
import json import time from authlib.oauth2.rfc6749.grants import ( RefreshTokenGrant as _RefreshTokenGrant, ) from .models import User, Client, OAuth2Token from .oauth2_server import TestCase class RefreshTokenGrant(_RefreshTokenGrant): def authenticate_refresh_token(self, refresh_token): try: ...
10,358
open fonts
# Copyright 2013 Google, Inc. All Rights Reserved. # # Google Author(s): Behdad Esfahbod, Roozbeh Pournader from fontTools import ttLib import fontTools.merge.base from fontTools.merge.cmap import ( computeMegaGlyphOrder, computeMegaCmap, renameCFFCharStrings, ) from fontTools.merge.layout import layoutPre...
10,359
test compute concave hulls subsampling
import unittest import numpy as np from numpy.testing import assert_array_equal from Orange.data import Table from shapely import Polygon from orangecontrib.text.hull import compute_hulls from orangecontrib.text.hull.cluster_hull import ( _denormalize, _normalize, _xy_range, polygon_to_array, ) clas...
10,360
report ambiguity
# # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. # # # This implementation of {@link ANTLRErrorListener} can be used to identify # certain potential correctness and performanc...
10,361
list
# 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...
10,362
test with hearder reader
# 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. # --------------------------------------------------------------------...
10,363
register subscriber
from typing import Callable, Dict from graphql.type import GraphQLSchema from .objects import ObjectType from .types import Subscriber class SubscriptionType(ObjectType): """Bindable populating the Subscription type in a GraphQL schema with Python logic. Extends `ObjectType`, providing `source` decorator a...
10,364
configure step
## # Copyright 2009-2023 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
10,365
get special params sql
from datetime import time from enum import Enum from pypika.functions import * from pypika.terms import Arithmetic, ArithmeticExpression, CustomFunction, Function import frappe from frappe.query_builder.custom import GROUP_CONCAT, MATCH, STRING_AGG, TO_TSVECTOR from frappe.query_builder.utils import ImportMapper, db_...
10,366
test raise error when library version equals
import warnings import unittest from unittest.mock import patch from super_gradients.common.deprecate import deprecated class TestDeprecationDecorator(unittest.TestCase): def setUp(self): """Prepare required functions before each test.""" self.new_function_message = "This is the new function!" ...
10,367
convert pix2struct original pytorch checkpoint to hf
# coding=utf-8 # Copyright 2023 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
10,368
decide files to delete
""" Simple script for pruning backups """ import asyncio from datetime import datetime, timedelta from typing import Set, List from aiobotocore.session import get_session from decouple import config async def fetch_file_list(client, bucket) -> List: """ Fetch the list of files from Object Store. (it comes back so...
10,369
test charset encoding error
import asyncio from typing import Any, Callable, Dict, Tuple, Union from aiohttp import web from opentelemetry.sdk.trace import TracerProvider import tomodachi from tomodachi.discovery.dummy_registry import DummyRegistry from tomodachi.opentelemetry import TomodachiInstrumentor from tomodachi.transport.http import Re...
10,370
ioa with anchors
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
10,371
add unit
""" pint.facets.group.registry ~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: 2022 by Pint Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import annotations from typing import TYPE_CHECKING, Generic, Any, Optional from ...compat import TypeAlias from ...
10,372
test traverse shallow
# Owner(s): ["oncall: distributed"] from collections import OrderedDict import torch import torch.distributed.checkpoint._traverse as _traverse from torch.distributed.checkpoint.metadata import STATE_DICT_TYPE from torch.testing._internal.common_utils import run_tests, TestCase # TODO: add comments for TestTraverse...
10,373
list connected cluster user credentials
# 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...
10,374
hook smm read save state
#!/usr/bin/env python3 # # Cross Platform and Multi Architecture Advanced Binary Emulation Framework # from qiling.os.const import * from ..fncc import * from ..ProcessorBind import * from ..UefiBaseType import * from ..const import * # @see: MdePkg/Include/Protocol/MmCpu.h class EFI_SMM_SAVE_STATE_REGISTER(ENUM_UC)...
10,375
is machine agent installed
import logging import os import subprocess from buildpack import util from lib.m2ee.util import strtobool APPDYNAMICS_INSTALL_PATH = os.path.abspath(".local/appdynamics/") APPDYNAMICS_JAVAAGENT_PATH = os.path.join(APPDYNAMICS_INSTALL_PATH, "javaagent.jar") APPDYNAMICS_MACHINE_AGENT_PATH = os.path.join( APPDYNAMI...
10,376
lookback period str
import logging from abc import ABC, abstractmethod from dataclasses import dataclass from datetime import datetime, timedelta, timezone from typing import Any, Dict, List, Optional from freqtrade.constants import Config, LongShort from freqtrade.exchange import timeframe_to_minutes from freqtrade.misc import plural f...
10,377
read32
""" Contains MNIST dataset """ import os import logging import tempfile import urllib.request import gzip import PIL import tqdm import numpy as np from . import ImagesOpenset from ..decorators import parallel, any_action_failed logger = logging.getLogger('mnist') class MNIST(ImagesOpenset): """ MNIST datase...
10,378
kde count
""" Kernel Density Functions These functions make it easy to integrate stats that compute kernel densities with the wider scientific python ecosystem. Credit: Jake VanderPlas for the original kde_* functions https://jakevdp.github.io/blog/2013/12/01/kernel-density-estimation/ """ import numpy as np import pandas.api...
10,379
dump chrome trace
import contextlib import time import os import json import torch from torch.profiler import profile, ProfilerActivity def synchronize(): pass def METHOD_NAME(f, input, trace_filename, optimize_ctx, activities, num_runs=1, devices=None, kwargs_for_f=None, kwargs_for_profiler=None): """...
10,380
path
import abc import pathlib import sys from _typeshed import StrPath from collections.abc import Iterable, Mapping from email.message import Message from importlib.abc import MetaPathFinder from os import PathLike from pathlib import Path from re import Pattern from typing import Any, ClassVar, NamedTuple, overload from ...
10,381
test round trip dst
#!/usr/bin/env python """ test time_utils different input formats """ from datetime import datetime, timedelta import numpy as np import pytest from gnome.utilities.time_utils import (date_to_sec, sec_to_date, round_time, ...
10,382
update
#!/usr/bin/env python3 import logging from typing import Dict, Union from dataclass_utils import dataclass_from_dict from modules.common import req from modules.common.component_state import InverterState from modules.common.component_type import ComponentDescriptor from modules.common.fault_state import ComponentInfo...
10,383
kdtree
import os import numpy as np from yt.data_objects.static_output import ParticleDataset from yt.funcs import mylog from yt.geometry.particle_geometry_handler import ParticleIndex class SPHDataset(ParticleDataset): default_kernel_name = "cubic" _sph_smoothing_styles = ["scatter", "gather"] _sph_smoothing_...
10,384
wait till done
import json import logging import requests import time from typing import TYPE_CHECKING, Callable, Optional, Dict, Any, List, Union from labelbox import parser from labelbox.exceptions import ResourceNotFoundError from labelbox.orm.db_object import DbObject from labelbox.orm.model import Field, Relationship, Entity i...
10,385
require api key
# Copyright The IETF Trust 2016-2020, All Rights Reserved # -*- coding: utf-8 -*- import datetime from decorator import decorator, decorate from functools import wraps from django.conf import settings from django.contrib.auth import login from django.http import HttpResponse from django.shortcuts import render from...
10,386
state
# pylint: disable=invalid-name import sys import os from functools import partial import numpy as np import tensorflow as tf import pytest from pytest_lazyfixture import lazy_fixture as lf thisfile = os.path.abspath(__file__) modulepath = os.path.dirname(os.path.dirname(thisfile)) sys.path.insert(0, modulepath) impo...
10,387
get node id
""" Configuration module. Uses backend_config to load system configuration. """ import logging import os import sys from os.path import expandvars, expanduser from ..backend_api import load_config from ..backend_config import Config from ..backend_config.bucket_config import S3BucketConfigurations from .defs import *...
10,388
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...
10,389
l1 ntuple aodem u mc
import FWCore.ParameterSet.Config as cms import os ############################################################################## # customisations for L1 ntuple generation # # Add new customisations to this file! # # Example usage : # cmsDriver.py testNtuple -s NONE --customise=L1Trigger/L1TNtuples/customiseL1Ntuple...
10,390
parse dats json file
import csv import datetime import getopt import json import os import sys def main(argv): conp_dataset_dir = parse_input(argv) csv_content = read_conp_dataset_dir(conp_dataset_dir) write_csv_file(csv_content) def parse_input(argv): conp_dataset_dir = None description = ( "\nThis too...
10,391
empty line
# Copyright (c) 2016 Dave Germiquet # See LICENSE for details. from __future__ import annotations from typing import ClassVar from collections.abc import Callable from twisted.conch.insults import insults from twisted.test import proto_helpers BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, N_COLORS = list(...
10,392
test validate properties with incorrect property dict
# ---------------------------------------------------------------------------- # Copyright (C) 2021 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 copy ...
10,393
assert child is process group leader
# 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. import os import errno import unittest import subprocess import signal ...
10,394
load mtree file cropped
""" Code to read AHF's mtree files """ import os import numpy as np from ..log import logger class AHFTree: def __init__(self, path, ts): self._path = self._AHF_path_from_snapdir_path(os.path.join(path,ts.extension)) self._load_fid(ts.previous) self._load_raw_links() def _AHF_path...
10,395
has project conf
from sentry.exceptions import PluginError from sentry.integrations import FeatureDescription, IntegrationFeatures from sentry.interfaces.contexts import ContextType from sentry.models import Project from sentry.plugins.base import Plugin2 from sentry.plugins.base.configuration import react_plugin_config from sentry.uti...
10,396
test metrics imperfect binary
from math import isclose import numpy as np import pytest import sklearn from autogluon.core.constants import BINARY, MULTICLASS, QUANTILE, REGRESSION from autogluon.core.metrics import METRICS, Scorer, rmse_func BINARY_METRICS = list(METRICS[BINARY].keys()) MULTICLASS_METRICS = list(METRICS[MULTICLASS].keys()) REGR...
10,397
assert scan
import sys from test.test_json import PyTest, CTest class TestScanstring: def test_scanstring(self): scanstring = self.json.decoder.scanstring self.assertEqual( scanstring('"z\U0001d120x"', 1, True), ('z\U0001d120x', 5)) self.assertEqual( scanstring('"\...
10,398
run test
#!/usr/bin/env python3 # Copyright (c) 2018 The Zcash developers # Distributed under the MIT software license, see the accompanying # file COPYING or https://www.opensource.org/licenses/mit-license.php . from test_framework.test_framework import BitcoinTestFramework from test_framework.util import assert_equal, initia...
10,399
get
# 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; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be usefu...