id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
13,800 | test sanity | # -*- coding: utf-8 -*-
import unittest
from includes import *
from common import *
from time import sleep
from RLTest import Env
import math
def testNumEntries(env):
env.skipOnCluster()
env.expect('ft.config', 'set', 'FORK_GC_CLEAN_THRESHOLD', 0).equal('OK')
env.expect('FT.CREATE', 'idx', 'SCHEMA', 'num', 'num... |
13,801 | set attr hci device | import asyncio
import functools
import logging
import bluepy.btle
import btlewrap
from btlewrap import BluetoothBackendException
from fhempy.lib.generic import FhemModule
from miflora import miflora_poller
from .. import fhem, utils
class miflora(FhemModule):
def __init__(self, logger):
super().__init__... |
13,802 | test display summary | from datetime import datetime, timedelta
from unittest.mock import MagicMock
import numpy as np
import pandas as pd
import pytest
from openbb_terminal.common.quantitative_analysis import qa_view
dates = [datetime.now() - timedelta(days=x) for x in range(45)]
nums = np.random.rand(45)
data = {"date": dates, "col2": n... |
13,803 | last modified by 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
__all__ =... |
13,804 | test open connection | import pytest
from ..tutils import Placeholder
from ..tutils import Playbook
from ..tutils import reply
from mitmproxy.proxy.commands import CloseConnection
from mitmproxy.proxy.commands import CloseTcpConnection
from mitmproxy.proxy.commands import OpenConnection
from mitmproxy.proxy.commands import SendData
from mit... |
13,805 | register | # 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,806 | transfer lstm | from test.test_beam_search import prepare, rnn_args
import chainer
import numpy
import pytest
import torch
import espnet.lm.chainer_backend.lm as lm_chainer
import espnet.nets.pytorch_backend.lm.default as lm_pytorch
from espnet.nets.beam_search import beam_search
from espnet.nets.lm_interface import dynamic_import_l... |
13,807 | test incompatible shapes | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
13,808 | sorted nicely | """ Common methods to normalize a string """
import re
import struct
from typing import Union, List, Iterable, Dict, Optional, Tuple
def convert(text: str) -> Union[str, int]:
"""Convert text to integer, if it is a digit."""
if text.isdigit():
return int(text)
return text
def alphanum_key(key: s... |
13,809 | test one different | # 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 :func:`iris.util.equalise_attributes` function.
"""
# import iris tests first so that some things can ... |
13,810 | test dont remove hidden test region | import os
import pytest
from textwrap import dedent
from traitlets.config import Config
from .base import BaseTestPreprocessor
from .. import create_code_cell, create_text_cell
from ...preprocessors import ClearHiddenTests
@pytest.fixture
def preprocessor():
return ClearHiddenTests()
class TestClearHiddenTest... |
13,811 | find scheduler id | # 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,812 | test lut not autodiscovered model unsupported | import voluptuous as vol
from homeassistant import data_entry_flow
from homeassistant.const import CONF_ENTITY_ID, STATE_ON
from homeassistant.core import HomeAssistant
from homeassistant.helpers.selector import SelectSelector
from custom_components.powercalc.config_flow import CONF_CONFIRM_AUTODISCOVERED_MODEL
from c... |
13,813 | get absolute minimum part size | ######################################################################
#
# File: b2sdk/v1/account_info.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
from __future__ import annota... |
13,814 | test typed tuple bad default | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Test trait types of the widget packages."""
import array
import datetime as dt
import pytest
from unittest import TestCase
from traitlets import HasTraits, Int, TraitError
from traitlets.tests.test_traitlets impor... |
13,815 | mock docs | from typing import Dict, Any
from unittest.mock import MagicMock, patch
import pytest
from haystack.preview import Pipeline, DeserializationError
from haystack.preview.testing.factory import document_store_class
from haystack.preview.components.retrievers.memory import MemoryRetriever
from haystack.preview.dataclasse... |
13,816 | api update transaction records | ################################################
# Authors: Markus Hofmeister (mh807@cam.ac.uk) #
# Date: 12 Oct 2022 #
################################################
from flask import Blueprint, request, jsonify
from agent.errorhandling.exceptions import InvalidInput
from agent.datai... |
13,817 | detach | import sys
from _typeshed import SupportsKeysAndGetItem
from _weakref import (
CallableProxyType as CallableProxyType,
ProxyType as ProxyType,
ReferenceType as ReferenceType,
getweakrefcount as getweakrefcount,
getweakrefs as getweakrefs,
proxy as proxy,
ref as ref,
)
from _weakrefset import... |
13,818 | linspace | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2021 Alibaba Group Holding 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-... |
13,819 | encrypt dict | # -*- coding: utf-8 -*-
import base64
import hashlib
import logging
from collections import namedtuple
from cryptography.fernet import Fernet, InvalidToken
from cryptography.hazmat.backends import default_backend
from django.utils.encoding import smart_str, smart_bytes
__all__ = ['get_encryption_key', 'encrypt_fiel... |
13,820 | check pair consistency | # SPDX-License-Identifier: BSD-3-Clause
# Copyright 2018-2021, Intel Corporation
import memoryoperations
from reorderexceptions import NotSupportedOperationException
class OperationFactory:
"""
An abstract memory operation factory.
This object factory puts special constraints on names of classes.
It... |
13,821 | get input tensor names | # Copyright 2020 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,822 | test ocm subscription labels get clusters | from collections.abc import (
Callable,
Iterable,
Sequence,
)
from unittest.mock import call
import pytest
from pytest_mock import MockerFixture
from reconcile.gql_definitions.ocm_subscription_labels.clusters import ClusterV1
from reconcile.ocm_subscription_labels.integration import (
ClusterStates,
... |
13,823 | forward | #!/usr/bin/env python3
import os
import random
import unittest
from math import exp, pi
import torch
from torch import optim
import gpytorch
from gpytorch.distributions import MultivariateNormal
from gpytorch.kernels import IndexKernel, RBFKernel
from gpytorch.likelihoods import GaussianLikelihood
from gpytorch.mean... |
13,824 | settings build | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.apple import fix_apple_shared_install_name
from conan.tools.build import cross_building
from conan.tools.env import VirtualBuildEnv, VirtualRunEnv
from conan.tools.files import copy, get, rm, rmdir
from conan.tools.gnu impor... |
13,825 | set up class | # 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 appli... |
13,826 | diff ter | from nbautoeval import Args, ExerciseFunction, PPrintCallRenderer, PPrintRenderer
# load all the data
import json
with open("data/marine-e2-ext.json") as feed:
extended_full = json.load(feed)
with open("data/marine-e2-abb.json") as feed:
abbreviated_full = json.load(feed)
from .exo_marine_dict import simpl... |
13,827 | isfile | #
# 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... |
13,828 | supports remote directories | import os.path
import sys
import time
from time import sleep
from typing import Dict, List, Optional
from thonny import ui_utils
from thonny.languages import tr
from thonny.plugins.micropython import (
BareMetalMicroPythonConfigPage,
BareMetalMicroPythonProxy,
add_micropython_backend,
)
from thonny.plugins... |
13,829 | test node pos features | """
Test for MXMNet Featurizer class.
"""
import deepchem as dc
import numpy as np
import unittest
edge_index = {
"C1=CC=NC=C1":
np.asarray([[0, 1, 1, 5, 5, 2, 2, 4, 4, 3, 3, 0],
[1, 0, 5, 1, 2, 5, 4, 2, 3, 4, 0, 3]]),
"CC(=O)C":
np.asarray([[0, 3, 3, 2, 3, 1], [3, 0, 2, 3,... |
13,830 | test rm | """
Test cases for salt.states.etcd_mod
Note: No functional tests are required as of now, as all of the
functional pieces are already tested in utils.test_etcd_utils
If the contents of this state were to add more logic besides
essentially acting as a wrapper, then functional tests would be required... |
13,831 | unyt to hashable single | """Miscellaneous helper methods for GMSO."""
from functools import lru_cache
import unyt as u
from unyt.exceptions import UnitConversionError
@lru_cache(maxsize=128)
def unyt_compare(units1, units2):
"""Check if two parameter values have the same units."""
units1 = list(units1)
units2 = list(units2)
... |
13,832 | run service command | import os
import uuid
import inspect
from setup_app import paths
from setup_app.utils import base
from setup_app.config import Config
from setup_app.utils.db_utils import dbUtils
from setup_app.utils.progress import jansProgress
from setup_app.utils.printVersion import get_war_info
class BaseInstaller:
needdb = T... |
13,833 | values | # Copyright 2023 The Flax 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 wri... |
13,834 | click stop | import tkinter as tk
from tkinter import ttk
from typing import TYPE_CHECKING, Optional
import grpc
from core.api.grpc.wrappers import MobilityAction, Node
from core.gui.dialogs.dialog import Dialog
from core.gui.images import ImageEnum
from core.gui.themes import PADX, PADY
if TYPE_CHECKING:
from core.gui.app i... |
13,835 | get all transactions | # 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... |
13,836 | num levels | # The MIT License (MIT)
# Copyright (c) 2022 by the xcube development team and contributors
#
# 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... |
13,837 | test y 1900 | """
Unittest for time.strftime
"""
import calendar
import sys
import re
from test import support
import time
import unittest
# helper functions
def fixasctime(s):
if s[8] == ' ':
s = s[:8] + '0' + s[9:]
return s
def escapestr(text, ampm):
"""
Escape text to deal with possible locale values t... |
13,838 | as lwp str | import sys
from _typeshed import StrPath
from collections.abc import Iterable, Iterator, Sequence
from http.client import HTTPResponse
from re import Pattern
from typing import ClassVar, TypeVar, overload
from urllib.request import Request
__all__ = [
"Cookie",
"CookieJar",
"CookiePolicy",
"DefaultCook... |
13,839 | set title | from __future__ import unicode_literals
import wx
import wx.adv
import paths
import languageHandler
import sys
import os
toolkit = "wx"
### Code responses for WX dialogs.
# this is when an user presses OK on a dialogue.
OK = wx.ID_OK
# This is when an user presses cancel on a dialogue.
CANCEL = wx.ID_CANCEL
# This... |
13,840 | get total discount from range | from dataclasses import dataclass
from decimal import Decimal
from typing import List, Optional
from prices import Money, MoneyRange, TaxedMoney, TaxedMoneyRange
from ...product.models import ProductChannelListing, ProductVariantChannelListing
from ...tax import TaxCalculationStrategy
from ...tax.calculations import ... |
13,841 | wrap train tuple | # Copyright 1999-2021 Alibaba Group Holding 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 a... |
13,842 | is debug enabled | # -*- coding: utf-8 -*-
# This file is part of the Calibre-Web (https://github.com/janeczku/calibre-web)
# Copyright (C) 2019 pwr
#
# 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, e... |
13,843 | get schema names | import json
import logging
import re
from typing import Any, Dict, List, Optional
from pydantic.class_validators import validator
from pydantic.fields import Field
# This import verifies that the dependencies are available.
from pyhive import hive # noqa: F401
from pyhive.sqlalchemy_hive import HiveDate, HiveDecimal... |
13,844 | cylinder edges | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
13,845 | add attempt | # check failed login attempts
# lockout user if more than 5 for 15 minutes, send system message
from castle.cms import cache
from castle.cms.utils import get_ip
from datetime import datetime
from plone import api
from plone.memoize.instance import memoize
from plone.registry.interfaces import IRegistry
from time import... |
13,846 | get stock ledger entries for batch bundle | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe import _
from frappe.utils import cint, flt, getdate
from frappe.utils.deprecations import deprecated
from pypika import functions as fn
from erpnext.stock.doctype.... |
13,847 | test cdnmanager not enabled | from unittest import mock
from django.contrib.auth.models import Group, Permission, User
from django.contrib.contenttypes.models import ContentType
from django.http import Http404, HttpRequest
from django.test import TestCase, override_settings
from django.urls import reverse
from v1.admin_views import redirect_to_in... |
13,848 | run | # Copyright (c) Lawrence Livermore National Security, LLC and other VisIt
# Project developers. See the top-level LICENSE file for dates and other
# details. No copyright assignment is required to contribute to VisIt.
"""
file: setup_tests.py
author: Cyrus Harrison <cyrush@llnl.gov>
created: 10/14/2010
descripti... |
13,849 | append columns | # 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,850 | get resource 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... |
13,851 | train | # Copyright (c) MONAI Consortium
# 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, so... |
13,852 | test lstm peephole | # 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,853 | validate dimensions | from crispy_forms.helper import FormHelper
from crispy_forms.layout import ButtonHolder, Div, Layout, Submit
from django import forms
from django.core.exceptions import ValidationError
from jsonschema import ValidationError as JSONValidationError
from jsonschema import validate
from grandchallenge.components.models im... |
13,854 | set up | from coldfront.core.test_helpers.factories import FieldOfScienceFactory
from django.core.exceptions import ValidationError
from django.test import TestCase
from coldfront.core.field_of_science.models import FieldOfScience
class TestFieldOfScience(TestCase):
class Data:
"""Collection of test data, separate... |
13,855 | test run through message save and restore | # -*- coding: utf-8 -*-
from SpiffWorkflow.task import TaskState
from SpiffWorkflow.bpmn.workflow import BpmnWorkflow
from SpiffWorkflow.bpmn.event import BpmnEvent
from SpiffWorkflow.bpmn.specs.event_definitions.message import MessageEventDefinition
from ..BpmnWorkflowTestCase import BpmnWorkflowTestCase
__author__ =... |
13,856 | roll | # Copyright (C) <2021> Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
'''Script to roll owt-deps-webrtc revision.
This script is expected to be ran by GitHub action runners when a new change is
committed to owt-deps-webrtc. It updates the revision in DEPS to use the latest
owt-deps-webrtc. A change will be... |
13,857 | get question answering metrics | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
"""Defines the Model Analysis Dashboard class."""
from flask import jsonify, request
from raiutils.models import ModelTask
from raiwidgets.dashboard import Dashboard
from raiwidgets.responsibleai_dashboard_input import \
ResponsibleAIDashboa... |
13,858 | inspect stack | """
Print a stacktrace when sent a SIGUSR1 for debugging
"""
import inspect
import os
import signal
import sys
import tempfile
import time
import traceback
import salt.utils.files
import salt.utils.stringutils
def _makepretty(printout, stack):
"""
Pretty print the stack trace and environment information
... |
13,859 | displaced structure | """
Utils for AiiDA.
----------------
Utilities for making working against AiiDA a bit easier. Mostly here due to
historical reasons when AiiDA was rapidly developed. In the future most routines
that have now standardized in AiiDA will be removed.
"""
# pylint: disable=import-outside-toplevel
import numpy as np
from p... |
13,860 | test admonition first indented | """
Python Markdown
A Python implementation of John Gruber's Markdown.
Documentation: https://python-markdown.github.io/
GitHub: https://github.com/Python-Markdown/markdown/
PyPI: https://pypi.org/project/Markdown/
Started by Manfred Stienstra (http://www.dwerg.net/).
Maintained for a few years by Yuri Takhteyev (ht... |
13,861 | refresh indicator | import os
import shutil
from enum import auto
from logging import getLogger
from typing import Tuple, Optional
from PyQt5.QtCore import pyqtSignal, Qt, pyqtSlot
from PyQt5.QtWidgets import QWidget, QVBoxLayout, QHBoxLayout, QPushButton, QLabel, QFileDialog
from rare.models.game import RareGame
from rare.shared import... |
13,862 | test construct gradient with large images | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
13,863 | get stack with http info | # coding: utf-8
"""
OpenPerf API
REST API interface for OpenPerf # noqa: E501
OpenAPI spec version: 1
Contact: support@spirent.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compa... |
13,864 | consume object | # 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/.
from collections import defaultdict
import mozpack.path as mozpath
import six
import six.moves.cPickle as pickle
from ... |
13,865 | test bucket no object versioning | from re import search
from unittest import mock
from boto3 import client, session
from moto import mock_s3
from prowler.providers.aws.lib.audit_info.models import AWS_Audit_Info
from prowler.providers.common.models import Audit_Metadata
AWS_ACCOUNT_NUMBER = "123456789012"
AWS_ACCOUNT_ARN = f"arn:aws:iam::{AWS_ACCOUN... |
13,866 | get run loaded labware definitions | """Router for /runs endpoints dealing with labware offsets and definitions."""
import logging
from typing import Union
from fastapi import APIRouter, Depends, status
from opentrons_shared_data.labware.labware_definition import (
LabwareDefinition as SD_LabwareDefinition,
)
from opentrons.protocol_engine import L... |
13,867 | test no secrets | import pandas as pd
import pytest
import responses
from pytest import fixture
from toucan_connectors.common import HttpError
from toucan_connectors.linkedinads.linkedinads_connector import (
FinderMethod,
LinkedinadsConnector,
LinkedinadsDataSource,
NoCredentialsError,
TimeGranularity,
)
from touca... |
13,868 | find status1 leptons | from builtins import range
from PhysicsTools.Heppy.physicsobjects.PhysicsObjects import printOut
from PhysicsTools.Heppy.physicsobjects.PhysicsObjects import GenParticle
def METHOD_NAME(particle):
'''Returns status 1 e and mu among the particle daughters'''
leptons = []
for i in range( particle.numberOfD... |
13,869 | load | from __future__ import annotations
import os
from typing import Any, Dict, List, Optional, Text
import logging
from rasa.engine.graph import GraphComponent, ExecutionContext
from rasa.engine.recipes.default_recipe import DefaultV1Recipe
from rasa.shared.constants import DOCS_URL_TRAINING_DATA
from rasa.shared.nlu.cons... |
13,870 | test extract tarfile obj not within dir | import io
from unittest import TestCase
import tarfile
from unittest.mock import Mock, patch, call
from samcli.lib.utils.tar import extract_tarfile, create_tarball, _is_within_directory
class TestTar(TestCase):
@patch("samcli.lib.utils.tar.tarfile.open")
@patch("samcli.lib.utils.tar.TemporaryFile")
def t... |
13,871 | retranslate ui | # -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'gui.ui'
##
## Created by: Qt User Interface Compiler version 5.15.2
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
######################... |
13,872 | build restapi query | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import logging
from typing import Any, List
from pyhocon import ConfigFactory, ConfigTree
from databuilder import Scoped
from databuilder.extractor.base_extractor import Extractor
from databuilder.extractor.dashboard.mode_analyti... |
13,873 | featureflag entry format | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
13,874 | load compile data | import os
from openqaoa_braket.backends import DeviceAWS
from openqaoa.algorithms import QAOA, RQAOA
from openqaoa.algorithms.baseworkflow import Workflow
from openqaoa.backends.qaoa_device import create_device
class AWSJobs(Workflow):
"""
This class is meant to be used *only* within the framework of AWS ma... |
13,875 | retrieve |
# cache.py - caching layer for pynslcd
#
# Copyright (C) 2012-2019 Arthur de Jong
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your optio... |
13,876 | update recipients | # Copyright 2019 The Kapitan Authors
# SPDX-FileCopyrightText: 2020 The Kapitan Authors <kapitan-admins@googlegroups.com>
#
# SPDX-License-Identifier: Apache-2.0
"gpg secrets module"
import base64
import logging
import time
import gnupg
from kapitan import cached
from kapitan.errors import KapitanError
from kapitan.... |
13,877 | sqlite column reflect listener | """Adds attraction slug column
Revision ID: fe5f87b292b4
Revises: 1c87fd8da02e
Create Date: 2017-12-17 02:01:36.942202
"""
# revision identifiers, used by Alembic.
revision = 'fe5f87b292b4'
down_revision = '1c87fd8da02e'
branch_labels = None
depends_on = None
import re
from alembic import op
import sqlalchemy as s... |
13,878 | get costs | # See LICENSE for licensing information.
#
# Copyright (c) 2016-2023 Regents of the University of California, Santa Cruz
# All rights reserved.
#
from .bbox import bbox
class bbox_node:
"""
This class represents a node in the bbox tree structure. Bbox trees are
binary trees we use to partition the shapes ... |
13,879 | reduce scatter coalesced | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
batched collective operations for overhead amortization and better
bandwidth utilization
"""
import math
from typing import List
import torch
from torch import Tensor
from deepspeed import comm as dist
# NOTE: Use torch.... |
13,880 | add args | # 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.
from typing import Dict, List, Optional, Tuple
import torch
import torch.nn as nn
from torch import Tensor
import logging
from fairseq impo... |
13,881 | test notifiy for buildset | # 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,882 | vqe template | """
Time comparison for different evaluation approach on spin VQE
"""
import os
os.environ["TF_FORCE_GPU_ALLOW_GROWTH"] = "true"
# one need this for jax+gpu combination in some cases
import time
from functools import partial
import numpy as np
import tensornetwork as tn
import tensorcircuit as tc
K = tc.set_backend... |
13,883 | math directive | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import hashlib
import os
import sys
import warnings
from docutils import nodes
from docutils.parsers.rst import directives
import sphinx
from matplotlib import rcParams
from matplotlib.mathtext impo... |
13,884 | subscribe | # 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,885 | test array | from pydrake.common.containers import EqualToDict, namedview, NamedViewBase
import unittest
import numpy as np
class Comparison:
def __init__(self, lhs, rhs):
self.lhs = lhs
self.rhs = rhs
def __bool__(self):
raise ValueError("Should not be called")
__nonzero__ = __bool__
cla... |
13,886 | add macros | from typing import Any, Dict, Iterable, Union, Optional, List, Iterator, Mapping, Set
from dbt.clients.jinja import MacroGenerator, MacroStack
from dbt.contracts.graph.nodes import Macro
from dbt.include.global_project import PROJECT_NAME as GLOBAL_PROJECT_NAME
from dbt.exceptions import DuplicateMacroNameError, Packa... |
13,887 | validate all items in list | # Copyright BigchainDB GmbH and BigchainDB contributors
# SPDX-License-Identifier: (Apache-2.0 AND CC-BY-4.0)
# Code is Apache-2.0 and docs are CC-BY-4.0
import time
import re
import rapidjson
import bigchaindb
from bigchaindb.common.exceptions import ValidationError
def gen_timestamp():
"""The Unix time, round... |
13,888 | test query vouchers with filter started | from datetime import timedelta
import pytest
from django.utils import timezone
from .....discount import DiscountValueType
from .....discount.models import Voucher
from ....tests.utils import get_graphql_content
QUERY_VOUCHERS_WITH_FILTER = """
query ($filter: VoucherFilterInput!, ) {
vouchers(first:5, fil... |
13,889 | do cli | import sys
from argparse import ArgumentParser, ArgumentTypeError
from sqlalchemy.orm.exc import NoResultFound
from flexget import options
from flexget.event import event
from flexget.manager import Session
from flexget.terminal import TerminalTable, colorize, console, disable_colors, table_parser
from . import db
... |
13,890 | get keywords to be excluded | # -*- coding: utf-8 -*-
#
# This file is part of SENAITE.CORE.
#
# SENAITE.CORE 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, bu... |
13,891 | patch base class | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from http import HTTPStatus
from unittest.mock import MagicMock
import pytest
import requests
from source_pinterest.streams import (
AdAccountAnalytics,
AdAccounts,
AdAnalytics,
AdGroupAnalytics,
AdGroups,
Ads,
BoardPins,
Boa... |
13,892 | concurrency cli | import os
import click
import dagster._check as check
from dagster._core.instance import DagsterInstance
from .utils import get_instance_for_cli
@click.group(name="instance")
def instance_cli():
"""Commands for working with the current Dagster instance."""
@instance_cli.command(name="info", help="List the in... |
13,893 | main | """Script for testing offline artifact logging.
Use:
```sh
rm -rf wandb \
&& WANDB_BASE_URL=http://api.wandb.test python offline_artifacts.py \
&& rm -rf wandb \
&& WANDB_BASE_URL=http://api.wandb.test python offline_artifacts.py --online.
```
"""
import sys
import numpy as np
import wandb
from click.testing i... |
13,894 | pam pta edit | # --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2022 William Brown <william@blackhats.net.au>
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
import json
import ldap
from lib389.plugins import (PAMPassThroughAuthPlugin,
... |
13,895 | preferences | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... |
13,896 | get empty | # 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,897 | reset model | __credits__ = ["Rushiv Arora"]
import numpy as np
from gymnasium import utils
from gymnasium.envs.mujoco import MuJocoPyEnv
from gymnasium.spaces import Box
DEFAULT_CAMERA_CONFIG = {
"trackbodyid": 2,
"distance": 3.0,
"lookat": np.array((0.0, 0.0, 1.15)),
"elevation": -20.0,
}
class HopperEnv(MuJo... |
13,898 | set up | # 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... |
13,899 | save document to vector store | import os
from llama_index import SimpleDirectoryReader
from sqlalchemy.orm import Session
from superagi.config.config import get_config
from superagi.helper.resource_helper import ResourceHelper
from superagi.lib.logger import logger
from superagi.resource_manager.llama_vector_store_factory import LlamaVectorStoreFa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.