id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
4,300 | set up | # coding: utf-8
#
# Copyright 2021 The Oppia 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 requi... |
4,301 | test create forcefield from url iterator | import pytest
from openff.toolkit import ForceField
class StaleForceFieldTests:
@pytest.mark.skip(reason="Needs to be updated for 0.2.0 syntax")
def test_create_forcefield_from_file_list(self):
# These offxml files are located in package data path, which is automatically installed and searched
... |
4,302 | test wer 7 | # 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... |
4,303 | attempt | from flask import Blueprint
from CTFd.models import (
ChallengeFiles,
Challenges,
Fails,
Flags,
Hints,
Solves,
Tags,
db,
)
from CTFd.plugins import register_plugin_assets_directory
from CTFd.plugins.flags import FlagException, get_flag_class
from CTFd.utils.uploads import delete_file
fr... |
4,304 | test scaler depth thor | import hashlib
import os
import imageio
import numpy as np
from torchvision.transforms import transforms
from allenact.utils.tensor_utils import ScaleBothSides
from constants import ABS_PATH_OF_TOP_LEVEL_DIR
to_pil = transforms.ToPILImage() # Same as used by the vision sensors
class TestPillowRescaling(object):
... |
4,305 | add arguments | from django.core.management import BaseCommand
from corehq.pillows.app_submission_tracker import (
SqlAppFormSubmissionTrackerReindexerFactory,
UserAppFormSubmissionReindexerFactory,
)
from corehq.pillows.application import AppReindexerFactory
from corehq.pillows.case import SqlCaseReindexerFactory
from corehq... |
4,306 | group | from abc import ABC
from logging import Logger
from fastapi import Depends
from pydantic import UUID4
from sqlalchemy.orm import Session
from mealie.core.config import get_app_dirs, get_app_settings
from mealie.core.dependencies.dependencies import get_admin_user, get_current_user, get_integration_id
from mealie.core... |
4,307 | test linestring | import numpy as np
import pytest
import shapely
from shapely import LinearRing, LineString, Point
from shapely.coords import CoordinateSequence
def test_from_coordinate_sequence():
# From coordinate tuples
line = LineString([(1.0, 2.0), (3.0, 4.0)])
assert len(line.coords) == 2
assert line.coords[:] ... |
4,308 | test glob nested directory | import glob
import os
import os.path
import shutil
import sys
import unittest
from test.support import run_unittest, TESTFN, skip_unless_symlink, can_symlink, create_empty_file
class GlobTests(unittest.TestCase):
def norm(self, *parts):
return os.path.normpath(os.path.join(self.tempdir, *parts))
def... |
4,309 | test second christmas day | # python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2... |
4,310 | parse times | from datetime import datetime, time, timedelta
from city_scrapers_core.constants import (
ADVISORY_COMMITTEE,
BOARD,
FORUM,
NOT_CLASSIFIED,
)
from city_scrapers_core.items import Meeting
from city_scrapers_core.spiders import CityScrapersSpider
class ChiSsa62Spider(CityScrapersSpider):
name = "ch... |
4,311 | test priority sort under blank | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright 2006 - 2021, Tomas Babej, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated d... |
4,312 | test symmetry | from pyiron_atomistics import Project
import numpy as np
import unittest
import os
class TestSphinx(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.file_location = os.path.dirname(os.path.abspath(__file__))
cls.project = Project('SPX_CHECK_ALL')
cls.a_Fe = 2.83
cls.a_... |
4,313 | set label | from fontTools import ttLib
from fontTools.misc.textTools import safeEval
from fontTools.ttLib.tables.DefaultTable import DefaultTable
import sys
import os
import logging
log = logging.getLogger(__name__)
class TTXParseError(Exception):
pass
BUFSIZE = 0x4000
class XMLReader(object):
def __init__(
... |
4,314 | test two pairs first ranked by largest | # These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/poker/canonical-data.json
# File last updated on 2023-07-19
import unittest
from poker import (
best_hands,
)
class PokerTest(unittest.TestCase):
def test_single_hand_always_wins(se... |
4,315 | get receivers | from celery import shared_task
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.sites.models import Site
from django.core.exceptions import ObjectDoesNotExist
from django.core.mail import EmailMultiAlternatives, get_connection
from django.core.paginator import Paginato... |
4,316 | connect selection changed |
from enigma import eEPGCache, eListbox, eListboxPythonMultiContent, eServiceReference, eSize
from Components.GUIComponent import GUIComponent
from Tools.Alternatives import CompareWithAlternatives
from Tools.Directories import SCOPE_CURRENT_SKIN, resolveFilename
from Tools.LoadPixmap import LoadPixmap
from skin impor... |
4,317 | simulate | # 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... |
4,318 | test add remove column | import uuid
import sqlalchemy
from alembic.autogenerate import compare_metadata
from django.test.testcases import TestCase, SimpleTestCase
from nose.tools import assert_list_equal
from corehq.sql_db.connections import connection_manager, DEFAULT_ENGINE_ID
from ..alembic_diffs import (
DiffTypes,
SimpleDiff,
... |
4,319 | test plugins connection aws ssm put file | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from io import StringIO
import pytest
from unittest.mock import patch, MagicMock
from ansible.playbook.play_context import PlayContext
from ansible.plugins.loader import connection_loader
from ansible_collections.amazon.aws.p... |
4,320 | init attributes | # -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2018 bbi-yggy <yossarian@blackbirdinteractive.com> #
# ... |
4,321 | delete distinct counts | from sentry.tsdb.base import BaseTSDB
class DummyTSDB(BaseTSDB):
"""
A no-op time-series storage.
"""
def incr(self, model, key, timestamp=None, count=1, environment_id=None):
self.validate_arguments([model], [environment_id])
def merge(self, model, destination, sources, timestamp=None, ... |
4,322 | test to edge index | import os.path as osp
import torch
import torch_geometric.typing
from torch_geometric.profile import benchmark
from torch_geometric.testing import is_full_test, withPackage
from torch_geometric.typing import SparseTensor
from torch_geometric.utils import (
dense_to_sparse,
is_sparse,
is_torch_sparse_tenso... |
4,323 | test can change | # Copyright 2012 Christoph Reiter
# 2020 Nick Boultbee
#
# 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.
from ... |
4,324 | my detect version | # Copyright 2023, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... |
4,325 | add args | # The MIT License (MIT)
# Copyright © 2021 Yuma Rao
# 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, ... |
4,326 | administration | # 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... |
4,327 | test training init command tutorial zenodo | """Tests for the ``training_init`` command."""
import os
from .test_utils import (
CliTestCase,
skip_if_environ,
TEST_DATA_DIR,
)
class CmdTrainingInitTestCase(CliTestCase):
"""Container class defining test cases for the ``training_init`` command."""
@skip_if_environ("PLANEMO_SKIP_GALAXY_TESTS")... |
4,328 | read seg | """I/O for SEG format.
This is the output of DNAcopy segmentation, widely used to serialize segment
data.
The format is BED-like, but with a header row included and the
columns:
- ID, "sampleName"
- chrom, "chromosome"
- loc.start, "start"
- loc.end, "end"
- num.mark, "nbrOfLoci" (optional)
-... |
4,329 | on message received | """
This module works with CAN data in ASCII log files (*.log).
It is is compatible with "candump -L" from the canutils program
(https://github.com/linux-can/can-utils).
"""
import logging
from typing import Any, Generator, TextIO, Union
from can.message import Message
from ..typechecking import StringPathLike
from ... |
4,330 | get ref url | # -*- coding: utf-8 -*-
from sqlalchemy.orm import Session
import tempfile
import transaction
from wsgidav import util
from wsgidav.dav_error import DAVError
from wsgidav.dav_error import HTTP_FORBIDDEN
from tracim_backend.app_models.contents import content_type_list
from tracim_backend.exceptions import TracimExcepti... |
4,331 | find caller | # Copyright 2019 ICON Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... |
4,332 | get duplicated values | import binascii
import os
import secrets
from dataclasses import dataclass
from typing import List, Literal, Optional, Tuple, Type, Union, overload
import graphene
from django.core.exceptions import ValidationError
from graphene import ObjectType
from graphql.error import GraphQLError
from ....plugins.const import AP... |
4,333 | prepare | # Copyright 2021 Collate
# 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, software... |
4,334 | work on bugs task | # Copyright © 2019 Red Hat, Inc. and others.
#
# This file is part of Bodhi.
#
# 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 ve... |
4,335 | suite | import os
import yaml
from unittest.mock import patch
from tempfile import mkdtemp
from shutil import rmtree
import unittest
from beets import ui
from beets import config
from test.helper import TestHelper
from beets.library import Library
class ConfigCommandTest(unittest.TestCase, TestHelper):
def setUp(self)... |
4,336 | get results | # This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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... |
4,337 | print compartment info | #
# @file printMulti.cs
# @brief multi print example
# @author Frank Bergmann
#
# <!--------------------------------------------------------------------------
# This file is part of libSBML. Please visit http://sbml.org for more
# information about SBML, and the latest version of libSBML.
#
# Copyright (C) 20... |
4,338 | test clean successful stage outs | #!/usr/bin/env python
"""
testing file manager
"""
from __future__ import print_function
import logging
import os.path
import shutil
import tempfile
import unittest
import WMCore.Storage.StageOutError
from WMCore.Storage.FileManager import StageInMgr, StageOutMgr, DeleteMgr
class FileManagerTest(unittest.TestCase)... |
4,339 | test protect unauthorized | from c2corg_api.models.document import Document, DocumentGeometry
from c2corg_api.models.waypoint import Waypoint, WaypointLocale
from c2corg_api.tests.views import BaseTestRest
from c2corg_api.views.document import DocumentRest
class BaseProtectTest(BaseTestRest):
def setUp(self): # noqa
super(BaseProt... |
4,340 | test should get obj type name list | import unittest
import os
from unittest import mock
from unittest.mock import MagicMock
import aim.sdk.utils as utils
class TestUtils(unittest.TestCase):
def setUp(self):
self.maxDiff = None
def test_should_search_aim_repo_not_found_back_slash(self):
# arrange
path = '/'
# a... |
4,341 | test cuts basic | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
"""Test desitarget.cmx.
"""
import unittest
import sys
from pkg_resources import resource_filename
import os.path
from uuid import uuid4
import numbers
import warnings
from astropy.io import fits
from astropy.table import Table
imp... |
4,342 | test lists unique by tuple funcs | # This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Copyright the Hypothesis Authors.
# Individual contributors are listed in AUTHORS.rst and the git log.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the... |
4,343 | assert float | #!/usr/bin/env python
from __future__ import division
import sys, os
current_line = ""
def time_to_millis(time_in):
time_in.strip()
time_in.replace(" ", "")
result = "NaN"
if "ms" in time_in:
result = str(METHOD_NAME(time_in.replace("ms", "")))
elif "s" in time_in:
result = str... |
4,344 | test avi event rfc5424 | # Copyright 2019 Splunk, Inc.
#
# Use of this source code is governed by a BSD-2-clause-style
# license that can be found in the LICENSE-BSD2 file or at
# https://opensource.org/licenses/BSD-2-Clause
import shortuuid
from jinja2 import Environment, select_autoescape
from .sendmessage import sendsingle
from .splunkut... |
4,345 | test incorrectly formatted variables | import pytest
from unittest import mock
from awx.main.models import UnifiedJob, UnifiedJobTemplate, WorkflowJob, WorkflowJobNode, WorkflowApprovalTemplate, Job, User, Project, JobTemplate, Inventory
from awx.main.constants import JOB_VARIABLE_PREFIXES
def METHOD_NAME():
bad_data = '{"bar":"foo'
accepted, ign... |
4,346 | test force set system identity valid input | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
4,347 | die | #!/usr/bin/env python3
#
# Permission to use, copy, modify, distribute, and sell this software
# and its documentation for any purpose is hereby granted without
# fee, provided that the above copyright notice appear in all copies
# and that both that copyright notice and this permission notice
# appear in supporting do... |
4,348 | parse args | # Copyright (c) 2019-2023 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed... |
4,349 | put | """Pyro transport module for kombu.
Pyro transport, and Kombu Broker daemon.
Requires the :mod:`Pyro4` library to be installed.
Features
========
* Type: Virtual
* Supports Direct: Yes
* Supports Topic: Yes
* Supports Fanout: No
* Supports Priority: No
* Supports TTL: No
Connection String
=================
To use ... |
4,350 | test operator | import kdb, unittest
class Key(unittest.TestCase):
def setUp(self):
self.key = kdb.Key("user:/foo/bar",
kdb.KEY_VALUE, "value",
kdb.KEY_META, "by", "manuel",
kdb.KEY_META, "owner", "myowner"
)
self.bkey = kdb.Key("system:/bkey",
kdb.KEY_VALUE, b"bvalue\0\0",
kdb.KEY_END,
kdb.KEY_META, ... |
4,351 | pad list | # Copyright (c) 2020 Mobvoi Inc (Binbin Zhang)
#
# 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... |
4,352 | schemas | from sqlalchemy.testing.requirements import Requirements
from alembic import util
from alembic.util import sqla_compat
from ..testing import exclusions
class SuiteRequirements(Requirements):
@property
def METHOD_NAME(self):
"""Target database must support external schemas, and have one
named ... |
4,353 | get file diff | from future import standard_library
standard_library.install_aliases()
import base64
import copy
from io import BytesIO
import os
import re
import tempfile
from multiprocessing.dummy import Pool
import requests
from django.conf import settings
from django.core.files.storage import default_storage
from le_utils.constan... |
4,354 | test middleware allowed hosts | from typing import TYPE_CHECKING, Any, cast
import pytest
from litestar import get
from litestar.config.allowed_hosts import AllowedHostsConfig
from litestar.exceptions import ImproperlyConfiguredException
from litestar.middleware import MiddlewareProtocol
from litestar.middleware.allowed_hosts import AllowedHostsMid... |
4,355 | projection path | from abc import ABC, abstractmethod
from datetime import datetime
class QAMetric(ABC):
def __init__(self):
# ...
pass
@property
@abstractmethod
def METHOD_NAME(self):
pass
@property
@abstractmethod
def actual_path(self):
pass
@property
@abstractme... |
4,356 | test all | # The Hazard Library
# Copyright (C) 2012-2023 GEM Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#... |
4,357 | eb transferred | # -*- test-case-name: twisted.names.test.test_names -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
__all__ = ["SecondaryAuthority", "SecondaryAuthorityService"]
from twisted.application import service
from twisted.internet import defer, task
from twisted.names import client, common, dns,... |
4,358 | test try busy | from contextlib import contextmanager
from multiprocessing import get_all_start_methods
from multiprocessing import get_start_method
from multiprocessing import Pipe
from multiprocessing import Process
from multiprocessing import set_start_method
from time import sleep
from django.db import transaction
from django.tes... |
4,359 | main | # 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... |
4,360 | delete objects | import io
import logging
from minio import Minio
from minio.error import InvalidResponseError
from urllib3.poolmanager import PoolManager
from .base import Repository
logger = logging.getLogger(__name__)
class MINIORepository(Repository):
"""
"""
client = None
def __init__(self, config):
... |
4,361 | config options string | from builtins import str
from collections import OrderedDict
from django.db import models
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.contrib.auth.models import User
import simplejson as json
from tendenci.apps.memberships.models import MembershipType
from tenden... |
4,362 | get file | #
# 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... |
4,363 | test build results with index | import pytest
import xdsl.dialects.pdl as pdl
from xdsl.dialects.builtin import ArrayAttr, IntegerAttr, StringAttr, i32, i64
from xdsl.ir import Block
from xdsl.utils.exceptions import VerifyException
from xdsl.utils.test_value import TestSSAValue
type_type = pdl.TypeType()
attribute_type = pdl.AttributeType()
value_... |
4,364 | wsgi app | # pytest configuration for weasyl db test fixture.
# The filename conftest.py is magical, do not change.
import errno
import json
import os
import shutil
import pytest
import pyramid.testing
from sqlalchemy.dialects.postgresql import psycopg2
from webtest import TestApp as TestApp_
from weasyl import config
config._... |
4,365 | test send sms fake to phone number | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import pyt... |
4,366 | power | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
4,367 | test email sent to group | #########################################################################
#
# Copyright (C) 2020 OSGeo
#
# 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... |
4,368 | test context processor no tos | from django.urls import reverse
from ...users.test import AuthenticatedUserTestCase
from ..context_processors import legal_links
from ..models import Agreement
class MockRequest:
def __init__(self, user):
self.user = user
self.frontend_context = {}
def get_host(self):
return "testhos... |
4,369 | test fetch guild preview | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021-present davfsa
#
# 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 t... |
4,370 | build validation result from rest object | # ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
# pylint: disable=protected-access
import logging
import typing
import msrest
from azure.ai.ml._vendor.azure_resources.models import (
... |
4,371 | temppath | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications copyright (C) 2018 Uber Technologies, 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.apa... |
4,372 | login | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
int_or_none,
urlencode_postdata,
)
class AtresPlayerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?atresplayer\.com/[^... |
4,373 | pause tracing | # SPDX-License-Identifier: MIT
import datetime
from m1n1.constructutils import show_struct_trace, Ver
from m1n1.utils import *
Ver.set_version(hv.u)
trace_device("/arm-io/sgx", True)
#trace_device("/arm-io/pmp", True)
#trace_device("/arm-io/gfx-asc", False)
from m1n1.trace.agx import AGXTracer
AGXTracer = AGXTracer... |
4,374 | get service key | from typing import Dict, List, Optional, Union
from hikaru.model.rel_1_26 import Container, Volume
from kubernetes.client import V1Container, V1Volume
from pydantic import BaseModel
class EnvVar(BaseModel):
name: str
value: str
class Resources(BaseModel):
limits: Dict[str, str]
requests: Dict[str, ... |
4,375 | authentication details | # 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... |
4,376 | expand | import torch
from torch.autograd import Function
from torch.autograd.function import once_differentiable
from torch.distributions import constraints
from torch.distributions.exp_family import ExponentialFamily
__all__ = ["Dirichlet"]
# This helper is exposed for testing.
def _Dirichlet_backward(x, concentration, gra... |
4,377 | get replication recovery services provider | # 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... |
4,378 | logout with server docker mode |
import os
import platform
import click
from fedml.computing.scheduler.comm_utils import sys_utils
from .device_server_constants import ServerConstants
from .device_server_runner import FedMLServerRunner
def login_with_server_docker_mode(userid, version, docker_rank):
account_id = userid
# Get os name
... |
4,379 | reset state | from keras_core import backend
from keras_core import initializers
from keras_core import ops
from keras_core.api_export import keras_core_export
from keras_core.utils.naming import auto_name
from keras_core.utils.tracking import Tracker
@keras_core_export(["keras_core.Metric", "keras_core.metrics.Metric"])
class Met... |
4,380 | get sample list | from flask import Blueprint, Response, jsonify, request
from mxcubecore import HardwareRepository as HWR
def init_route(app, server, url_prefix):
bp = Blueprint("sample_changer", __name__, url_prefix=url_prefix)
@bp.route("/samples_list", methods=["GET"])
@server.restrict
def METHOD_NAME():
... |
4,381 | ra dec2 xy | """ Plots points on an all-sky sinusoidal projection plot. """
import numpy as np
import matplotlib.pyplot as plt
class AllSkyPlot(object):
def __init__(self, ax_handle=None):
self.ra0 = 180.0
if ax_handle is None:
self.fig = plt.figure()
self.ax = self.fig.add_subplot(1, 1, 1, facecolor='black')... |
4,382 | test slope | # Copyright (C) 2021 Open Source Robotics Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... |
4,383 | probe | # 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 one ... |
4,384 | url parameters | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
4,385 | is outside build area | # Copyright (c) 2020 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from copy import deepcopy
from typing import cast, Dict, List, Optional
from UM.Application import Application
from UM.Math.AxisAlignedBox import AxisAlignedBox
from UM.Math.Polygon import Polygon # For typing.
from UM.Sc... |
4,386 | callback | import contextlib
import gc
import inspect
import os
import traceback
import sqlalchemy
import sqlalchemy.event
from sqlalchemy import create_engine, text
from .. import core, get_halo
from ..config import testing_db_backend, testing_db_password, testing_db_user
def _as_halos(hlist, session=None):
if session is... |
4,387 | stop | # Modified to work with Exaile - Brian Parma
#
# Copyright (C) 2008 Erik Hetzner
# This file is part of Spydaap. Spydaap 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 (... |
4,388 | tags | # 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... |
4,389 | test modulated | import numpy as np
import pytest
from aspire.image import Image
from aspire.utils import gaussian_2d, utest_tolerance
from aspire.utils.coor_trans import grid_2d
from aspire.utils.random import randn
from aspire.volume import Volume
# Parameter combinations for testing 2D bases
# Each tuple represents (resolution in ... |
4,390 | inject result data outputs | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in complia... |
4,391 | make dummy inst | from collections.abc import Generator
import pytest
import qcodes.validators as vals
from qcodes.parameters import Parameter, create_on_off_val_mapping
from qcodes.tests.instrument_mocks import DummyInstrument
from .conftest import ParameterMemory
@pytest.fixture(name="dummyinst")
def METHOD_NAME() -> Generator[Du... |
4,392 | test check virtual | """
:codeauthor: Gareth J. Greenaway <gareth@saltstack.com>
"""
import copy
import logging
import pytest
from saltfactories.utils import random_string
import salt.proxy.netmiko_px as netmiko_proxy
from tests.support.mock import MagicMock, patch
log = logging.getLogger(__name__)
@pytest.fixture(scope="module")... |
4,393 | init | # (C) Copyright 2004-2023 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
4,394 | package id | import os
from conan import ConanFile
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, cmake_layout, CMakeToolchain
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
from conan.tools.microsoft import check_min_vs, is_msvc
from conan.too... |
4,395 | exists | #!/usr/bin/python3
"""Fetch OSTree commits from an repository
Uses ostree to pull specific commits from (remote) repositories
at the provided `url`. Can verify the commit, if one or more
gpg keys are provided via `gpgkeys`.
"""
import os
import subprocess
import sys
import uuid
from osbuild import sources
from osbu... |
4,396 | test quorum | #!/usr/bin/env python3
# group: rw quick
#
# Test the rate limit of QMP events
#
# Copyright (C) 2016 Igalia, S.L.
# Author: Alberto Garcia <berto@igalia.com>
#
# 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 Softwa... |
4,397 | episode done | #!/usr/bin/env python3
# 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 time
from abc import ABC, abstractmethod
from queue import Queue
from parlai.core.agents import Agent
class Cha... |
4,398 | decode definition | from typing import TYPE_CHECKING
from trezor.messages import EthereumNetworkInfo, EthereumTokenInfo
from trezor.wire import DataError
if TYPE_CHECKING:
from typing import TypeVar
from typing_extensions import Self
DefType = TypeVar("DefType", EthereumNetworkInfo, EthereumTokenInfo)
def METHOD_NAME(def... |
4,399 | handle poi | # Copyright (c) 2001-2022, Hove and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Hove (www.hove.com).
# Help us simplify mobility and open public transport:
#... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.