id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
13,300
test scale vector col vector
import numpy as np import pytest import mbuild as mb from mbuild.tests.base_test import BaseTest class TestPattern(BaseTest): def test_apply_to_compound(self, betacristobalite, propyl, ch3): pattern = mb.Random2DPattern(90) chains, backfills = pattern.apply_to_compound( guest=propyl, ...
13,301
test generate unique username
# -*- coding: utf-8 -*- from __future__ import unicode_literals import json import requests from datetime import date, datetime import django from django.core.files.base import ContentFile from django.db import models from django.test import RequestFactory, TestCase from django.utils.http import base36_to_int, int_to...
13,302
test import valid metadata
from unittest.mock import patch from django.test import TestCase import vcr from data_refinery_common.models import ( Contribution, Experiment, ExperimentSampleAssociation, OntologyTerm, Sample, SampleAttribute, ) from data_refinery_foreman.foreman.management.commands.import_external_sample_a...
13,303
test dictionary entries completions 2 a
def test_dictionary_entries_completions_1(workspace, libspec_manager, data_regression): from robotframework_ls.impl.completion_context import CompletionContext from robotframework_ls.impl import dictionary_completions workspace.set_root("case2", libspec_manager=libspec_manager) doc = workspace.put_doc(...
13,304
finalize
# Copyright (c) 2023 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...
13,305
traverse unconditional states
# Copyright 2019-2022 ETH Zurich and the DaCe authors. All rights reserved. from typing import Dict, Iterator, Optional, Set, Tuple from dace import SDFG, SDFGState, data, properties from dace.sdfg import nodes from dace.sdfg import utils as sdutil from dace.transformation import pass_pipeline as ppl @properties.ma...
13,306
error format
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
13,307
test dense no bounds
import numpy as np from numpy.linalg import lstsq from numpy.testing import assert_allclose, assert_equal, assert_ from scipy.sparse import rand from scipy.sparse.linalg import aslinearoperator from scipy.optimize import lsq_linear A = np.array([ [0.171, -0.057], [-0.049, -0.248], [-0.166, 0.054], ]) b =...
13,308
test build
################################################################################# # WaterTAP Copyright (c) 2020-2023, The Regents of the University of California, # through Lawrence Berkeley National Laboratory, Oak Ridge National Laboratory, # National Renewable Energy Laboratory, and National Energy Technology # Labo...
13,309
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...
13,310
create wrapper
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import subprocess import tempfile import mmengine import pytest import torch import torch.nn as nn from mmdeploy.utils.constants import Backend from mmdeploy.utils.test import check_backend onnx_file = tempfile.NamedTemporaryFile(suffix='.onnx').n...
13,311
peering service prefix key
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities __all__ ...
13,312
properties
# 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...
13,313
write doc
"""Machinery for documenting traitlets config options with Sphinx. This includes: - A Sphinx extension defining directives and roles for config options. - A function to generate an rst file given an Application instance. To make this documentation, first set this module as an extension in Sphinx's conf.py:: ext...
13,314
suppress warning class
# 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, ...
13,315
reset output buffer
import numpy as np import rospy import serial from std_srvs.srv import SetBool, SetBoolResponse from . import constants class NoopSerial(serial.Serial): """ Inherits from serial.Serial, doing nothing for each function. Allows super classes to implement custom behavior for simulating serial devices. ...
13,316
do transformation
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2022 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 # # Unl...
13,317
toggle debug
#!/usr/bin/env python import sys from direct.showbase.ShowBase import ShowBase from direct.showbase.InputStateGlobal import inputState from direct.interval.MetaInterval import Sequence from direct.interval.MetaInterval import Parallel from direct.interval.LerpInterval import LerpFunc from direct.interval.FunctionInte...
13,318
save param
# Copyright (c) 2019 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...
13,319
gen inject mat hadamard
from psyneulink.core import llvm as pnlvm __all__ = ["gen_inject_vec_binop", "gen_inject_vec_add", "gen_inject_vec_sub", "gen_inject_vec_hadamard", "gen_inject_mat_binop", "gen_inject_mat_add", "gen_inject_mat_sub", "gen_inject_mat_hadamard",...
13,320
tfgather
# 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...
13,321
create data multivariate
# -*- coding: utf-8 -*- import os import numpy as np import pytest import pysteps from pysteps.timeseries import autoregression, correlation pytest.importorskip("pyproj") def test_estimate_ar_params_ols(): R = _create_data_univariate() for p in range(1, 4): phi = autoregression.estimate_ar_params...
13,322
decorating function
""" The cache module handles caching of expensive function calls. Based on Raymond Hettinger's backport of lru_cache The difference is _HashedSeq has been modified to use a custom hash function. http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/ """ from collections.abc import ...
13,323
hpd interval scalar
# Copyright (C) 2016 Jolien Creighton # (C) 2021 Jolien Creighton & Thomas Dent # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option)...
13,324
get build data
# 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...
13,325
join network
#!/usr/bin/env python3 # Copyright (c) 2014-2016 The Bitcoin Core developers # Copyright (c) 2016-2022 The Zcash developers # Distributed under the MIT software license, see the accompanying # file COPYING or https://www.opensource.org/licenses/mit-license.php . # Base class for RPC testing import logging import optp...
13,326
test output kwargs type
import pytest from janitor import io from pathlib import Path from openpyxl import load_workbook from pandas.testing import assert_series_equal TEST_DATA_DIR = "tests/test_data" filename = Path(TEST_DATA_DIR).joinpath("worked-examples.xlsx").resolve() wb = load_workbook(filename) wb_c = load_workbook(filename, rea...
13,327
register packages
from __future__ import annotations import click from commodore.config import Config from commodore.component import Component, component_dir from commodore.helpers import relsymlink from commodore.package import Package, package_dependency_dir from .component_library import validate_component_library_name from .disc...
13,328
test password reset url only available via
from django.core import mail from django.urls import reverse, reverse_lazy from django.utils.translation import gettext_lazy as _ from webtest import AppError from oscar.core.compat import get_user_model from oscar.core.loading import get_model from oscar.test.factories import ProductAlertFactory, UserFactory from osc...
13,329
update tag for image type
#!/usr/bin/env python3 """ Fetch the latest official Ubuntu AMIs that we hardcode into our system. This can update all *_master_ami and *_bastion_ami tags in bumpenvs.yaml file. This can also update the environments-packer.json in the environments repo. """ import argparse import json import re import sys from typi...
13,330
run
""" Copyright (c) 2017 Red Hat, Inc All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. """ from atomic_reactor.plugin import Plugin from atomic_reactor.util import map_to_user_params, graceful_chain_get from osbs.utils import ImageNa...
13,331
handle
from django.core.management.base import BaseCommand, CommandError from django.template.loader import render_to_string class Command(BaseCommand): """ Transcript PDFs generator for corp. Usage: python manage.py generate_transcript_pdfs <id> example: python manage.py generate_tran...
13,332
bw silverman
import numpy as np from scipy.stats import scoreatpercentile from statsmodels.compat.pandas import Substitution from statsmodels.sandbox.nonparametric import kernels def _select_sigma(x, percentile=25): """ Returns the smaller of std(X, ddof=1) or normalized IQR(X) over axis 0. References ----------...
13,333
value
# 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...
13,334
check
import asyncio import contextlib from datetime import datetime from typing import Any, Dict import aiohttp import discord from redbot.core import __version__ as red_version from redbot.core import commands from redbot.core.bot import Red from redbot.core.utils.menus import DEFAULT_CONTROLS, close_menu, menu from .iso...
13,335
test output
#!/usr/bin/env python # # Copyright (c) Greenplum Inc 2010. All Rights Reserved. # # # THIS IMPORT MUST COME FIRST # import mainUtils FIRST to get python version check # from qautils.gppylib.mainUtils import * import os, sys, traceback gProgramName = os.path.split(sys.argv[0])[-1] from qautils.gppylib.commands.base i...
13,336
test serialize scaler
import json import os import shutil import sys import tempfile import numpy as np import pytest from sklearn import preprocessing from sklearn.preprocessing import StandardScaler from sklearn.model_selection import GridSearchCV from sklearn.neural_network import MLPClassifier from sklearn.preprocessing import LabelBin...
13,337
jax cosine warmup
"""Submission file for a LAMB optimizer with warmup+cosine LR in Jax.""" import functools from typing import Dict, Iterator, List, Tuple from flax import jax_utils import jax from jax import lax import jax.numpy as jnp import optax from algorithmic_efficiency import spec _GRAD_CLIP_EPS = 1e-6 def scale_by_learnin...
13,338
exe changed
#!/usr/bin/env python3 #* This file is part of the MOOSE framework #* https://www.mooseframework.org #* #* All rights reserved, see COPYRIGHT for full restrictions #* https://github.com/idaholab/moose/blob/master/COPYRIGHT #* #* Licensed under LGPL 2.1, please see LICENSE for details #* https://www.gnu.org/licenses/lgp...
13,339
rule to template
# Copyright 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
13,340
load checkpoint
import json import logging import os import pathlib import re from copy import deepcopy from pathlib import Path from typing import Optional, Tuple import torch from .model import CLIP, convert_weights_to_fp16, resize_pos_embed from .openai import load_openai_model from .pretrained import get_pretrained_url, download...
13,341
mag
# Functional Layers # ================= # # Reflectometry layers can be arbitrary functions. This is a rather # arbitrary example, with a sinusoidal nuclear profile and an exponential # magnetic profile. A simulated dataset is generated from the model. import numpy as np from numpy import sin, pi, log, exp, hstack f...
13,342
test own tokens listing
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (c) 2021-present Kaleidos Ventures SL from django.urls import reverse from taiga....
13,343
test sample from datasets
# 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...
13,344
compile fn
# -*- coding: utf-8 -*- from mathics.core.atoms import Number, Real from mathics.core.builtin import check_requires_list from mathics.core.convert.function import expression_to_callable_and_args from mathics.core.evaluation import Evaluation from mathics.core.expression import Expression from mathics.core.systemsymbols...
13,345
skip when service backend in azure
from typing import Callable, TypeVar from typing_extensions import ParamSpec import os from timeit import default_timer as timer import unittest import pytest from hailtop.hail_decorator import decorator from hail.utils.java import choose_backend import hail as hl GCS_REQUESTER_PAYS_PROJECT = os.environ.get('GCS_REQ...
13,346
lower is better
# Released under the MIT License. See LICENSE for details. # """Functionality related to game results.""" from __future__ import annotations import copy import weakref from dataclasses import dataclass from typing import TYPE_CHECKING from efro.util import asserttype import babase from bascenev1._team import Team, S...
13,347
raw dispatch table
import re import torch._C as C """ PythonDispatcher class is a thin python-binding to C++ dispatcher and it is designed to show how dispatcher precompute works. In particular, it shows for a certain op `foo`, what the computed dispatch table looks like after user register their kernels to certains dispatch keys. In...
13,348
determine action type
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ from ._models import ( DetectLanguageInput, TextDocumentInput, _AnalyzeActionsType, ) def _validate_input(documents, hint, whole_input_hint): """Vali...
13,349
test empty values are not serialized
# 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...
13,350
test parse
############################################################################## # Copyright 2009, Gerhard Weis # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code ...
13,351
is default
# 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...
13,352
test stderr is redirected
import os import subprocess from pathlib import Path from unittest.mock import ANY import pytest def test_call(mock_sub, sub_stream_kw, sleep_zero, capsys): """A simple call will be invoked.""" with mock_sub.tools.input.wait_bar(): mock_sub.run(["hello", "world"]) mock_sub._subprocess.Popen.ass...
13,353
parse package
# Copyright (C) 2018-2019 Dmitry Marakasov <amdmi3@amdmi3.ru> # # This file is part of repology # # repology 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 optio...
13,354
ignore
# This example requires the 'members' privileged intent to use the Member converter. # This example also requires the 'message_content' privileged intent to function. import traceback import typing import discord from discord.ext import commands intents = discord.Intents.default() intents.members = True intents.mess...
13,355
discard
# Access WeakSet through the weakref module. # This code is separated-out because it is needed # by abc.py to load everything else at startup. from _weakref import ref from types import GenericAlias __all__ = ['WeakSet'] class _IterationGuard: # This context manager registers itself in the current iterators of ...
13,356
test collect change paths
import json import pathlib from copy import deepcopy import pytest from fontra.core.changes import ( applyChange, collectChangePaths, filterChangePattern, matchChangePattern, patternDifference, patternFromPath, patternIntersect, patternUnion, ) def getTestData(fileName): path = p...
13,357
test move squeeze after sigmoid
import imp import os import unittest import numpy as np import tensorflow as tf import yaml from numpy.core.fromnumeric import squeeze from tensorflow.compat.v1 import graph_util from neural_compressor.adaptor.tf_utils.util import disable_random def build_fake_yaml(): fake_yaml = """ model: na...
13,358
get all instances
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import gzip import json import logging import os import unittest import uuid from c7n.config import Bag from c7n.testing import TestUtils, TextTestIO, functional # NOQA from .zpill import PillTest, ACCOUNT_ID logging.getLogger("placebo.p...
13,359
delete
from braintree.successful_result import SuccessfulResult from braintree.error_result import ErrorResult from braintree.resource import Resource from braintree.configuration import Configuration class Address(Resource): """ A class representing Braintree Address objects. An example of creating an address w...
13,360
test 0000
#!/usr/bin/env python # # Copyright 2012-2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr, gr_unittest, fft, filter, blocks, analog import math import cmath def sig_source_c(samp_rate, freq, amp, N): t = [float(x) / ...
13,361
load data list
# Copyright (c) OpenMMLab. All rights reserved. from typing import Any, Callable, List, Optional, Sequence, Tuple, Union import mmcv from mmengine.dataset import BaseDataset from mmocr.registry import DATASETS @DATASETS.register_module() class RecogLMDBDataset(BaseDataset): r"""RecogLMDBDataset for text recogni...
13,362
make learner
# Copyright 2018 DeepMind Technologies Limited. 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 ...
13,363
power on
""" # Copyright (C) 1994-2021 Altair Engineering, Inc. # For more information, contact Altair at www.altair.com. # # This file is part of both the OpenPBS software ("OpenPBS") # and the PBS Professional ("PBS Pro") software. # # Open Source License Information: # # OpenPBS is free software. You can redistribute it an...
13,364
transform
import os import sys from difflib import unified_diff from typing import Dict try: import rich_click as click except ImportError: # Fails on vendored-in LSP plugin import click from robot.api import get_model from robot.errors import DataError from robotidy import utils from robotidy.config import MainConfi...
13,365
test target from cli error target not
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
13,366
test crowding distance
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import random import numpy as np import nevergrad as ng import nevergrad.common.typing as tp from nevergrad.parametrization import parameter...
13,367
deleted configstore output format
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
13,368
test read write p2 mesh
# Copyright (C) 2012-2020 Garth N. Wells and Jørgen S. Dokken # # This file is part of DOLFINx (https://www.fenicsproject.org) # # SPDX-License-Identifier: LGPL-3.0-or-later from pathlib import Path import numpy as np import pytest from dolfinx.io import XDMFFile from dolfinx.io.gmshio import cell_perm_array, ufl_...
13,369
mk a
# This file is part of the Open Data Cube, see https://opendatacube.org for more information # # Copyright (c) 2015-2023 ODC Contributors # SPDX-License-Identifier: Apache-2.0 import numpy as np from affine import Affine from typing import Callable, Union, Tuple import warnings from datacube.utils.geometry import ( ...
13,370
process
import json import treq from twisted.web.http_headers import Headers from twisted.logger import Logger from twisted.internet.error import ConnectError from autopush.constants import DEFAULT_ROUTER_TIMEOUT from autopush.exceptions import RouterException class GCMAuthenticationError(Exception): pass class Resul...
13,371
metadata
"""Admin request context class. A request context provided by the admin server to admin route handlers. """ from typing import Mapping, Optional, Type from ..core.profile import Profile, ProfileSession from ..config.injector import Injector, InjectionError, InjectType from ..config.injection_context import Injection...
13,372
check and get bufsize
#!/usr/bin/env python3 # Copyright (C) 2017 Alexandre Abadie <alexandre.abadie@inria.fr> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import sys import os from testrunner import run EXPECTED_...
13,373
test inplace change control points
try: from . import common as c except BaseException: import common as c class InplaceModificationTest(c.unittest.TestCase): def test_inplace_change_degrees(self): """inplace change of degrees should not be allowed if core spline is initialized""" z = c.dict_bezier_2p2d() r ...
13,374
test build
# coding=utf-8 # Copyright 2020 The TF-Agents 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 la...
13,375
test get single pages with cb
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
13,376
system data
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
13,377
max addr
import logging import time from archinfo.arch_soot import ArchSoot, SootAddressDescriptor, SootMethodDescriptor from cle.backends.backend import Backend from cle.errors import CLEError try: import pysoot from pysoot.lifter import Lifter except ImportError: pysoot = None Lifter = None log = logging.g...
13,378
on init
import json import time from pytest import approx from dash import Dash, Input, State, Output, dcc, html from dash.exceptions import PreventUpdate import dash.testing.wait as wait def test_stcp001_clear_data_on_all_types(store_app, dash_dcc): dash_dcc.start_server(store_app) assert dash_dcc.wait_for_contains...
13,379
get nsp profile output
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities __all__ =...
13,380
show image
import json import cv2 import base64 import threading import time from datetime import datetime from websocket_server import WebsocketServer import os # Graphical User Interface Class class GUI: # Initialization function # The actual initialization def __init__(self, host): t = threading.Thread(ta...
13,381
test indices negative
# Copyright 2021-2022 NVIDIA 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 ...
13,382
to code
import binascii import esphome.codegen as cg import esphome.config_validation as cv from esphome.components import modbus from esphome.const import CONF_ADDRESS, CONF_ID, CONF_NAME, CONF_LAMBDA, CONF_OFFSET from esphome.cpp_helpers import logging from .const import ( CONF_BITMASK, CONF_BYTE_OFFSET, CONF_COM...
13,383
set index data
# The PEP 484 type hints stub file for the QtQuick3D module. # # Generated by SIP 6.4.0 # # Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> # # This file is part of PyQt5. # # This file may be used under the terms of the GNU General Public License # version 3.0 as published by the Free So...
13,384
test returned connections have moler integrated connection
# -*- coding: utf-8 -*- """ Testing factory responsible for returning "requested" connection """ __author__ = 'Grzegorz Latuszek, Michal Ernst' __copyright__ = 'Copyright (C) 2018, Nokia' __email__ = 'grzegorz.latuszek@nokia.com, michal.ernst@nokia.com' import pytest import mock def test_missing_constructor_raises_...
13,385
async generator
# -*- coding: utf-8 -*- # Copyright 2023 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
13,386
parse descriptions
#!/usr/bin/env python3 import argparse import enum import json import os.path import re import urllib.request DOC_URL_BASE = "https://raw.githubusercontent.com/mist64/c64ref/4274bd8782c5d3b18c68e6b9479b0ec751eb96b1/Source/6502/" doc_files = {f"{DOC_URL_BASE}{filename}":cpu_type for filename, cpu_type in { "cpu_65...
13,387
user storage key
# 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...
13,388
test deprecation warning
# 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...
13,389
test should print sq l drop and
# -*- coding: utf-8 -*- from io import StringIO from django.core.management import CommandError, call_command from django.test import TestCase from django.test.utils import override_settings from unittest.mock import patch MYSQL_DATABASE_SETTINGS = { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'dbatabase'...
13,390
va to fileoffset
# MIT License # # Copyright (c) 2017 Jason Reaves # Copyright (c) 2019 Graham Austin # # 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 ri...
13,391
test freq ir
import unittest import torch import torchaudio.prototype.functional as F from parameterized import parameterized from torchaudio_unittest.common_utils import skipIfNoRIR, TestBaseMixin, torch_script class TorchScriptConsistencyTestImpl(TestBaseMixin): def _assert_consistency(self, func, inputs, shape_only=False)...
13,392
plugin
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Jan-Piet Mens <jpmens()gmail.com>' __copyright__ = 'Copyright 2014-2019 Jan-Piet Mens' __license__ = 'Eclipse Public License - v 1.0 (http://www.eclipse.org/legal/epl-v10.html)' # The code for pushover() between cuts was written by Mike Matz and # grace...
13,393
forward
# Owner(s): ["module: unknown"] import logging from torch import nn from torch.ao.pruning.sparsifier import utils from torch.nn.utils import parametrize import torch from torch.testing._internal.common_utils import TestCase logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=lo...
13,394
test gte
import pytest from sqlalchemy_utils import Ltree class TestLtree: def test_init(self): assert Ltree('path.path') == Ltree(Ltree('path.path')) def test_constructor_with_wrong_type(self): with pytest.raises(TypeError) as e: Ltree(None) assert str(e.value) == ( "...
13,395
mock nlg endpoint
import asyncio from unittest.mock import MagicMock import pytest from rasa.core.actions.action import ActionBotResponse from rasa.core.channels import CollectingOutputChannel from rasa.core.constants import DEFAULT_REQUEST_TIMEOUT from rasa.core.nlg import CallbackNaturalLanguageGenerator from rasa.core.nlg.callback ...
13,396
action2str
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports # # filegone Trace why file gone (deleted or renamed). # For Linux, uses BCC, eBPF. Embedded C. # # USAGE: filegone [-h] [-p PID] # # Licensed under the Apache License, Version 2.0 (the "License") # # 08-Nov-2022 Curu. modified from filelife ...
13,397
test task
from unittest.mock import Mock, patch import pytest from celery import chord, group from celery.app import builtins from celery.contrib.testing.mocks import ContextMock from celery.utils.functional import pass1 class BuiltinsCase: def setup_method(self): @self.app.task(shared=False) def xsum(x)...
13,398
basename
"""Pathname and path-related operations for the Macintosh.""" import os from stat import * import genericpath from genericpath import * __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","getctime", "islink",...
13,399
read mff events
# # License: BSD-3-Clause from datetime import datetime from glob import glob from os.path import basename, join, splitext from defusedxml.ElementTree import parse import numpy as np from ...utils import logger def _read_events(input_fname, info): """Read events for the record. Parameters ---------- ...