id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
3,500
test xpass strict
"""Example test script for use by PyTest.""" # For the most basic usage, no imports are required. # pytest will automatically detect any test cases based # on methods starting with ``test_``. import os import pytest from testplan.testing.multitest.result import Result class TestPytestBasics: """ Demonstrate...
3,501
dump result
# 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 ast import logging import matplotlib.pyplot as plt import numpy as np from pathlib import Path import soundfile as sf import sys import...
3,502
wait for task token
import abc import json from localstack.aws.api.stepfunctions import ( HistoryEventExecutionDataDetails, HistoryEventType, TaskFailedEventDetails, TaskSubmittedEventDetails, ) from localstack.services.stepfunctions.asl.component.common.error_name.custom_error_name import ( CustomErrorName, ) from lo...
3,503
test mimo
# Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved. import copy import dace from dace.sdfg import nodes from dace.sdfg.graph import SubgraphView from dace.transformation.helpers import nest_state_subgraph import numpy as np import unittest import sys from dace.transformation.subgraph import Mul...
3,504
check config
# # Copyright 2018-2022 GoPro Inc. # # 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...
3,505
id
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
3,506
set client undo redo action group id
import re import uuid from typing import Any from django.conf import settings from django.contrib.auth.models import AbstractUser from baserow.api.exceptions import ( InvalidClientSessionIdAPIException, InvalidUndoRedoActionGroupIdAPIException, ) UNTRUSTED_CLIENT_SESSION_ID_USER_ATTR = "untrusted_client_sess...
3,507
validate
import dns.name import dns.zone from rest_framework import serializers from api import settings from desecapi.models import Domain, RR_SET_TYPES_AUTOMATIC from desecapi.validators import ReadOnlyOnUpdateValidator from .records import RRsetSerializer class DomainSerializer(serializers.ModelSerializer): default_e...
3,508
test supported confinement
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2019 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the h...
3,509
zlib compress
# Copyright (c) 2015-2023 Vector 35 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 without limitation the # rights to use, copy, modify, merge, publish, ...
3,510
get encryption key
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: MIT. See LICENSE from cryptography.fernet import Fernet, InvalidToken from passlib.context import CryptContext from pypika.terms import Values import frappe from frappe import _ from frappe.query_builder import Table from frappe.utils imp...
3,511
layout
from conan import ConanFile from conan.tools.cmake import CMake, cmake_layout, CMakeDeps, CMakeToolchain from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, rmdir from conan.tools.microsoft import is_msvc from conan.tools.scm import Version from conan.errors import ...
3,512
iter tx
# Copyright 2021 Hathor Labs # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
3,513
test returns the current value for a
#!/usr/bin/env pmpython # # Copyright (C) 2016 Sitaram Shelke. # # 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. # # Thi...
3,514
modules
# Copyright (c) Alibaba, Inc. and its affiliates. import importlib import inspect from typing import List, Tuple, Union from modelscope.utils.logger import get_logger TYPE_NAME = 'type' default_group = 'default' logger = get_logger() AST_INDEX = None class Registry(object): """ Registry which support registeri...
3,515
colorize line
import itertools import json import sys from . import tskv # Info about colors https://misc.flogisoft.com/bash/tip_colors_and_formatting class Colors: BLACK = '\033[30m' RED = '\033[31m' GREEN = '\033[32m' YELLOW = '\033[33m' BLUE = '\033[34m' GRAY = '\033[37m' DARK_GRAY = '\033[37m' ...
3,516
get
from logging import getLogger from typing import Any, Callable, List, Optional from pika.channel import Channel from pika.spec import Basic, BasicProperties from opentelemetry import context, propagate, trace from opentelemetry.instrumentation.utils import _SUPPRESS_INSTRUMENTATION_KEY from opentelemetry.propagators....
3,517
test construction
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the :class:`iris.coord_systems.Mercator` class.""" # Import iris.tests first so that some things can be init...
3,518
talon copy list
import os import platform import pprint import re from itertools import islice from typing import Union from talon import Module, actions, app, clip, registry, scope, speech_system, ui from talon.grammar import Phrase pp = pprint.PrettyPrinter() mod = Module() pattern = re.compile(r"[A-Z][a-z]*|[a-z]+|\d") def cr...
3,519
get auto negotiation mode
import json import logging import os from tests.common.devices.base import AnsibleHostBase import re def _raise_err(msg): raise Exception(msg) class AosHost(AnsibleHostBase): """ @summary: Class for Accton switch For running ansible module on the Accton switch """ def __init__(self, ansibl...
3,520
test internal integral
import pytest import numpy as np from firedrake import * @pytest.fixture(params=[False, True]) def f(request): quadrilateral = request.param m = UnitSquareMesh(1, 1, quadrilateral=quadrilateral) fs = FunctionSpace(m, "CG", 1) f = Function(fs) x = SpatialCoordinate(m) f.interpolate(x[0]) re...
3,521
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 . im...
3,522
nvars
r""" Solve SAT problems Integer Linear Programming The class defined here is a :class:`~sage.sat.solvers.satsolver.SatSolver` that solves its instance using :class:`MixedIntegerLinearProgram`. Its performance can be expected to be slower than when using :class:`~sage.sat.solvers.cryptominisat.cryptominisat.CryptoMiniS...
3,523
on unclick
"""Line numbers on left side of the file being edited.""" from __future__ import annotations import tkinter.font from porcupine import get_tab_manager, settings, tabs, utils def line_is_elided(textwidget: tkinter.Text, lineno: int) -> bool: tags = textwidget.tag_names(f"{lineno}.0") elide_values = (textwidg...
3,524
get shlib stem
# MIT License # # Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, ...
3,525
arn
# 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...
3,526
test wide chars
import contextlib import importlib import io import unittest import osc.conf from osc._private import print_msg from osc.output import KeyValueTable class TestKeyValueTable(unittest.TestCase): def test_empty(self): t = KeyValueTable() self.assertEqual(str(t), "") def test_simple(self): ...
3,527
assert true
import sys L = [ ('0', 0), ('1', 1), ('9', 9), ('10', 10), ('99', 99), ('100', 100), ('314', 314), (' 314', 314), ('314 ', 314), (' \t\t 314 \t\t ', 314), (repr(sys.maxsize), sys.maxsize), (' 1x', ValueError), ...
3,528
feature columns
import abc import inspect import pathlib import importlib from dataclasses import dataclass from typing import List, Dict, Any from dffml.base import field from dffml.feature.feature import Feature, Features from dffml.source.source import Sources, SourcesContext from dffml.model.model import ModelContext, Model, Mode...
3,529
parse psi mi
import re import logging from indra.databases import uniprot_client from indra.statements import Agent, Complex, Evidence from indra.ontology.standardize import standardize_agent_name logger = logging.getLogger(__name__) class VirhostnetProcessor: """A processor that takes a pandas DataFrame and extracts INDRA ...
3,530
find loader
"""A pure Python implementation of import.""" __all__ = ['__import__', 'import_module', 'invalidate_caches', 'reload'] # Bootstrap help ##################################################### # Until bootstrapping is complete, DO NOT import any modules that attempt # to import importlib._bootstrap (directly or indirect...
3,531
test remove fd invalid fd
#!/usr/bin/env python3 # group: rw quick # # Tests for fdsets and getfd. # # Copyright (C) 2012 IBM Corp. # # 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 # ...
3,532
test plots self test full test1
import vtk import slicer from slicer.ScriptedLoadableModule import * # # PlotsSelfTest # class PlotsSelfTest(ScriptedLoadableModule): def __init__(self, parent): ScriptedLoadableModule.__init__(self, parent) self.parent.title = "PlotsSelfTest" self.parent.categories = ["Testing.TestCases...
3,533
test rotation
import copy import unittest import numpy as np from pydrake.common import RandomGenerator import pydrake.common.schema as mut import pydrake.math class TestSchema(unittest.TestCase): def _check_distribution(self, dut): """Confirms that a subclass instance of Distribution * binds the base method...
3,534
test multiple dmxs explicit indices
import logging import os import pytest import io import pytest import astropy.units as u import numpy as np import pint.toa as toa from pint import residuals from pint.models import model_builder as mb from pint.models import get_model import pint.simulation from pinttestdata import datadir par = """ PSR J1234+5678...
3,535
visit default
# # This source file is part of the EdgeDB open source project. # # Copyright 2019-present MagicStack Inc. and the EdgeDB authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http...
3,536
stop fg server
# # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio. # # SPDX-License-Identifier: GPL-3.0-or-later # ############################################################################### # Imports ############################################################################### from argparse i...
3,537
test filter
# # 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 us...
3,538
training step
from abc import ABC, abstractmethod from typing import Any, Callable, Dict, List, Optional, Union import torch from coati.experience_maker import Experience, ExperienceMaker from coati.replay_buffer import ReplayBuffer from torch import Tensor from torch.utils.data import DistributedSampler from tqdm import tqdm from...
3,539
handle
"""Module for the custom Django loadtopics command.""" import os.path from django.core.management.base import BaseCommand from django.conf import settings from utils.BaseLoader import BaseLoader from utils.LoaderFactory import LoaderFactory from utils.errors.MissingRequiredFieldError import MissingRequiredFieldError ...
3,540
can loopback
#!/usr/bin/env python3 import os import time import contextlib import random from termcolor import cprint from panda import Panda, PandaJungle NUM_PANDAS_PER_TEST = 1 FOR_RELEASE_BUILDS = os.getenv("RELEASE") is not None # Release builds do not have ALLOUTPUT mode BUS_SPEEDS = [125, 500, 1000] ###############...
3,541
get internet gateway rule
# 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...
3,542
partition
# ******************************************************************************** # # Inviwo - Interactive Visualization Workshop # # Copyright (c) 2013-2023 Inviwo Foundation # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the f...
3,543
test rank 2d max
from functools import partial import numpy as np import scipy.stats from hypothesis import given from static_frame.core.rank import rank_1d from static_frame.core.rank import rank_2d from static_frame.test.property import strategies as sfst from static_frame.test.test_case import TestCase rankdata = partial(scipy.st...
3,544
test oidc only mixin oidc disabled debug
import logging import pytest from django.core.exceptions import ImproperlyConfigured from django.http import HttpResponse from django.test import RequestFactory, TestCase from django.views.generic import View from oauthlib.oauth2 import Server from oauth2_provider.oauth2_backends import OAuthLibCore from oauth2_provi...
3,545
default power sink
# # ISC License # # Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all...
3,546
run
import os import tempfile from contextlib import closing from xml.etree.ElementTree import Element as xml_el, \ SubElement as xml_sub, \ tostringlist as xml_dump from e3.os.fs import which from e3.fs import rm from e3.os.process import Run ALL_MESSAGES = "abcdefghijklmnopqrstuvwxyz" + \ "ABCDEFGHIJKLMNOPQR...
3,547
get name
############################################################################# # # Component contains an implementation of SONiC Platform Base API and # provides the components firmware management function # ############################################################################# try: import subprocess fro...
3,548
lg exists
import os import logging import pkg_resources from urllib.parse import urlparse from dlg import common from dlg.clients import CompositeManagerClient from dlg.common.reproducibility.reproducibility import init_lg_repro_data, init_lgt_repro_data, \ init_pgt_unroll_repro_data, init_pgt_partition_repro_data from dlg....
3,549
translate netinfo bond
# SPDX-FileCopyrightText: Red Hat, Inc. # SPDX-License-Identifier: GPL-2.0-or-later from __future__ import absolute_import from __future__ import division import copy import six from vdsm.network.link.bond import sysfs_options from vdsm.network.link.bond import sysfs_options_mapper as bond_opts_mapper from vdsm.netwo...
3,550
import root
# coding: utf-8 """ ROOT-related utilities. """ __all__ = ["import_ROOT", "hadd_task"] import os import six from law.target.local import LocalFileTarget, LocalDirectoryTarget from law.util import map_verbose, make_list, interruptable_popen, human_bytes, quote_cmd _ROOT = None def METHOD_NAME(batch=True, ignor...
3,551
input flow change pin
# This file is part of the Trezor project. # # Copyright (C) 2012-2019 SatoshiLabs and contributors # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License version 3 # as published by the Free Software Foundation. # # This library is distrib...
3,552
gather metrics files by nick
""" Tool for metrics files visualization. Expects metrics files in format <node nickname>.<date>_<time>.metrics like Primary.20230804_182932.metrics Works with metrics collected by heapWatch.py. Example usage for local net: python3 ./test/heapwatch/heapWatch.py --period 10 --metrics --blockinfo --runtime 20m -o nodeda...
3,553
test check permission
def METHOD_NAME(): """Code (in Zope packages) often uses zope.security.management.checkPermission to determine whether the current user has a certain permission in a given context. Five inserts its own interaction that assures that such calls still work. >>> configure_zcml = ''' ... <co...
3,554
start edd
# # fcoe.py - fcoe class # # Copyright (C) 2009 Red Hat, Inc. All rights reserved. # # 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 ...
3,555
test overlap
#!/usr/bin/env python from math import pi import numpy as np from numpy.linalg import norm import openmc import openmc.model import pytest import scipy.spatial _RADIUS = 0.1 _PACKING_FRACTION = 0.35 _PARAMS = [ {'shape': 'rectangular_prism', 'volume': 1**3}, {'shape': 'x_cylinder', 'volume': 1*pi*1**2}, ...
3,556
initialize peer connection metrics
# Copyright 2021 Hathor Labs # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
3,557
load dictionary
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, so...
3,558
is route decorator
import ast import re from typing import Dict, List, Tuple, TypedDict ROUTE_HTTP_METHODS = ["get", "post", "put", "delete"] class RouteArgEntry(TypedDict): locations: List[Tuple[int, int]] seen: bool class UnknownParamKey(Exception): pass def is_api_expect_decorator(decorator: ast.Call): return is...
3,559
from scheduler constructor args
# 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...
3,560
parse args
# 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...
3,561
test blocked
"""Test praw.models.user.""" import prawcore.exceptions import pytest from praw.exceptions import RedditAPIException from praw.models import Multireddit, Redditor, Submission, Subreddit from .. import IntegrationTest class TestUser(IntegrationTest): def METHOD_NAME(self, reddit): reddit.read_only = Fal...
3,562
triangle
from .TetrahedronQuadrature import TetrahedronMesh from .TriangleQuadrature import TriangleQuadrature from .GaussLegendreQuadrature import GaussLegendreQuadrature class DartMeshIntegralAlg(): '''! @brief DartMesh 上的函数的积分 ''' def __init__(self, mesh, q): self.q = q self.mesh = mesh ...
3,563
remove export
#!/usr/bin/env python3 # # Tests for qmp command nbd-server-remove. # # Copyright (c) 2017 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 ...
3,564
tear down
"""Tests for distutils.dir_util.""" import unittest import os import stat import shutil import sys from distutils.dir_util import (mkpath, remove_tree, create_tree, copy_tree, ensure_relative) from distutils import log from distutils.tests import support from test.test_support import r...
3,565
test get set reset catalog
""" integration tests for mac_softwareupdate """ import pytest from tests.support.case import ModuleCase @pytest.mark.skip_if_not_root @pytest.mark.skip_if_binaries_missing("softwareupdate") @pytest.mark.skip_unless_on_darwin class MacSoftwareUpdateModuleTest(ModuleCase): """ Validate the mac_softwareupdate...
3,566
checkbox
from random import choice from django.shortcuts import get_object_or_404, render from django.urls import reverse from django.utils.lorem_ipsum import words from django.views.generic.base import TemplateView from django_filters.views import FilterView from django_tables2 import MultiTableMixin, RequestConfig, SingleTa...
3,567
fixture expected grid
""" Test pygmt.grdfill. """ from pathlib import Path import numpy as np import pytest import xarray as xr from packaging.version import Version from pygmt import __gmt_version__, grdfill, load_dataarray from pygmt.exceptions import GMTInvalidInput from pygmt.helpers import GMTTempFile from pygmt.helpers.testing import...
3,568
scrub event
import re from typing import Any, Dict, List, Union from tribler.core.sentry_reporter.sentry_reporter import ( BREADCRUMBS, RELEASE, ) from tribler.core.sentry_reporter.sentry_tools import delete_item, format_version, modify_value, \ obfuscate_string class SentryScrubber: """This class has been creat...
3,569
replay recording
"""Pen recording operations that can be accessed or replayed.""" from fontTools.pens.basePen import AbstractPen, DecomposingPen from fontTools.pens.pointPen import AbstractPointPen __all__ = [ "replayRecording", "RecordingPen", "DecomposingRecordingPen", "RecordingPointPen", ] def METHOD_NAME(record...
3,570
offset
# # The Python Imaging Library. # $Id$ # # standard channel operations # # History: # 1996-03-24 fl Created # 1996-08-13 fl Added logical operations (for "1" images) # 2000-10-12 fl Added offset method (from Image.py) # # Copyright (c) 1997-2000 by Secret Labs AB # Copyright (c) 1996-2000 by Fredrik Lundh # # See...
3,571
convert key and value
# Copyright 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://aws.amazon.com/apache2.0/ # # or in the "license" file accompan...
3,572
migrate async
__author__ = "Andre Merzky" __copyright__ = "Copyright 2012-2013, The SAGA Project" __license__ = "MIT" """ Provides the SAGA Job CPI """ from ..decorators import CPI_SYNC_CALL as SYNC from ..decorators import CPI_ASYNC_CALL as ASYNC from ..base import CPIBase from ..sasync import Async class Job ...
3,573
n slots
from collections import OrderedDict from asyncio import Semaphore from asyncio import QueueFull from asyncio import Event from .utils import req_str from .utils.stream import ProgressStream from logging import getLogger log = getLogger(__name__) class Pool: def __init__(self, METHOD_NAME): self._n_...
3,574
test results response
from stix_shifter_modules.qradar.entry_point import EntryPoint from stix_shifter_utils.modules.base.stix_transmission.base_status_connector import Status from stix_shifter.stix_transmission import stix_transmission from stix_shifter.stix_transmission.stix_transmission import run_in_thread from tests.utils.async_utils i...
3,575
test write arrow in stream
from pathlib import Path import io import threading import pytest import fsspec.implementations.memory import vaex.file import vaex.file.asyncio import pyarrow as pa import time def test_parse(): fs, path = vaex.file.parse('s3://vaex/testing/xys.hdf5?anonymous=true') assert fs is not None fs, path = vaex...
3,576
can view
"""""" from __future__ import annotations from flask import Flask, current_app from flask_login import current_user from abilian.core.models import attachment as attachments from abilian.services.security import READ, WRITE, security from abilian.web import url_for from .forms import AttachmentForm from .views impo...
3,577
build
from conan import ConanFile from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir, rename from conan.tools.METHOD_NAME import cross_building from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout import os required_conan_version = ">=1.53.0" class Libd...
3,578
category
from uuid import UUID import pytest from fastapi.testclient import TestClient from mealie.repos.all_repositories import AllRepositories from mealie.schema.meal_plan.plan_rules import PlanRulesOut, PlanRulesSave from mealie.schema.recipe.recipe import RecipeCategory from mealie.schema.recipe.recipe_category import Cat...
3,579
get body
from zerver.lib.test_classes import WebhookTestCase class WordPressHookTests(WebhookTestCase): STREAM_NAME = "wordpress" URL_TEMPLATE = "/api/v1/external/wordpress?api_key={api_key}&stream={stream}" WEBHOOK_DIR_NAME = "wordpress" def test_publish_post(self) -> None: expected_topic = "WordPres...
3,580
build hidden layer
import dgl import torch as th import torch.nn as nn class BaseRGCN(nn.Module): def __init__( self, num_nodes, h_dim, out_dim, num_rels, num_bases, num_hidden_layers=1, dropout=0, use_self_loop=False, use_cuda=False, ): sup...
3,581
test doc read access
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: MIT. See LICENSE import frappe from frappe.core.doctype.doctype.doctype import clear_permissions_cache from frappe.model.db_query import DatabaseQuery from frappe.permissions import add_permission, reset_perms from frappe.tests.utils import...
3,582
name
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
3,583
defaultconfig
# -*- coding: utf-8 -*- # # Copyright (c) 2009- Spyder Project Contributors # Distributed under the terms of the MIT License # (see spyder/__init__.py for details) """Tests for the `spyder.config`.""" # Standard library imports import os # Third party imports import pytest # Local imports from spyder.config.base im...
3,584
get serializer field class
import inspect from collections import OrderedDict from django.forms import TypedChoiceField from rest_framework import serializers from hypha.apply.review.fields import ScoredAnswerField from hypha.apply.stream_forms.forms import BlockFieldWrapper from .review.fields import ScoredAnswerListField IGNORE_ARGS = ['se...
3,585
conv forward
# 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 torch import torch.nn.functional as F from torch.nn.modules.conv import _ConvNd from torch.nn.modules.utils import _pair from ..ops im...
3,586
set up
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt import frappe from frappe.tests.utils import FrappeTestCase from frappe.utils import add_days, add_months, today from hrms.hr.doctype.attendance_request.test_attendance_request import get_employee from hrms.hr.doctype.leave_applica...
3,587
get sdk output
# 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...
3,588
patch app call
import os import molten from ddtrace.internal.constants import COMPONENT from ddtrace.internal.schema.span_attribute_schema import SpanDirection from ddtrace.vendor import wrapt from ddtrace.vendor.wrapt import wrap_function_wrapper as _w from .. import trace_utils from ... import Pin from ... import config from ......
3,589
visit join aggregated measures by groupby columns
"""This module helps to figure out the computational cost for executing a dataflow plan. There may be multiple possible dataflow plans to realize a set of measures and dimensions (or rather any set of metric definition instances) because data sets could include an overlapping set of measures and dimensions. Knowing t...
3,590
get abbreviations
# Copyright (C) 2011 Chris Dekter # Copyright (C) 2019-2020 Thomas Hess <thomas.hess@udo.edu> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your opt...
3,591
get categories
# 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, ...
3,592
create cmake module alias targets
from conan import ConanFile from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir, save from conan.tools.scm import Version from conan.tools.build import check_min_cppstd from conan.errors import Con...
3,593
writerow
import asyncio import filecmp import logging import os import pickle import tempfile import warnings import re from asyncio import AbstractEventLoop from pathlib import Path from typing import Text, Any, Union, List, Type, Callable, TYPE_CHECKING, Pattern from typing_extensions import Protocol import rasa.shared.const...
3,594
arch dirname vfd
""" Windows virtio-win utilities """ import re import logging from . import drive from . import system from avocado.core import exceptions ARCH_MAP_ISO = {"32-bit": "x86", "64-bit": "amd64"} ARCH_MAP_VFD = {"32-bit": "i386", "64-bit": "amd64"} LOG = logging.getLogger('avocado.' + __name__) def arch_dirname_iso(s...
3,595
test permutation randomness
import unittest import numpy import pytest import cupy from cupy import testing from cupy.testing import _condition @testing.parameterize( {'seed': None}, {'seed': 0}, ) class TestPermutations(unittest.TestCase): def _xp_random(self, xp): if self.seed is None: return xp.random ...
3,596
write changes
from changelog.git import stage_file from changelog.util import load_all_released_changes, load_unreleased_changes, version_cmp from functools import cmp_to_key from operator import attrgetter class ChangelogWriter(object): """ Writes ReleaseChanges objects to a file using the following format: # __VERSIO...
3,597
pandas
""" This is a template for creating custom ColumnMapExpectations. For detailed instructions on how to use it, please see: https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations """ from typing import Optional import coinaddrvalidator fr...
3,598
download file
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
3,599
section volume
# Copyright (c) 2020, Ecole Polytechnique Federale de Lausanne, Blue Brain Project # All rights reserved. # # This file is part of NeuroM <https://github.com/BlueBrain/NeuroM> # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are ...