id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
15,300 | test missing internal header | # Licensed under a 3-clause BSD style license - see PYFITS.rst
import numpy as np
import pytest
from astropy.io import fits
from astropy.io.fits._tiled_compression import compress_image_data
from astropy.io.fits.tests.conftest import FitsTestCase
MAX_INT = np.iinfo(np.intc).max
MAX_LONG = np.iinfo(int).max
MAX_LONGL... |
15,301 | export patterns | # =============================================================================
# Copyright (C) 2016 Ryan Holmes
#
# This file is part of pyfa.
#
# pyfa 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 v... |
15,302 | config settings loader | # -*- coding: utf-8 -*-
import re
import copy
import logging
from os import path
import saml2.xmldsig
from saml2 import BINDING_HTTP_REDIRECT, BINDING_HTTP_POST, NAMEID_FORMAT_EMAILADDRESS
from saml2.config import SPConfig
from django.utils.translation import gettext as _
from seaserv import ccnet_api
from seahub.ut... |
15,303 | data error | from typing import Sequence, Dict, Any
class RobotFrameworkFacade(object):
"""
Nothing on Robot Framework is currently typed, so, this is a facade
to help to deal with it so that we don't add lots of things to ignore its
imports/typing.
"""
@property
def get_model(self):
from robo... |
15,304 | has | from flask_caching._compat import integer_types, string_types
from flask_caching.backends.base import BaseCache, iteritems_wrapper
try:
import cPickle as pickle
except ImportError: # pragma: no cover
import pickle # type: ignore
class CustomRedisCache(BaseCache):
"""Uses the Redis key-value store as a ... |
15,305 | get name | #############################################################################
#
# Module contains an implementation of SONiC Platform Base API and
# provides the fan status which are available in the platform
#
#############################################################################
import json
import math
import... |
15,306 | eql body | import elastalert.eql as eql
from elastalert import ElasticSearchClient
from unittest import mock
def test_format_request_without_eql():
assert eql.format_request({}) is None
assert eql.format_request({'query': {}}) is None
assert eql.format_request({'query': {'bool': {}}}) is None
assert eql.format_r... |
15,307 | load doc | from __future__ import annotations
import concurrent.futures
# Import the stdlib json instead of sentry.utils.json, since this command is
# run at build time
import json # noqa: S003
import logging
import multiprocessing
import os
import sys
import time
from typing import IO, Any, TypedDict
from urllib.request impor... |
15,308 | remove dot segments | # -*- coding: utf-8 -*-
# Copyright (c) 2014 Rackspace
# 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... |
15,309 | rebin counts | import numba
import numba.experimental
import math
# Define a bin iterator to adapt to either forward or reversed inputs.
spec = [
('forward', numba.boolean),
('n', numba.int64),
('edges', numba.float64[:]),
('bin', numba.int64),
('lo', numba.float64),
('hi', numba.float64),
('atend', numba... |
15,310 | should fire | import logging
from concurrent.futures.process import ProcessPoolExecutor
from typing import Dict, List, NamedTuple, Optional, Type, Union
from hikaru.model.rel_1_26 import DaemonSet, HorizontalPodAutoscaler, Job, Node, NodeList, StatefulSet
from pydantic.main import BaseModel
from robusta.core.model.env_vars import ... |
15,311 | check config | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# LICENSE
#
# Copyright (C) 2010-2023 GEM Foundation, G. Weatherill, M. Pagani, D. Monelli
#
# The Hazard Modeller's Toolkit (openquake.hmtk) is free software: you can
# redistribute
# it and/or modify it under the terms of the GNU Affero General Pu... |
15,312 | get endpoint | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.utils.translation import ugettext_lazy as _
from django.forms.models import BaseInlineFormSet
from django.core.exceptions import ValidationError
import logging
LOG = logging.getLogger(__name__)
class InstanceModelFormSet(Ba... |
15,313 | config | import copy
from enum import Enum
from pathlib import Path
from typing import List, Optional, Union
import ruamel.yaml
import typer
import yaml
from jinja2 import ext, Template
from pydantic import BaseModel, Field
from ruamel.yaml.comments import CommentedMap
from typing_extensions import Literal
from ...utils.base... |
15,314 | test baseml 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... |
15,315 | get monitors | from collections.abc import Sequence
from typing_extensions import Final, TypeAlias
from Xlib.display import Display
from Xlib.protocol import request, rq
from Xlib.xobject import drawable, resource
_RandRModeInfo13IntSequence: TypeAlias = Sequence[int]
extname: Final = "RANDR"
RRScreenChangeNotify: Final = 0
RRNoti... |
15,316 | dispatch | from __future__ import annotations
import logging
from functools import reduce
from typing import Any, Mapping, Sequence
from urllib.parse import quote
from jwt import ExpiredSignatureError
from rest_framework.request import Request
from rest_framework.response import Response
from sentry.api.serializers import seri... |
15,317 | test ip filtering | from itertools import chain
import pytest
from conftest import assert_bash_exec, bash_env_saved
@pytest.mark.bashcomp(
cmd=None,
ignore_env="^[+-](COMPREPLY|BASH_COMPLETION_KNOWN_HOSTS_WITH_HOSTFILE)=",
)
class TestUnitKnownHostsReal:
@pytest.mark.parametrize(
"prefix,colon_flag,hostfile",
... |
15,318 | clean up | #**********************************************************************
# Copyright 2020 Advanced Micro Devices, 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.o... |
15,319 | get raw values index | import zlib
from abc import ABC, abstractmethod
from datetime import datetime
from typing import (
Any,
Iterable,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Tuple,
Union,
)
from sentry_kafka_schemas.schema_types.snuba_generic_metrics_v1 import GenericMetric
from snuba.consumer... |
15,320 | test consume bytes publishes event | from typing import Callable
from unittest.mock import MagicMock
import pytest
from agent_plugins.payloads.cryptojacker.src.memory_utilizer import (
MEMORY_CONSUMPTION_SAFETY_LIMIT,
MemoryUtilizer,
)
from common.event_queue import IAgentEventPublisher
from common.types import AgentID, PercentLimited
AGENT_ID ... |
15,321 | mock edit release | import http.client
import responses
from cumulusci.tasks.github.tests.util_github_api import GithubApiTestMixin
class MockUtilBase(GithubApiTestMixin):
BASE_HTML_URL = "https://github.com"
BASE_API_URL = "https://api.github.com"
@property
def html_url(self):
return "{}/{}/{}".format(self.BA... |
15,322 | test class | # Copyright 2022 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
15,323 | begin | # 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... |
15,324 | test add file to dataset | # Copyright (c) 2019, IRIS-HEP
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the foll... |
15,325 | adjusted norm | # 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... |
15,326 | sync | """
Sync QMP Wrapper
This class pretends to be qemu.qmp.QEMUMonitorProtocol.
"""
import asyncio
from typing import (
Any,
Awaitable,
Dict,
List,
Optional,
TypeVar,
Union,
)
import qemu.qmp
from .error import QMPError
from .protocol import Runstate, SocketAddrT
from .qmp_client import QMP... |
15,327 | write pquery | # Copyright (c) 2014 Czech National Corpus
#
# 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
# dated June, 1991.
#
# This program is distributed in the hope that it will be useful,
# b... |
15,328 | objective function simple | import unittest
import numpy as np
import warnings
from sklearn.metrics import accuracy_score
from photonai.helper.helper import PhotonDataHelper
from photonai.base import PipelineElement, Hyperpipe
from photonai.base.photon_pipeline import PhotonPipeline
from photonai.optimization import FloatRange, Categorical, Int... |
15,329 | get page and anchor | """
Interactive help system loader.
"""
import re
import webbrowser
import sublime
from sublime_plugin import WindowCommand, TextCommand
from ...common import util
re_anchor = re.compile(r"^#+ .+", flags=re.MULTILINE)
re_anchor_words = re.compile(r"[a-zA-Z0-9]+")
re_link_scope = re.compile(r"\bmeta\.link\.inline\.... |
15,330 | visit for | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
15,331 | output for node | from typing import Any, Mapping, Optional, Sequence
import dagster._check as check
from dagster._annotations import public
from dagster._core.definitions import JobDefinition, NodeHandle
from dagster._core.definitions.events import AssetKey, CoercibleToAssetKey
from dagster._core.definitions.utils import DEFAULT_OUTPU... |
15,332 | main | #!/usr/bin/env python3
import argparse
import glob
import os
import re
import subprocess
import sys
import tempfile
import xml.etree.ElementTree
USAGE = """
Compare go-ceph bindings coverage of the ceph api to available C
code.
Note that this script is not comprehensive and does not claim to be.
It only takes functi... |
15,333 | seafile get total block size | from pysearpc import searpc_func, SearpcError, NamedPipeClient
class SeafileRpcClient(NamedPipeClient):
"""RPC used in client"""
def __init__(self, socket_path, *args, **kwargs):
NamedPipeClient.__init__(
self,
socket_path,
"seafile-rpcserver",
*ar... |
15,334 | method | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
15,335 | test symdiff | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the compound module.
"""
import operator
import astropy.units as u
import numpy as np
import pytest
from astropy.coordinates import SkyCoord
from numpy.testing import assert_allclose
from regions.core import CompoundPixelRegion, PixCoord, ... |
15,336 | test function return types | import pytest
from diofant import (Equality, ImmutableMatrix, ImmutableSparseMatrix, Matrix,
SparseMatrix, Unequality, eye, false, sympify, true,
zeros)
from diofant.abc import x, y
__all__ = ()
IM = ImmutableMatrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
ieye = ImmutableMatrix(... |
15,337 | setup method | from mock import (
patch, call
)
from pytest import raises
import mock
from kiwi.package_manager.dnf4 import PackageManagerDnf4
from kiwi.exceptions import KiwiRequestError
class TestPackageManagerDnf4:
def setup(self):
repository = mock.Mock()
repository.root_dir = '/root-dir'
repo... |
15,338 | test readonly trans | # -----------------------------------------------------------------------------
# BSD 3-Clause License
#
# Copyright (c) 2020-2022, Science and Technology Facilities Council.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... |
15,339 | check diff | # Copyright 2019 Xilinx 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 agreed to in writing, ... |
15,340 | find potential spam users | import csv
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand
from rdmo.projects.models import Membership
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'-t', '--timespan', default=2, type=int,
help='... |
15,341 | rest vcenter vm vm 80 power reset | # 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 use ... |
15,342 | conjugate | # -*- coding: utf-8 -*-
"""
The free pivotal category,
i.e. diagrams with cups and caps that can rotate by a full turn.
Summary
-------
.. autosummary::
:template: class.rst
:nosignatures:
:toctree:
Ob
Ty
Diagram
Box
Cup
Cap
Category
Functor
Axioms
------
A pivotal categ... |
15,343 | fetch transaction status | # Copyright (c) 2015 Presslabs SRL
#
# 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... |
15,344 | test reduce slice empty indices rows | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
15,345 | form command | #!/usr/bin/env python
"""
Ludl stage communication.
Hazen 02/14
Edited 5/15 to add Z piezo and TCP/IP protocol
George Emanuel 5/15
"""
import http.client
import sys
import storm_control.sc_library.parameters as params
class Ludl(object):
def __init__(self, **kwds):
super().__init__(**kwds)
sel... |
15,346 | render frame | # Copyright 2020-2023 Capypara and the SkyTemple Contributors
#
# This file is part of SkyTemple.
#
# SkyTemple 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 y... |
15,347 | true pos | """Defines ``ClassEvaluationItem``."""
from typing import Optional
import numpy as np
from rastervision.core.evaluation import EvaluationItem
class ClassEvaluationItem(EvaluationItem):
"""A wrapper around a binary (2x2) confusion matrix of the form
.. line-block::
[``TN`` ``FP``]
[``FN`` ``T... |
15,348 | test analyze with analyzer | #
# Pyserini: Reproducible IR research with sparse and dense representations
#
# 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... |
15,349 | name | # 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... |
15,350 | delete experiment async | # 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 use ... |
15,351 | validate | from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import functools
import os
required_conan_version = ">=1.43.0"
class LibunifexConan(ConanFile):
name = "libunifex"
license = ("Apache-2.0", "LLVM-exception")
url = "https://github.com/conan-io/conan-center-inde... |
15,352 | sanitize docstring | """pytest configuration
Extends output capture as needed by pybind11: ignore constructors, optional unordered lines.
Adds docstring and exceptions message sanitizers: ignore Python 2 vs 3 differences.
"""
import pytest
import textwrap
import difflib
import re
import sys
import contextlib
import platform
import gc
_u... |
15,353 | set statedb nat restore done | #!/usr/bin/env python3
""""
Description: restore_nat_entries.py -- restoring nat entries table into kernel during system warm reboot.
The script is started by supervisord in nat docker when the docker is started.
It does not do anything in case neither system nor nat warm restart is enabled.
In case nat wa... |
15,354 | test process acknowledged response | from django.test import TestCase
from django.utils.crypto import get_random_string
from zentral.contrib.inventory.models import MetaBusinessUnit
from zentral.contrib.mdm.artifacts import Target
from zentral.contrib.mdm.commands import DeviceConfigured
from zentral.contrib.mdm.commands.scheduling import _finish_dep_enro... |
15,355 | gen docs | # SPDX-License-Identifier: MIT
# Copyright (c) 2019 Intel Corporation
import pwd
import pathlib
import inspect
import argparse
import importlib
import configparser
import pkg_resources
import unittest.mock
from typing import Type
def traverse_get_config(target, *args):
current = target
last = target
for l... |
15,356 | test regular templates with braces | # Copyright (C) 2004 Python Software Foundation
# Author: barry@python.org (Barry Warsaw)
# License: http://www.opensource.org/licenses/PythonSoftFoundation.php
import unittest
from string import Template
class Bag:
pass
class Mapping:
def __getitem__(self, name):
obj = self
for part in name... |
15,357 | query | from .context import Context as Context
from .METHOD_NAME import (
AND as AND, OR as OR, Query as Query, Node as Node,
ConjunctionNode as ConjunctionNode, DisjunctionNode as DisjunctionNode,
FilterNode as FilterNode)
from google.cloud import datastore
from redis import StrictRedis
from typing import (
... |
15,358 | run one step flops | import pathlib
import torch
from typing import Optional, List, Tuple
from torchbenchmark import ModelTask
import os
import sys
import time
import numpy
from components.model_analyzer.TorchBenchAnalyzer import ModelAnalyzer
from run_sweep import WORKER_TIMEOUT, WARMUP_ROUNDS, ModelTestResult, NANOSECONDS_PER_MILLISECOND... |
15,359 | all change ids | from typing import Iterable
from gaphor.core.modeling import (
ElementFactory,
PendingChange,
)
from gaphor import UML
from gaphor.core.changeset.compare import compare
from gaphor.diagram.tests.fixtures import connect
from gaphor.SysML import sysml
from gaphor.SysML.diagramitems import BlockItem, PropertyItem... |
15,360 | validate mmds | #!/usr/bin/env python3
# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Script used to generate snapshots of microVMs."""
import json
import os
import re
import shutil
import sys
import tempfile
from pathlib import Path
# Hack to be able to import test... |
15,361 | root device size | # 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.
#
# This program is distributed in the hope that it will be usefu... |
15,362 | authorize | #!/usr/bin/env python3
"""
Test program to demonstrate the remote config interfaces in
rclone.
This program can simulate
rclone config create
rclone config update
rclone config password - NOT implemented yet
rclone authorize - NOT implemented yet
Pass the desired action as the first argument th... |
15,363 | get emoji url | import os
import re
from dataclasses import dataclass
import orjson
from django.contrib.staticfiles.storage import staticfiles_storage
from django.utils.translation import gettext as _
from zerver.lib.exceptions import JsonableError
from zerver.lib.storage import static_path
from zerver.lib.upload import upload_backe... |
15,364 | to dict | # 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... |
15,365 | get resource dict | from consts import GB
class OperatorType:
CNV = "cnv"
ODF = "odf"
LSO = "lso"
LVM = "lvm"
MCE = "mce"
METALLB = "metallb"
class OperatorStatus:
FAILED = "failed"
PROGRESSING = "progressing"
AVAILABLE = "available"
class OperatorResource:
"""operator resource requirements as... |
15,366 | list | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... |
15,367 | filters | # 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... |
15,368 | test parameters | # -*- coding: utf-8 -*-
from __future__ import division
from __future__ import print_function
import os
import sys
import unittest
# noinspection PyProtectedMember
from numpy.testing import assert_allclose
from numpy.testing import assert_array_less
from numpy.testing import assert_equal
from numpy.testing import ass... |
15,369 | test allow break in code | """Test suite for testing the ForbiddenPythonSyntaxChecker."""
import astroid
import pylint.testutils
from astroid import nodes
from python_ta.checkers.forbidden_python_syntax_checker import (
ForbiddenPythonSyntaxChecker,
)
class TestForbiddenPythonSyntaxCheckerDisallowedsyntax(pylint.testutils.CheckerTestCase)... |
15,370 | do | # This module exports classes for the various canvas item types
# NOTE: This module was an experiment and is now obsolete.
# It's best to use the Tkinter.Canvas class directly.
from warnings import warnpy3k
warnpy3k("the Canvas module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
from Tkinter import Ca... |
15,371 | test selected text | # -*- coding: utf-8 -*-
#
# Copyright © Spyder Project Contributors
# Licensed under the terms of the MIT License
#
"""Tests for close brackets."""
# Third party imports
import pytest
from qtpy.QtGui import QTextCursor
# Local imports
from spyder.utils.qthelpers import qapplication
from spyder.plugins.editor.widgets.... |
15,372 | nydus snapshotter | import sys
import os
import re
import shutil
import logging
import pytest
import docker
sys.path.append(os.path.realpath("framework"))
from nydus_anchor import NydusAnchor
from rafs import RafsImage, RafsConf
from backend_proxy import BackendProxy
import utils
ANCHOR = NydusAnchor()
utils.logging_setup(ANCHOR.logging... |
15,373 | init profile | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
15,374 | get | # 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 ... |
15,375 | verify | #
# SPDX-License-Identifier: GPL-2.0-only
#
"""Helper module for GPG signing"""
import os
import bb
import subprocess
import shlex
class LocalSigner(object):
"""Class for handling local (on the build host) signing"""
def __init__(self, d):
self.gpg_bin = d.getVar('GPG_BIN') or \
bb.... |
15,376 | stop | # SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
from __future__ import absolute_import
"""
This module provides a Scheduler class scheduling execution of
a callable on a background thread.
To use a scheduler, create an instance and start it:
scheduler = schedule.Scheduler()
... |
15,377 | get module description from file | # LICENSE
#
# _This file is Copyright 2018 by the Image Processing and Analysis Group (BioImage Suite Team). Dept. of Radiology & Biomedical Imaging, Yale School of Medicine._
#
# BioImage Suite Web is licensed under the Apache License, Version 2.0 (the "License");
#
# - you may not use this software except in compl... |
15,378 | test image stim | from psychopy import visual, event, info
import pytest
import numpy as np
import shutil, os
from tempfile import mkdtemp
from psychopy.tests import utils
# Testing for memory leaks in PsychoPy classes (experiment run-time, not Builder, Coder, etc)
# The tests are too unstable to include in travis-ci at this point.
... |
15,379 | hackernews stories | # ruff: isort: skip_file
## data_ingestion_start
import requests
from dagster import asset
import pandas as pd
@asset
def METHOD_NAME():
# Get the max ID number from hacker news
latest_item = requests.get(
"https://hacker-news.firebaseio.com/v0/maxitem.json"
).json()
# Get items based on stor... |
15,380 | test substitute int arg | # Copyright 2021-2023 VMware, Inc.
# SPDX-License-Identifier: Apache-2.0
from unittest.mock import MagicMock
from vdk.internal.builtin_plugins.job_properties.inmemproperties import (
InMemPropertiesServiceClient,
)
from vdk.internal.builtin_plugins.job_properties.properties_router import (
PropertiesRouter,
)
... |
15,381 | test update token info from token list | import logging
from unittest import mock
from unittest.mock import MagicMock
from django.test import TestCase
from django.utils import timezone
from eth_account import Account
from gnosis.eth.ethereum_client import (
EthereumClient,
EthereumClientProvider,
EthereumNetwork,
)
from ...history.tests.utils ... |
15,382 | execute operations | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
15,383 | get prefix list | # 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... |
15,384 | forward | # 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 torch
import torch.nn.functional as F
from torch.nn.modules.conv import _ConvNd
from torch.nn.modules.utils import _pair
from ..ops im... |
15,385 | glut int handler | """GLUT Input hook for interactive use with prompt_toolkit
"""
from __future__ import print_function
# GLUT is quite an old library and it is difficult to ensure proper
# integration within IPython since original GLUT does not allow to handle
# events one by one. Instead, it requires for the mainloop to be entered
# ... |
15,386 | test pages kwarg specified | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
import functools
from datetime import date
from devtools_testutils import recorded_by_proxy
from azure.core.credentials import AzureKeyCred... |
15,387 | pass argument | #*****************************************************************************
# Copyright (C) 2009 Carl Witty <Carl.Witty@gmail.com>
# Copyright (C) 2015 Jeroen Demeyer <jdemeyer@cage.ugent.be>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General ... |
15,388 | probe set name starts with one of | import csv
import io
import json
from typing import Iterator, List, Tuple
from django.conf import settings
from django.core.management.base import BaseCommand
import boto3
import botocore
import requests
import rpy2.robjects as ro
from botocore.client import Config
from botocore.exceptions import ClientError
from rpy... |
15,389 | test gauss | """ Check the random module behavior. """
from pythran.tests import TestEnv
from unittest import skipIf
import sys
@TestEnv.module
class TestRandom(TestEnv):
"""
Check implementation for usual random functions.
Functions are:
- random.random
- random.gauss
- random.uniform
- random.expov... |
15,390 | tear down module | # Copyright 2016 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... |
15,391 | event | from __future__ import annotations
from enum import Enum
from typing import Any, Callable, Coroutine, Dict, Optional, Set, Union
from sanic.base.meta import SanicMeta
from sanic.models.futures import FutureSignal
from sanic.models.handler_types import SignalHandler
from sanic.signals import Event, Signal
from sanic.t... |
15,392 | test click events | import asyncio
from typing import Literal
import pytest
from selenium.webdriver.common.by import By
from nicegui import ui
from nicegui.events import ClickEventArguments
from .screen import Screen
def click_sync_no_args():
ui.label('click_sync_no_args')
def click_sync_with_args(_: ClickEventArguments):
u... |
15,393 | create | from tapiriik.database import db
from tapiriik.auth import User
from tapiriik.services import Service
import datetime
import logging
import json
from bson.objectid import ObjectId
logger = logging.getLogger(__name__)
class RollbackTask:
def __new__(cls, dbRec):
if not dbRec:
return None
... |
15,394 | format | # pyOCD debugger
# Copyright (c) 2018-2020 Arm Limited
# Copyright (c) 2021-2022 Chris Reed
# SPDX-License-Identifier: Apache-2.0
#
# 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:... |
15,395 | validate | import os
from conans import CMake, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
required_conan_version = ">=1.29.1"
class IgnitionToolsConan(ConanFile):
name = "ignition-tools"
license = "Apache-2.0"
homepage = "https://ignitionrobotics.org/libs/tools"
url = "https://github.c... |
15,396 | net wksta transport enum | from _typeshed import Incomplete
from win32.lib.pywintypes import error as error
def NetGetJoinInformation() -> tuple[str, Incomplete]: ...
def NetGroupGetInfo(server: str, groupname: str, level): ...
def NetGroupGetUsers(
server: str, groupName: str, level, resumeHandle: int = ..., prefLen: int = ...
) -> tuple[... |
15,397 | attention | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .base import *
from .features import HybridSplitQKVContainer, HybridGatedMLPContainer
from deepspeed.utils.types import ActivationFuncType, NormType
from deepspeed.model_implementations.transformers.ds_gpt import DeepSp... |
15,398 | reset doc colorizer | """Document colorizer python API"""
#pylint: disable=import-error,invalid-name,broad-except
#pylint: disable=no-member
from pyrevit import HOST_APP
from pyrevit.runtime import types
from pyrevit.framework import Media
from pyrevit.framework import List, Regex
from pyrevit.coreutils import envvars
def hex_to_brush(col... |
15,399 | slice to 0 step minus1 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
from __future__ import annotations
from typing import Tuple, Union
imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.