id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
5,000 | set up | # -*- 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... |
5,001 | send transaction | '''
!!!! THESE TESTS ARE LONG AND COULD EACH TAKE A FEW MINUTES TO COMPLETE !!!!
THROUGHPUT Test send all transactions AT ONCE and then wait for all nodes to process them and come to consensus
After all node are in sync then the test are run to validate state etc.
'''
from tests.integration.mock import mo... |
5,002 | test location | from os.path import dirname, join
from unittest.mock import patch
import pytest
import scrapy
from city_scrapers_core.constants import BOARD, TENTATIVE
from city_scrapers_core.utils import file_response
from freezegun import freeze_time
from city_scrapers.spiders.il_health_facilities import IlHealthFacilitiesSpider
... |
5,003 | clear any data | """
FitPanel class contains fields allowing to fit models and data
"""
import sys
import datetime
from PySide6 import QtCore
from PySide6 import QtGui
from PySide6 import QtWidgets
class ResultPanel(QtWidgets.QTabWidget):
"""
FitPanel class contains fields allowing to fit models and data
:note: For... |
5,004 | init message logger | import os
import logging
import functools
import json
import time
from datetime import datetime
# from tensorboardX import SummaryWriter
import yaml
import cv2
import numpy as np
from .config import Configurable, State
class Logger(Configurable):
SUMMARY_DIR_NAME = 'summaries'
VISUALIZE_NAME = 'visualize'
... |
5,005 | set config | import os
import subprocess
from jadi import component
import aj
from aj.plugins.augeas.api import Augeas
from aj.plugins.network.api import NetworkManager
from .ifconfig import ifconfig_up, ifconfig_down, ifconfig_get_ip, ifconfig_get_up
@component(NetworkManager)
class CentOSNetworkManager(NetworkManager):
pa... |
5,006 | process json | #!/usr/bin/python3
import argparse
import json
import os
import requests
from flask import Flask, request
app = Flask(__name__)
class State:
in_progress = "in_progress"
failed = "failed"
success = "success"
def submit_ci_status(key = "IROHA",
state = State.in_progress,
... |
5,007 | tags | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . imp... |
5,008 | id | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
5,009 | plot violin | """Matplotlib Violinplot."""
import matplotlib.pyplot as plt
import numpy as np
from ....stats import hdi
from ....stats.density_utils import get_bins, histogram, kde
from ...plot_utils import _scale_fig_size
from . import backend_kwarg_defaults, backend_show, create_axes_grid, matplotlib_kwarg_dealiaser
def METHOD_... |
5,010 | test serialisation | ##########################################################################
#
# Copyright (c) 2012-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
5,011 | source mask | # --------------------------------------------------------
# SpeechT5: Unified-Modal Encoder-Decoder Pre-Training for Spoken Language Processing (https://arxiv.org/abs/2110.07205)
# Github source: https://github.com/microsoft/SpeechT5/tree/main/SpeechT5
# Copyright (c) 2021 Microsoft
# Licensed under The MIT License [s... |
5,012 | set dacs zero | from qcodes.instrument.base import Instrument
from qcodes.utils.validators import Enum, Numbers
try:
from spirack import D5a_module
except ImportError:
raise ImportError(('The D5a_module class could not be found. '
'Try installing it using pip install spirack'))
from functools import pa... |
5,013 | rule runner | # Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import pytest
from pants.backend.kotlin.compile import kotlinc_plugins
from pants.backend.kotlin.compile.kotlinc import rules as kotlinc_rules
from pant... |
5,014 | tear down class | # SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
"""
test suites
"""
from rez.tests.util import TestBase, TempdirMixin, \
per_available_shell, install_dependent
from rez.resolved_context import ResolvedContext
from rez.suite import Suite
from rez.config import config
from rez.syst... |
5,015 | resolve image by client versions | # Copyright 2023 Iguazio
#
# 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, softwa... |
5,016 | filter asset related | # -*- coding: utf-8 -*-
#
from django.db.models import Q
from django.shortcuts import get_object_or_404
from rest_framework.generics import ListAPIView
from assets.models import Asset
from common.utils import get_logger
from orgs.mixins import generics
from perms.filters import AssetPermissionFilter
from perms.models ... |
5,017 | is token join or from | # 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 agreed t... |
5,018 | on transform change | # -*- coding: utf-8 -*-
# vispy: gallery 30
# -----------------------------------------------------------------------------
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------... |
5,019 | mkdir | #!/usr/bin/env python3
# This script aims to help to run locktests with several clients.
#
# Report bugs to Vincent ROQUETA : vincent.roqueta@ext.bull.net
import encodings
import shutil
import os, sys
import getopt, sys
import string
import socket
from stat import *
from sys import *
from os import *
NFS4_PATH="/mnt/... |
5,020 | test | # encoding: utf-8
#
# Copyright 2017-2023 Greg Neagle.
#
# 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 l... |
5,021 | setup | #!/usr/bin/env python
import sys
import random
from direct.showbase.ShowBase import ShowBase
from direct.showbase.InputStateGlobal import inputState
from panda3d.core import AmbientLight
from panda3d.core import DirectionalLight
from panda3d.core import LVector3
from panda3d.core import TransformState
from panda3d.c... |
5,022 | leave call | #! /usr/bin/env python3
# -*- 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 requi... |
5,023 | test error on unknown var name | # 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... |
5,024 | assert parsed results equals | #!/usr/bin/env python
#
# Copyright 2011-2015 Splunk, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"): you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
5,025 | get file indices for rank | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from .constants import (BASE_OPTIMIZER_STATE, GROUP_PADDINGS, OPTIMIZER_STATE_DICT, PARTITION_COUNT)
from .reshape_utils import (basic_folder_validation, get_zero_files, merge_state)
from .reshape_3d_utils im... |
5,026 | queries | """Module for reading repodata directory (created with createrepo) for package
information instead of scanning individual rpms."""
import gzip
import os
from xml.etree import ElementTree as ET
from . import rpmquery
from . import packagequery
def namespace(name):
return "{http://linux.duke.edu/metadata/%s}" % ... |
5,027 | test execute | # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance
# with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/
# or in the "LICENSE.txt" file accompa... |
5,028 | prepare config | from datetime import datetime, timedelta
from loguru import logger
from flexget import plugin
from flexget.event import event
from flexget.manager import Session
from flexget.utils.tools import parse_timedelta
from . import db
SCHEMA_VER = 3
FAIL_LIMIT = 100
logger = logger.bind(name='failed')
class PluginFailed... |
5,029 | read real table static | # pylint: disable=C0301,W0201
from __future__ import annotations
from struct import Struct
from typing import Union, Any, TYPE_CHECKING
import numpy as np
from pyNastran.op2.op2_helper import polar_to_real_imag
from pyNastran.op2.op2_interface.op2_reader import mapfmt
if TYPE_CHECKING: # pragma: no cover
from py... |
5,030 | img to bytes | import io
import os
import torchvision
import webdataset as wds
from PIL import Image
from aistore.sdk import Client
from torch.utils.data import IterableDataset
from torch.utils.data.dataset import T_co
AIS_ENDPOINT = os.getenv("AIS_ENDPOINT")
bucket_name = "images"
etl_name = "wd-transform"
def show_image(image_d... |
5,031 | set up | from addressbase.models import Address, UprnToCouncil
from councils.tests.factories import CouncilFactory
from data_importers.tests.stubs import stub_addressimport
from django.test import TestCase
# High-level functional tests for import scripts
class ImporterTest(TestCase):
opts = {"nochecks": True, "verbosity":... |
5,032 | test label ambiguity | # ----------------------------------------------------------------------------
# Copyright (C) 2021-2023 Deepchecks (https://www.deepchecks.com)
#
# This file is part of Deepchecks.
# Deepchecks is distributed under the terms of the GNU Affero General
# Public License (version 3 or later).
# You should have received a ... |
5,033 | recv result | import time
import unittest
import zmq
from westpa.work_managers.zeromq import ZMQWorker
from westpa.work_managers.zeromq.core import Message, Task, Result, TIMEOUT_MASTER_BEACON
from ..tsupport import (
random_int,
will_fail,
will_busyhang,
will_busyhang_uninterruptible,
ExceptionForTest,
id... |
5,034 | test image processor from dict with kwargs | # coding=utf-8
# Copyright 2022 HuggingFace Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... |
5,035 | base | from datetime import datetime
from typing import Any, Dict, List, Optional, Tuple, Union
from github.Commit import Commit
from github.File import File
from github.GithubObject import CompletableGithubObject, _NotSetType
from github.Issue import Issue
from github.IssueComment import IssueComment
from github.IssueEvent ... |
5,036 | get name indexed property | # Copyright 2023 Avaiga Private Limited
#
# 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 ... |
5,037 | setup | from s3prl import Container
from s3prl.corpus.voxceleb1sid import voxceleb1_for_utt_classification
from s3prl.dataset.base import DataPipe, SequentialDataPipe
from s3prl.dataset.common_pipes import RandomCrop, SetOutputKeys
from s3prl.dataset.utterance_classification_pipe import UtteranceClassificationPipe
from s3prl.n... |
5,038 | test matched | # -*- coding: utf-8 -*-
# Copyright (C) 2012-2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed ... |
5,039 | mekkatorque speech npc on load | #
# ArcEmu MMORPG Server
# Copyright (C) 2008-2023 <http://www.ArcEmu.org/>
#
# 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
# any later version.
#
... |
5,040 | get unit file | import logging
import subprocess
from os import path
from pathlib import Path
from typing import List
from multiversx_sdk_cli import dependencies, errors, myprocess, utils
from multiversx_sdk_cli.projects.project_base import Project, rename_wasm_files
logger = logging.getLogger('ProjectClang')
class ProjectClang(Pr... |
5,041 | get size in bytes | """
Code imported from aleph-client to avoid a direct reference to the SDK.
"""
import hashlib
import logging
import struct
from binascii import hexlify, unhexlify
from typing import Optional
from coincurve.keys import PrivateKey, PublicKey
LOGGER = logging.getLogger(__name__)
PLACE_HOLDER = b"\xFF\xFF\xFF\xFF"
B58_... |
5,042 | get mask | # Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... |
5,043 | get mapbox state | from typing import Optional, Dict, List, NamedTuple, Tuple
import re
import urllib.parse
import pydantic
import logging
from django.conf import settings
import requests
from project.util.geojson import FeatureGeometry
logger = logging.getLogger(__name__)
MAPBOX_PLACES_URL = "https://api.mapbox.com/geocoding/v5/mapb... |
5,044 | on 200 | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
5,045 | dao get provider versions | from datetime import datetime
from notifications_utils.timezones import convert_utc_to_local_timezone
from sqlalchemy import asc, desc, func
from app import db
from app.dao.dao_utils import transactional
from app.models import (
SMS_TYPE,
FactBilling,
ProviderDetails,
ProviderDetailsHistory,
User,... |
5,046 | run | import json
import random
import string
import time
import traceback
from ceph.ceph import CommandFailed
from ceph.ceph_admin import CephAdmin
from tests.cephfs.cephfs_utilsV1 import FsUtils
from tests.io.fs_io import fs_io
from utility.log import Log
from utility.retry import retry
log = Log(__name__)
"""
Pre-requi... |
5,047 | do finalize | #
# This file is part of LiteX-Boards.
#
# Copyright (c) 2022 Andrew Elbert Wilson <Andrew.E.Wilson@ieee.org>
# SPDX-License-Identifier: BSD-2-Clause
from litex.build.generic_platform import *
from litex.build.xilinx import XilinxUSPPlatform, VivadoProgrammer
# IOs ----------------------------------------------------... |
5,048 | test one accumulator while loop | """
Test suite for the AccumulationTable class on different
types of accumulator loops
"""
import pytest
from python_ta.debug import AccumulationTable
def test_one_accumulator() -> None:
test_list = [10, 20, 30]
sum_so_far = 0
with AccumulationTable(["sum_so_far"]) as table:
for number in test_l... |
5,049 | fromfd | #
# Module to allow connection and socket objects to be transferred
# between processes
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditio... |
5,050 | load account info | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import json
import socket
from abc import ABC, abstractmethod
from datetime import datetime, timedelta
from functools import partial
from typing import Any, Callable, Dict, Iterator, Mapping, Optional, Sequence
import backoff
import pendulum
import pytz
fr... |
5,051 | setup method | __author__ = "sibirrer"
import numpy as np
import numpy.testing as npt
import pytest
from lenstronomy.Cosmo.lens_cosmo import LensCosmo
from lenstronomy.Util import util
class TestLensCosmo(object):
"""Tests the UnitManager class routines."""
def METHOD_NAME(self):
z_L = 0.8
z_S = 3.0
... |
5,052 | test loading asset | from mpfmc.tests.MpfMcTestCase import MpfMcTestCase
class TestBitmapFonts(MpfMcTestCase):
def get_machine_path(self):
return 'tests/machine_files/bitmap_fonts'
def get_config_file(self):
return 'test_bitmap_fonts.yaml'
def METHOD_NAME(self):
# test that the bitmap_fonts asset cla... |
5,053 | add pattern rpm | #!/usr/bin/python3
#
# image-minimizer: removes files and packages on the filesystem
#
# Copyright 2007-2016 Red Hat, Inc.
#
# 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; version 2 of the Lice... |
5,054 | lookup value | # SPDX-License-Identifier: Apache-2.0
""" tf2onnx mapping functions for onnx ml domain. """
import logging
import numpy as np
from onnx import TensorProto
from onnx import numpy_helper
from tf2onnx import constants
from tf2onnx.handler import tf_op
from tf2onnx import utils
logger = logging.getLogger(__name__)
# py... |
5,055 | test eq wrong type | # Copyright 2015 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 agreed to in writing, s... |
5,056 | test codeml binary | # Copyright (C) 2011 by Brandon Invergo (b.invergo@gmail.com)
# This code is part of the Biopython distribution and governed by its
# license. Please see the LICENSE file that should have been included
# as part of this package.
"""Tests for PAML tools module."""
import unittest
import os
import sys
from Bio.Phylo.PA... |
5,057 | format list | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""El... |
5,058 | test location sync query | import param
import pytest
from panel.io.location import Location
from panel.util import edit_readonly
@pytest.fixture
def location():
loc = Location()
with edit_readonly(loc):
loc.href = "http://localhost:5006"
loc.hostname = "localhost"
loc.pathname = ""
loc.protocol = 'http... |
5,059 | show | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework 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
... |
5,060 | list users | """
Support for RallyDev
.. versionadded:: 2015.8.0
Requires a ``username`` and a ``password`` in ``/etc/salt/minion``:
.. code-block:: yaml
rallydev:
username: myuser@example.com
password: 123pass
"""
import logging
import salt.utils.http
import salt.utils.json
from salt.exceptions import SaltIn... |
5,061 | mkdtemp | import shutil
import tempfile
import unittest
import queuelib
from scrapy.http import Request
from scrapy.spiders import Spider
from scrapy.squeues import (
FifoMemoryQueue,
LifoMemoryQueue,
MarshalFifoDiskQueue,
MarshalLifoDiskQueue,
PickleFifoDiskQueue,
PickleLifoDiskQueue,
)
from scrapy.uti... |
5,062 | insert into all | import inspect
from .exceptions import InvalidConfigError, RegistrationError
from .util.dict import filter_dict
class TargetFactory:
def __init__(self):
self.resources = {}
self.drivers = {}
self.all_classes = {}
def reg_resource(self, cls):
"""Register a resource with the fa... |
5,063 | test missed framework in create gapi launcher | """
Copyright (c) 2018-2023 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wri... |
5,064 | test twoglobals | # Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# The Universal Permissive License (UPL), Version 1.0
#
# Subject to the condition set forth below, permission is hereby granted to any
# person obtaining a copy of this softw... |
5,065 | test interpolator | """
Methods for reading ROMS model outputs
"""
from thetis import *
import thetis.coordsys as coordsys
from thetis.timezone import *
from thetis.forcing import *
# define model coordinate system
COORDSYS = coordsys.UTM_ZONE10
def test_time_search():
"""
Tests time search object.
Time stamps are deduced ... |
5,066 | set child | from _typeshed import Incomplete, SupportsGetItem, SupportsLenAndGetItem, Unused
from abc import abstractmethod
from collections.abc import Iterable, Iterator, MutableSequence
from typing_extensions import Final, Self, TypeAlias
from .fixer_base import BaseFix
from .pgen2.grammar import Grammar
_NL: TypeAlias = Node ... |
5,067 | test 15 minute dt index | from numpy import isnan
import pandas as pd
import pytest
from pvlib.iotools import srml
from ..conftest import (DATA_DIR, RERUNS, RERUNS_DELAY, assert_index_equal,
assert_frame_equal, fail_on_pvlib_version)
from pvlib._deprecation import pvlibDeprecationWarning
srml_testfile = DATA_DIR / 'SRM... |
5,068 | get slug | """
Serializers for the ES's search result object.
.. note::
Some fields are re-named to make their meaning more clear.
They should be renamed in the ES index too.
"""
import re
from functools import namedtuple
from operator import attrgetter
from urllib.parse import urlparse
from rest_framework import seriali... |
5,069 | agent process | import os
import signal
import sys
import tempfile
import anyio
import pytest
from prefect.settings import get_current_settings
from prefect.utilities.processutils import open_process
POLL_INTERVAL = 0.5
STARTUP_TIMEOUT = 20
SHUTDOWN_TIMEOUT = 5
async def safe_shutdown(process):
try:
with anyio.fail_af... |
5,070 | scroll to | """
`ScrollView` is a base class for [line api](/guide/widgets#line-api) widgets.
"""
from __future__ import annotations
from rich.console import RenderableType
from ._animator import EasingFunction
from ._types import CallbackType
from .containers import ScrollableContainer
from .geometry import Region, Size
clas... |
5,071 | ref roi align | # Copyright 2021 Sony Group 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 ... |
5,072 | test well known endpoints | import pytest
from constants import TRUST_STORE_BUNDLE, TRUST_STORE_TRUSTED_BUNDLE
from configuration import PROTOCOLS
from common import ProviderOptions, Ciphers, pq_enabled
from fixtures import managed_process # lgtm [py/unused-import]
from global_flags import get_flag, is_criterion_on, S2N_FIPS_MODE, S2N_USE_CRITE... |
5,073 | check no |
from vsg.rules import utils as rules_utils
from vsg.vhdlFile import utils
from vsg import violation
def check_for_carriage_return_after_token(self, oToi):
if self.value == 'ignore':
return []
elif self.value == 'no':
return METHOD_NAME(self, oToi)
elif self.value == 'yes':
return... |
5,074 | create all regions and connections | # Regions are areas in your game that you travel to.
from typing import Dict, Set
from BaseClasses import Entrance, MultiWorld, Region
from . import Locations
def add_location(player: int, loc_name: str, id: int, region: Region) -> None:
location = Locations.NoitaLocation(player, loc_name, id, region)
region... |
5,075 | add torus | # SPDX-FileCopyrightText: 2009-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
from __future__ import annotations
import bpy
from bpy.types import Operator
from bpy.props import (
BoolProperty,
EnumProperty,
FloatProperty,
IntProperty,
)
from bpy.app.translations import pgettext_da... |
5,076 | test standalone asterisks with newlines | """
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... |
5,077 | test dynamic factor with exogenous variables | """Tests the DynamicFactor model."""
import pytest
from pandas.testing import assert_frame_equal
from sktime.datasets import load_longley
from sktime.forecasting.dynamic_factor import DynamicFactor
from sktime.utils.validation._dependencies import _check_soft_dependencies
__author__ = ["yarnabrina"]
HISTORY_LENGTH =... |
5,078 | test to python from string | # -*- coding: utf-8 -*-
from datetime import datetime as dt
from decimal import Decimal
import pickle
from decimal import Decimal
from django.core import exceptions
from django.db import connection
import pytest
from nav.models.fields import CIDRField
from nav.models.fields import DateTimeInfinityField
from nav.mo... |
5,079 | all | from packaging.version import Version
try:
import torch
except ImportError as error:
message = (
"Impossible to import PyTorch.\n"
"To use TensorLy with the PyTorch backend, "
"you must first install PyTorch!"
)
raise ImportError(message) from error
import numpy as np
from .co... |
5,080 | run verifications | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
5,081 | get service account 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... |
5,082 | test function1 | #!/usr/bin/env py.test
# -*- coding: utf-8 -*-
__authors__ = "Martin Sandve Alnæs"
__date__ = "2009-02-13 -- 2009-02-13"
import pytest
import math
from ufl import *
from ufl.constantvalue import as_ufl
def testScalars():
s = as_ufl(123)
e = s((5, 7))
v = 123
assert e == v
def testZero():
s = ... |
5,083 | cleanup | # Copyright 2016 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
5,084 | normalize answer | # Copyright © 2022 BAAI. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License")
import torch
import re
from sklearn.metrics import f1_score
from collections import defaultdict
from typing import List
import functools
import string
import math
import sacrebleu
from rouge_score import rou... |
5,085 | traced yaaredis | # -*- encoding: utf-8 -*-
import os
import uuid
import pytest
import yaaredis
from ddtrace import Pin
from ddtrace.contrib.yaaredis.patch import patch
from ddtrace.contrib.yaaredis.patch import unpatch
from ddtrace.vendor.wrapt import ObjectProxy
from tests.opentracer.utils import init_tracer
from tests.utils import ... |
5,086 | sigterm context | import logbook
import signal
import sys
import dessert
from contextlib import contextmanager, ExitStack
from . import hooks as trigger_hook
from . import log
from . import site
from . import plugins
from .conf import config
from .core.session import Session
from .reporting.console_reporter import ConsoleReporter
from ... |
5,087 | curate post | from datetime import datetime, timedelta
from django.shortcuts import get_object_or_404, render, redirect
from authn.decorators.auth import require_auth, require_moderator_role, require_curator_role
from club.exceptions import AccessDenied
from comments.models import Comment
from common.data.labels import LABELS
from... |
5,088 | cmp bytes | from typing import (
Callable,
Dict,
FrozenSet,
ItemsView,
Iterable,
Iterator,
KeysView,
List,
Optional,
Tuple,
)
import cxxfilt
import graphviz
import os
from .graphs import DiGraph
class FunctionInfo:
def __init__(
self,
name: str,
METHOD_NAME: D... |
5,089 | run | import logging as log
from avocado.core import exceptions
from virttest import virsh
from virttest.libvirt_xml import vm_xml
from virttest.utils_test import libvirt
# Using as lower capital is not the best way to do, but this is just a
# workaround to avoid changing the entire file.
logging = log.getLogger('avocado... |
5,090 | projects by orgs | from urllib import parse as urlparse
from django.conf import settings
from django.contrib.gis.geos import Point
from django.contrib.gis.measure import D
from django.core.paginator import Paginator
from .common import apply_tag_filters, sort_by_field
from civictechprojects.caching.cache import ProjectSearchTagsCache
fro... |
5,091 | type | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . imp... |
5,092 | test resource not enough | import pytest
from autogluon.common.utils.resource_utils import ResourceManager
from autogluon.core.ray.resources_calculator import (
CpuResourceCalculator,
GpuResourceCalculator,
NonParallelGpuResourceCalculator,
ResourceCalculatorFactory,
)
def test_cpu_calculator_no_bottleneck():
num_cpus = 32... |
5,093 | verify square root real | # Copyright 2018 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... |
5,094 | density bandwidth | # -*- coding: utf-8 -*-
import warnings
import numpy as np
import scipy.stats
def METHOD_NAME(x, method="KernSmooth", resolution=401):
"""**Bandwidth Selection for Density Estimation**
Bandwidth selector for :func:`.density` estimation. See ``bw_method`` argument in
:func:`.scipy.stats.gaussian_kde`.
... |
5,095 | test symlinks | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
5,096 | load | import os
import uvicorn, json
from asgiref.sync import sync_to_async
import os
import random
import numpy as np
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
from cyg_conversation import covert_prompt_to_input_ids_with_history
from transformers import (
AutoTokenizer,
AutoModelFo... |
5,097 | nozip gallery file | # Copyright 2019 - Remi Ferrand
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribut... |
5,098 | test batch mode | import numpy as np
import scipy.sparse as sp
import tensorflow as tf
from spektral.data import Dataset, Graph, loaders
tf.keras.backend.set_floatx("float64")
MODES = {"SINGLE": 0, "BATCH": 1, "MIXED": 2, "DISJOINT": 3}
batch_size = 16
n_nodes = 11
n_node_features = 7
n_edge_features = 3
def _get_graph(n_nodes, n_f... |
5,099 | test trainer manual optimization config | # Copyright The Lightning AI team.
#
# 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.