id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
8,900 | mag to param with op id | # Copyright (c) 2023, 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... |
8,901 | test 003 free text ending free text | from strictdoc.backend.sdoc.models.anchor import Anchor
from strictdoc.backend.sdoc.models.document import Document
from strictdoc.backend.sdoc.reader import SDReader
from strictdoc.backend.sdoc.writer import SDWriter
def test_001_free_text():
input = """
[DOCUMENT]
TITLE: Test Doc
[FREETEXT]
Hello world
[/FREET... |
8,902 | arg tester | """Generic thread tests.
Meant to be used by dummy_thread and thread. To allow for different modules
to be used, test_main() can be called with the module to use as the thread
implementation as its sole argument.
"""
import _dummy_thread as _thread
import time
import queue
import random
import unittest
from test imp... |
8,903 | default logfile | """
Execute chef in server or solo mode
"""
import logging
import os
import tempfile
import salt.utils.decorators.path
import salt.utils.path
import salt.utils.platform
log = logging.getLogger(__name__)
def __virtual__():
"""
Only load if chef is installed
"""
if not salt.utils.path.which("chef-cl... |
8,904 | make id | import sys
from collections.abc import Container, Iterable, Sequence
from types import ModuleType
from typing import Any
from typing_extensions import Literal
if sys.platform == "win32":
from _msi import *
from _msi import _Database
AMD64: bool
Win64: bool
datasizemask: Literal[0x00FF]
type_v... |
8,905 | terminate | # ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
# ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃
# ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃
# ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄... |
8,906 | main | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Quentin Stafford-Fraser
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
# Create Webfaction domains and subdomains using Ansible and the Webfac... |
8,907 | reset search buffer | import signal
import sys
from prompt_toolkit.enums import DEFAULT_BUFFER, SEARCH_BUFFER
from prompt_toolkit.filters import (HasFocus, HasSelection, Condition,
ViInsertMode, EmacsInsertMode, HasCompletions)
from prompt_toolkit.filters.cli import ViMode
from prompt_toolkit.keys import Keys
from prompt_toolkit.key_bi... |
8,908 | get next | # 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) AutoRest Code Generator.
# Changes may ... |
8,909 | download build | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
8,910 | the op | import warnings
from datetime import datetime
import pytest
from dagster import (
DagsterInvariantViolationError,
Field,
StringSource,
execute_job,
graph,
job,
op,
reconstructable,
static_partitioned_config,
)
from dagster._core.storage.tags import PARTITION_NAME_TAG
from dagster._c... |
8,911 | test diva claim | import pytest
from rotkehlchen.accounting.structures.balance import Balance
from rotkehlchen.accounting.structures.evm_event import EvmEvent
from rotkehlchen.accounting.structures.types import HistoryEventSubType, HistoryEventType
from rotkehlchen.chain.ethereum.modules.diva.constants import CPT_DIVA
from rotkehlchen.c... |
8,912 | get cookies | # -*- coding: utf-8 -*-
from future import standard_library
standard_library.install_aliases()
from builtins import object
import re
from requests import Session
import requests
import urllib.request, urllib.parse, urllib.error
from sqlalchemy import Column, Integer, String, ForeignKey
from monitorrent.db import Base, ... |
8,913 | test content parsed sanity | import datetime
from kitsune.kbforums.models import Thread
from kitsune.kbforums.tests import KBForumTestCase, PostFactory, ThreadFactory
from kitsune.sumo.templatetags.jinja_helpers import urlparams
from kitsune.sumo.urlresolvers import reverse
from kitsune.users.tests import UserFactory
from kitsune.wiki.tests impor... |
8,914 | pytest sessionstart | #!/usr/bin/env python3
#
# 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... |
8,915 | test inject user session metrics | import copy
from unittest import TestCase
from unittest.mock import Mock, patch, MagicMock
from buildpack.telemetry.metrics import (
FreeAppsMetricsEmitterThread,
PaidAppsMetricsEmitterThread,
MXVERSION_MICROMETER,
)
from lib.m2ee.version import MXVersion
class TestNegativeMemoryMetricsThrowError(TestCas... |
8,916 | execute | import re
from typing import Optional, Union
from openeo import Connection, DataCube
from openeo.rest.vectorcube import VectorCube
class DummyBackend:
"""
Dummy backend that handles sync/batch execution requests
and allows inspection of posted process graphs
"""
# Default result (can serve both ... |
8,917 | test coupled system | import unittest
import numpy as np
import openmdao.api as om
from openmdao.utils.assert_utils import assert_near_equal, assert_warning, assert_no_warning
class SubComp1(om.ExplicitComponent):
def setup(self):
self.add_input("x")
self.add_input("a")
self.add_output("z")
self.dec... |
8,918 | replace | from Tkinter import *
from idlelib import SearchEngine
from idlelib.SearchDialogBase import SearchDialogBase
import re
def METHOD_NAME(text):
root = text._root()
engine = SearchEngine.get(root)
if not hasattr(engine, "_replacedialog"):
engine._replacedialog = ReplaceDialog(root, engine)
dialo... |
8,919 | ident | #
# Module providing the `Process` class which emulates `threading.Thread`
#
# multiprocessing/process.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
# Modifications Copyright (c) 2020 Cloudlab URV
#
#
# Imports
#
import itertools
import traceback
import os
import logging... |
8,920 | func | import os
import sys
from functools import wraps
__version__ = "dev"
# Platform specifics
if sys.platform.startswith("darwin"):
USER_CONFIG_FILE = os.path.join(
os.path.expanduser("~"),
"Library",
"Containers",
"com.microsoft.Excel",
"Data",
"xlwings.conf",
)
el... |
8,921 | check heartbeats | import datetime
from celery.utils.log import get_task_logger
from django.conf import settings
from django.db import transaction
from django.db.models import DateTimeField, DurationField, ExpressionWrapper, F
from django.db.models.functions import Cast
from django.utils import timezone
from apps.heartbeat.models impor... |
8,922 | get dashboards id owners async | from _typeshed import Incomplete
from influxdb_client.service._base_service import _BaseService
class DashboardsService(_BaseService):
def __init__(self, api_client: Incomplete | None = None) -> None: ...
def delete_dashboards_id(self, dashboard_id, **kwargs): ...
def delete_dashboards_id_with_http_info(s... |
8,923 | set errno | import sys
from _typeshed import ReadableBuffer, WriteableBuffer
from abc import abstractmethod
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from ctypes import CDLL
from typing import Any, ClassVar, Generic, TypeVar, overload
from typing_extensions import Self, TypeAlias
if sys.version_i... |
8,924 | delete query connection |
from aiohttp import BasicAuth
import json
import re
from stix_shifter_utils.modules.base.stix_transmission.base_json_sync_connector import BaseJsonSyncConnector
from stix_shifter_utils.stix_transmission.utils.RestApiClientAsync import RestApiClientAsync
from stix2matcher.matcher import Pattern
from stix2matcher.matche... |
8,925 | supports external leases | # SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
from __future__ import absolute_import
import os
from glob import glob
from vdsm.storage import clusterlock
from vdsm.storage import constants as sc
from vdsm.storage import exception as se
from vdsm.storage import fileSD
from vdsm.s... |
8,926 | test build command | from unittest import mock
import pytest
from splunk_add_on_ucc_framework import main
@pytest.mark.parametrize(
"args,expected_parameters",
[
(
[],
{
"source": "package",
"config_path": None,
"addon_version": None,
... |
8,927 | process key | """
This file contains the handlers needed for glfw event handling
"""
import builtins
import glfw
from p5.core import p5
from p5.sketch.events import KeyEvent, MouseEvent
from dataclasses import dataclass
from time import time
from p5.util import keys
BUTTONMAP = {
glfw.MOUSE_BUTTON_LEFT: 1,
glfw.MOUSE_BU... |
8,928 | test get blob info legacy | # Copyright 2019 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, ... |
8,929 | raise if | # 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) AutoRest Code Generator.
# Changes ... |
8,930 | attributes | """
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""
import builtins
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.message
import typing
import typing_extensions
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor = ...
class AnyValue(goog... |
8,931 | read all | # Copyright 2017 Canonical Ltd.
# All rights reserved.
#
# Written by:
# Authors: Maciej Kisielewski <maciej.kisielewski@canonical.com>
# This is a copy of the original module located here:
# https://github.com/kissiel/gallows
import logging
import re
import select
import subprocess
import sys
import time
class In... |
8,932 | get meta fields | # 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... |
8,933 | write into | # From https://github.com/victorca25/iNNfer/blob/main/utils/utils.py
from __future__ import annotations
import math
import os
import re
from dataclasses import dataclass
from typing import List, Tuple, Union
import numpy as np
from sanic.log import logger
Size = Tuple[int, int]
"""
The width and height (in that orde... |
8,934 | validate matrix | from typing import Any, Dict, List, Optional, Sequence, Union
from antarest.core.model import JSON
from antarest.matrixstore.model import MatrixData
from antarest.matrixstore.service import ISimpleMatrixService
from antarest.study.storage.rawstudy.model.filesystem.factory import FileStudy
from antarest.study.storage.v... |
8,935 | test 04 get init details with key | """
This test file tests the lib.tokens.papertoken
This depends on lib.tokenclass
"""
from .base import MyTestCase
from privacyidea.lib.tokens.tantoken import TanTokenClass
from privacyidea.lib.token import init_token, get_tokens_paginate, import_token
from privacyidea.models import Token
OTPKEY = "313233343536373839... |
8,936 | get next planned stage | """Flow Inspector"""
from hashlib import sha256
from typing import Any
from django.conf import settings
from django.http.request import HttpRequest
from django.http.response import HttpResponse
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django.views.decorat... |
8,937 | get spec for configuration | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Visual Studio project reader/writer."""
import gyp.common
import gyp.easy_xml as easy_xml
#-------------------------------------------------------------------... |
8,938 | on getblocks | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test message sending before handshake completion.
A node should never send anything other than VERSION... |
8,939 | test matcher filters out based on bank | # Copyright (c) Meta Platforms, Inc. and affiliates.
import unittest
from threatexchange.signal_type.md5 import VideoMD5Signal
from threatexchange.signal_type.pdq import PdqSignal
from threatexchange.signal_type.index import IndexMatch
from threatexchange.content_type.photo import PhotoContent
from hmalib.common.con... |
8,940 | white diff step | #!/usr/bin/env python3
# Contest Management System - http://cms-dev.github.io/
# Copyright © 2010-2015 Giovanni Mascellani <mascellani@poisson.phc.unipi.it>
# Copyright © 2010-2018 Stefano Maggiolo <s.maggiolo@gmail.com>
# Copyright © 2010-2012 Matteo Boscariol <boscarim@hotmail.com>
# Copyright © 2013 Bernard Blackha... |
8,941 | day of month | # Copyright 2021-2022 IBM 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 writ... |
8,942 | get audit reason | import asyncio
from datetime import timedelta
from typing import List, Iterable, Union, TYPE_CHECKING, Dict, Optional
import discord
if TYPE_CHECKING:
from ..bot import Red
from ..commands import Context
__all__ = (
"mass_purge",
"slow_deletion",
"get_audit_reason",
"is_mod_or_superior",
... |
8,943 | curve to | """Pen recording operations that can be accessed or replayed."""
from fontTools.pens.basePen import AbstractPen, DecomposingPen
from fontTools.pens.pointPen import AbstractPointPen
__all__ = [
"replayRecording",
"RecordingPen",
"DecomposingRecordingPen",
"RecordingPointPen",
]
def replayRecording(re... |
8,944 | create batch group | import flame
def METHOD_NAME(
name,
frame_start,
frame_duration,
update_batch_group=None,
**kwargs
):
"""Create Batch Group in active project's Desktop
Args:
name (str): name of batch group to be created
frame_start (int): start frame of batch
frame_end (int): end ... |
8,945 | test abelian grouper | # This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# 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 derivat... |
8,946 | test help | # Copyright 2023 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
8,947 | run | #
# Copyright 2007 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... |
8,948 | record external failure | # coding=utf-8
# 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 pub... |
8,949 | get lines | import os
import platform
import shutil
import subprocess
import time
import uuid
from pathlib import Path
import pytest
import yaml
def METHOD_NAME(std_pipe):
"""Generator that yields lines from a standard pipe as they are printed."""
for line in iter(std_pipe.readline, ""):
yield line
class Shell... |
8,950 | mship has changed | #!/usr/bin/env python3
import codecs
import csv
import json
import os
import re
import sys
import unicodedata
sys.stdout = codecs.getwriter('utf-8')(sys.stdout)
CSV_FILE = os.path.join(os.path.dirname(__file__), '..', '..', 'rawdata', '2016_election', 'msp.csv')
JSON = os.path.join(os.path.dirname(__file__), '..', '... |
8,951 | urlopen | from __future__ import absolute_import
from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode
__all__ = ["RequestMethods"]
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`urllib3.HTTPC... |
8,952 | test ipv4 subnet should parse | # Copyright (C) 2009 Uninett AS
#
# This file is part of Network Administration Visualized (NAV).
#
# NAV is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 3 as published by the Free
# Software Foundation.
#
# This program is distributed in the hope t... |
8,953 | translation compare locales warning | import pytest
from pontoon.base.models import Translation, Resource
from pontoon.checks.utils import (
save_failed_checks,
get_failed_checks_db_objects,
bulk_run_checks,
)
from pontoon.checks.models import (
Error,
Warning,
FailedCheck,
)
@pytest.yield_fixture()
def translation_properties(tra... |
8,954 | test instance cropper from config | import pytest
import numpy as np
import tensorflow as tf
from sleap.nn.system import use_cpu_only
use_cpu_only() # hide GPUs for test
from sleap.nn.data import providers
from sleap.nn.data import instance_centroids
from sleap.nn.data import instance_cropping
from sleap.nn.config import InstanceCroppingConfig
def t... |
8,955 | predict | from typing import List
from federatedml.protobuf.generated.boosting_tree_model_param_pb2 import DecisionTreeModelParam
from federatedml.transfer_variable.transfer_class.homo_decision_tree_transfer_variable import \
HomoDecisionTreeTransferVariable
from federatedml.util import consts
from federatedml.ensemble impor... |
8,956 | main | #! /usr/bin/env python
# This file is part of IVRE.
# Copyright 2011 - 2023 Pierre LALET <pierre@droids-corp.org>
#
# IVRE 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
#... |
8,957 | sp help | # ../core/command/__init__.py
"""Registers the "sp" server command and all of its sub-commands."""
# =============================================================================
# >> IMPORTS
# =============================================================================
# Python Imports
# Datetime
from datetime im... |
8,958 | test hydrate local time structure | # Copyright (c) "Neo4j"
# Neo4j Sweden AB [https://neo4j.com]
#
# This file is part of Neo4j.
#
# 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... |
8,959 | load searcher | # MIT License
#
# Copyright (c) 2023 Advanced Micro Devices, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy... |
8,960 | arg to array | # -*- coding: utf-8 -*-
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
from __future__ import division
import functools
import numpy as np
from ...util import logger
from functools import wraps
def METHOD_NAME(func):
"""
... |
8,961 | pretty print | """
Jira Ticket Number(s): DEV-3653
Backfill missing solicitation date values due to timing issue of previous backfill
Expected CLI:
$ python3 usaspending_api/database_scripts/job_archive/backfill_solicitation_date.py
Purpose:
Fetch solicitation date from Broker table:
- detached_award_procurem... |
8,962 | get position | #!/usr/bin/python
#
## @file
#
# ctypes interace to a phidgets control library.
#
# Hazen 12/10
#
import time
from ctypes import *
#class ProductInformation(Structure):
# _fields_ = [("axis_bitmap", c_ubyte),
# ("ADC_resolution", c_short),
# ("DAC_resolution", c_short),
# ... |
8,963 | test hdquantiles | from __future__ import division, print_function, absolute_import
import numpy as np
import numpy.ma as ma
import scipy.stats.mstats as ms
from numpy.testing import (assert_equal, assert_almost_equal, assert_,
assert_allclose)
def test_compare_medians_ms():
x = np.arange(7)
y = x + 10
assert_almost_e... |
8,964 | dashboard cpu | import logging
import time
from bottle import Bottle, default_app
from ...toolkit import taskmanager
from ...toolkit.configuration import OptionSpec
from ...toolkit.utils import utcnow
from . import db
from . import metrics
bottle = Bottle()
logger = logging.getLogger(__name__)
workers = taskmanager.WorkerSet()
... |
8,965 | run trajectory | # -*- coding: utf-8 -*-
# Copyright (C) 2011 Rosen Diankov <rosen.diankov@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unl... |
8,966 | print result | #!/usr/local/fbcode/gcc-4.9-glibc-2.20-fb/bin/python2.7
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import commands
import subprocess
import sys
import re
import os
import time
#
# Simple logger
#... |
8,967 | test cancel series | """Test the various series sub-commands."""
import time
from pavilion import arguments
from pavilion import commands
from pavilion import plugins
from pavilion import series
from pavilion.status_file import SERIES_STATES
from pavilion.unittest import PavTestCase
class SeriesCmdTests(PavTestCase):
def setUp(sel... |
8,968 | plot gridslice | """Module for 3D Grid slice plots, using matplotlib."""
import matplotlib.pyplot as plt
from matplotlib.patches import Polygon
from matplotlib.collections import PatchCollection
from xtgeo.common import XTGeoDialog
from xtgeo.plot.baseplot import BasePlot
xtg = XTGeoDialog()
logger = xtg.functionlogger(__name__)
... |
8,969 | create adas time status | from openpilot.selfdrive.car import make_can_msg
from openpilot.selfdrive.car.gm.values import CAR
def create_buttons(packer, bus, idx, button):
values = {
"ACCButtons": button,
"RollingCounter": idx,
"ACCAlwaysOne": 1,
"DistanceButton": 0,
}
checksum = 240 + int(values["ACCAlwaysOne"] * 0xf)
... |
8,970 | execute query | import asyncio
import os
import sqlite3
from functools import wraps
from typing import Any, Callable, List, Optional, Sequence, Tuple, TypeVar
import aiosqlite
from pypika import SQLLiteQuery
from tortoise.backends.base.client import (
BaseDBAsyncClient,
BaseTransactionWrapper,
Capabilities,
Connectio... |
8,971 | test path conversion | import itertools
import platform
import re
from pathlib import Path, PurePath, PurePosixPath, PureWindowsPath
import pytest
from wandb.sdk.lib.paths import LogicalPath
from wandb.util import to_forward_slash_path
# Once upon a time I used hypothesis and fspaths to generate test cases. This was a good
# thing, and un... |
8,972 | std | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
__all__ = ("std",)
import awkward as ak
from awkward._behavior import behavior_of
from awkward._connect.numpy import UNSUPPORTED
from awkward._dispatch import high_level_function
from awkward._layout import maybe_posaxis
from awkwar... |
8,973 | save readline | import os
import sys
import codeop
import signal
import asyncio
import builtins
import traceback
try:
from ast import PyCF_ALLOW_TOP_LEVEL_AWAIT # Python 3.8+
except ImportError:
PyCF_ALLOW_TOP_LEVEL_AWAIT = 0 # Python 3.7-
try:
import readline
import rlcompleter
except ModuleNotFoundError:
readline... |
8,974 | test add source | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from azure.ai.language.questionanswering.authoring import AuthoringClient
from azure.core.credentials import AzureKeyCredential
from helpers import QnaAu... |
8,975 | activate zoom | # -*- coding: utf-8 -*-
# vispy: gallery 30
# -----------------------------------------------------------------------------
# 2014, Almar Klein
# Distributed under the terms of the new BSD License.
# -----------------------------------------------------------------------------
""" Visualization of traveling through sp... |
8,976 | reduce newlines | # SPDX-FileCopyrightText: 2009-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (c) 2009 https://www.stani.be
import inspect
import re
# regular expression constants
DEF_DOC = r'%s\s*(\(.*?\))'
DEF_SOURCE = r'def\s+%s\s*(\(.*?\)):'
RE_EMPTY_LINE = re.compile(r'^\s*\n')
RE_FLAG = re.MUL... |
8,977 | test index over non existing field | #!/usr/bin/env python
"""Collection of tests for :mod:`orion.core.io.database.pickleddb`."""
import pytest
from orion.core.io.database import Database
from orion.core.io.database.ephemeraldb import (
EphemeralCollection,
EphemeralDB,
EphemeralDocument,
)
@pytest.fixture(scope="module", autouse=True)
def ... |
8,978 | get blank translation dictionary | """Module for TranslatableModelLoader abstract base class."""
from utils.BaseLoader import BaseLoader
from utils.language_utils import get_available_languages, get_default_language
from utils.errors.CouldNotFindYAMLFileError import CouldNotFindYAMLFileError
from utils.errors.CouldNotFindMarkdownFileError import CouldN... |
8,979 | as gray | """
=========================================
Adapting gray-scale filters to RGB images
=========================================
There are many filters that are designed to work with gray-scale images but not
with color images. To simplify the process of creating functions that can adapt
to RGB images, scikit-image p... |
8,980 | add task to queue | import base64
import io
import time
import gradio as gr
from pydantic import BaseModel, Field
from modules.shared import opts
import modules.shared as shared
current_task = None
pending_tasks = {}
finished_tasks = []
recorded_results = []
recorded_results_limit = 2
def start_task(id_task):
global current_tas... |
8,981 | mpi handling | import logging
import pytest
import os
from cobaya.component import ComponentNotInstalledError
from cobaya.log import LoggedError
from cobaya import mpi
# Paths ##################################################################################
from cobaya.conventions import packages_path_env, packages_path_arg_posix... |
8,982 | test qsub n validchar | # coding: utf-8
# Copyright (C) 1994-2021 Altair Engineering, Inc.
# For more information, contact Altair at www.altair.com.
#
# This file is part of both the OpenPBS software ("OpenPBS")
# and the PBS Professional ("PBS Pro") software.
#
# Open Source License Information:
#
# OpenPBS is free software. You can redistr... |
8,983 | load parser | # Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Plain text file formats."""
from __future__ import annotations
import os
from glob import glob
from itertools import chain
from typing import Callable
from django.utils.functional import cached_property
from django.util... |
8,984 | clear policy | import pytest
import salt.modules.win_file as win_file
import salt.modules.win_lgpo as win_lgpo
import salt.utils.win_dacl as win_dacl
import salt.utils.win_lgpo_auditpol as auditpol
pytestmark = [
pytest.mark.windows_whitelisted,
pytest.mark.skip_unless_on_windows,
pytest.mark.destructive_test,
pytes... |
8,985 | parse sequential | # Copyright 2006-2016 by Peter Cock. All rights reserved.
#
# This file is part of the Biopython distribution and governed by your
# choice of the "Biopython License Agreement" or the "BSD 3-Clause License".
# Please see the LICENSE file that should have been included as part of this
# package.
"""Bio.Align support fo... |
8,986 | get snap revision json | # Packages
import flask
from canonicalwebteam.store_api.stores.snapstore import SnapPublisher
from canonicalwebteam.store_api.exceptions import StoreApiResponseErrorList
# Local
from webapp.helpers import api_publisher_session
from webapp.decorators import login_required
publisher_api = SnapPublisher(api_publisher_se... |
8,987 | display environments | # Copyright 2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... |
8,988 | add pull request and event | # Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
"""
This file contains helper classes for events.
"""
from typing import Optional, Dict
from ogr.abstract import GitProject
from packit_service.models import (
GitBranchModel,
IssueModel,
ProjectReleaseModel,
PullRequestMod... |
8,989 | get build packages | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright 2022 Canonical Ltd.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 3 as published by the Free Software Foundation.
#
# This program is distributed in t... |
8,990 | get | # 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... |
8,991 | test priority create with ns | #
# @file TestPriority.py
# @brief SBML Priority unit tests
#
# @author Akiya Jouraku (Python conversion)
# @author Sarah Keating
#
# ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ======
#
# DO NOT EDIT THIS FILE.
#
# This file was generated automatically by converting the file located... |
8,992 | compute | """
Utilities for the testing suite.
"""
from typing import List
import numpy as np
import pytest
import qcelemental as qcel
from pkg_resources import parse_version
from qcelemental.util import which, which_import
import qcengine as qcng
QCENGINE_RECORDS_COMMIT = "0e2fdb4"
def _check_qcenginerecords(return_data=F... |
8,993 | make divisible | # Copyright (c) Alibaba, Inc. and its affiliates.
# Modified from https://github.com/pytorch/vision/blob/master/torchvision/models/mobilenet.py
from torch import nn
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo import load_url as load_state_dict_from_url
__... |
8,994 | test total number of connections | # -*- coding: utf-8 -*-
#
# test_connect_fixed_total_number.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 ... |
8,995 | summary | # Copyright 2022 NVIDIA Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... |
8,996 | make or update instance | # This file is part of project Sverchok. It's copyrighted by the contributors
# recorded in the version control history of the file, available from
# its original location https://github.com/nortikin/sverchok/commit/master
#
# SPDX-License-Identifier: GPL3
# License-Filename: LICENSE
import random
import bpy
impor... |
8,997 | get pkg recursive deps | #!/usr/bin/env python
"""
This module is used to run tests with full coverage-reports.
It's a way to provide accurate -coverpkg arguments to `go test`.
To run over all packages:
buildscripts/covertest.py --tags "tag1 tag2" --testopts="-v -race"
To run over some packages:
buildscripts/covertest.py --pkgs "X"
"""
fr... |
8,998 | get executors loglinks | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
8,999 | find end of padding | import contextlib
import os
import tarfile
from pathlib import Path
from typing import Optional
from structlog import get_logger
from ...file_utils import OffsetFile, SeekError, decode_int, round_up, snull
from ...models import (
Extractor,
ExtractResult,
File,
HexString,
StructHandler,
ValidC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.