id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
9,800 | test loaded modules are loaded mods | """
Tests for salt.loader.lazy
"""
import sys
import pytest
import salt.loader
import salt.loader.context
import salt.loader.lazy
import salt.utils.files
@pytest.fixture
def loader_dir(tmp_path):
"""
Create a simple directory with a couple modules to load and run tests
against.
"""
mod_contents ... |
9,801 | run | # Impacket - Collection of Python classes for working with network protocols.
#
# Copyright (C) 2023 Fortra. All rights reserved.
#
# This software is provided under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Authors:
# Arseniy Sharoglaz... |
9,802 | images | # -*- coding: utf-8 -*-
"""
tmdbsimple.people
~~~~~~~~~~~~~~~~~
This module implements the People and Credits functionality of tmdbsimple.
Created by Celia Oakley on 2013-10-31.
:copyright: (c) 2013-2022 by Celia Oakley
:license: GPLv3, see LICENSE for more details
"""
from .base import TMDB
class People(TMDB):
... |
9,803 | get writer | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import csv
import logging
import os
import shutil
from csv import DictWriter
from typing import (
Any, Dict, FrozenSet,
)
from pyhocon import ConfigFactory, ConfigTree
from databuilder.job.base_job import Job
from databuilder... |
9,804 | publish event | import json
import logging
import signal
from django.utils.functional import cached_property
from google.api_core.exceptions import AlreadyExists
from google.cloud import pubsub_v1
logger = logging.getLogger('zentral.core.queues.backends.google_pubsub.consumer')
class BaseWorker:
name = "UNDEFINED"
subscrip... |
9,805 | is running | import errno
import os
import shlex
import socket
import signal
import tempfile
import types
from subprocess import Popen
from time import sleep
import outer_packages
import jsonrpclib
# uses Unix sockets for determine running process.
# (assumes used daemons will register proper socket)
# all daemons should use -p ar... |
9,806 | test remote timeout to here in jit | from typing import Dict, Tuple
import torch
import torch.distributed.rpc as rpc
from torch import Tensor
from torch.distributed.rpc import RRef
from torch.testing._internal.dist_utils import (
dist_init,
worker_name,
wait_until_pending_futures_and_users_flushed
)
from torch.testing._internal.distributed.rp... |
9,807 | upgrade marin | from ..assembler import ASM
def METHOD_NAME(rom):
# Show marin outside, even without a sword.
rom.patch(0x05, 0x0E78, ASM("ld a, [$DB4E]"), ASM("ld a, $01"), fill_nop=True)
# Make marin ignore the fact that you did not save the tarin yet, and allowing getting her song
rom.patch(0x05, 0x0E87, ASM("ld a... |
9,808 | test read txt file | import datetime
import numpy as np
import RAiDER
from RAiDER.losreader import (
read_ESA_Orbit_file,
read_txt_file,
cut_times,
inc_hd_to_enu,
get_sv,
getZenithLookVecs,
Conventional,
Zenith,
)
from test import *
@pytest.fixture
def svs():
T = [
datetime.datetime(2018, 11, ... |
9,809 | test infer | # Copyright 2020-2023 OpenDR European Project
#
# 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 agree... |
9,810 | test call functions | import numpy as np
from numba.core import types
from numba.cuda.testing import skip_on_cudasim, unittest, CUDATestCase
from numba import cuda
from numba.cuda import libdevice, compile_ptx
from numba.cuda.libdevicefuncs import functions, create_signature
def use_sincos(s, c, x):
i = cuda.grid(1)
if i < len(x)... |
9,811 | compile test | import os
import sys
import subprocess
import argparse
from bs4 import BeautifulSoup as bs
import requests
EXTENSION = [("py", "python", "main"), ("cpp", "cpp", "main"), ("java", "java", "Main")]
def run(command):
ret = subprocess.check_output(command, shell=True).decode('utf8')
return ret
def load_arg():
... |
9,812 | resource pathname | """macresource - Locate and open the resources needed for a script."""
from warnings import warnpy3k
warnpy3k("In 3.x, the macresource module is removed.", stacklevel=2)
from Carbon import Res
import os
import sys
import MacOS
import macostools
class ArgumentError(TypeError): pass
class ResourceFileNotFoundError(Imp... |
9,813 | test edit record | # -*- coding: utf-8 -*-
#
# This file is part of CERN Analysis Preservation Framework.
# Copyright (C) 2017 CERN.
#
# CERN Analysis Preservation Framework 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... |
9,814 | test finite diff lda partial hess high | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... |
9,815 | std weekend response | import logging
import random
import sentry_sdk
from os import getenv
from typing import Tuple
import common.dff.integration.condition as int_cnd
import common.dff.integration.context as int_ctx
import common.greeting as common_greeting
import common.scenarios.weekend as common_weekend
from common.constants import CAN_... |
9,816 | transmit | # Copyright (c) 2023, NVIDIA CORPORATION. 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... |
9,817 | tear down | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
9,818 | load parent | import json
import shutil
import logging
from banal import ensure_dict
from flask import Blueprint, request
from tempfile import mkdtemp
from werkzeug.exceptions import BadRequest
from normality import safe_filename, stringify
from servicelayer.archive.util import ensure_path
from aleph.core import db, archive
from al... |
9,819 | ctu mapping | # -------------------------------------------------------------------------
#
# Part of the CodeChecker project, under the Apache License v2.0 with
# LLVM Exceptions. See LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
# ---------------------------------------------------... |
9,820 | read profiles yml | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import argparse
import os
from typing import Any, Dict
import yaml
from normalization.destination_type import DestinationType
from normalization.transform_catalog.catalog_processor import CatalogProcessor
class TransformCatalog:
"""
To run this trans... |
9,821 | from db row | from datetime import datetime
from typing import Dict, List, Optional, Union
from hikaru.model.rel_1_26 import Job
from kubernetes.client import V1Container, V1Job, V1JobSpec, V1JobStatus, V1PodSpec
from pydantic import BaseModel
from robusta.core.discovery import utils
from robusta.core.model.pods import ContainerRe... |
9,822 | is hankaku katakana | # coding: UTF-8
# _checkCharDesc.py
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2012,2023 Takuya Nishimoto, NVDA Japanese Team
import re, codecs
from getord import getOrd
LOCALE_JA = r"..\source\locale\ja"
SY_FILE = LOCALE_JA + r"\symbols.dic"
CH_FILE = LOCALE_JA + r"\characterDescriptions.dic"
CS_FI... |
9,823 | writethread | #!/usr/bin/python
'''
This is a pseudo-server that sends predefined pattern to any connected client.
It is used to test transport behaviour and throughput.
If you want to use it with a sketch, connect your PC and Blynk-enabled device
into the same network and configure Blynk to connect to this pseudo-server:
I... |
9,824 | selftest path files | # tbot, Embedded Automation Tool
# Copyright (C) 2019 Harald Seiler
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#... |
9,825 | get presence | #!/usr/bin/env python
########################################################################
# DellEMC S5232F
#
# Module contains an implementation of SONiC Platform Base API and
# provides the Fans' information which are available in the platform.
#
##################################################################... |
9,826 | test views tasks api | """This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
"""
import json
import pytest
from projects.models import Project
from ..utils import make_annotation, make_prediction, make_task, project_id # noqa... |
9,827 | set task ids | # 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 logging
from typing import Dict, List, Optional
from pathlib import Path
import torch.nn as nn
from torch import Tensor
from fairseq im... |
9,828 | update database | # SPDX-FileCopyrightText: 2015 National CyberSecurity Center
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
This product includes GeoLite2 data created by MaxMind, available from
<a href="http://www.maxmind.com">http://www.maxmind.com</a>.
"""
import io
import sys
import pathlib
import req... |
9,829 | update existing | import json
import subprocess
import uuid
from typing import Any
import waiting
from junit_report import JunitTestCase
import consts
from assisted_test_infra.test_infra import BaseInfraEnvConfig, utils
from assisted_test_infra.test_infra.helper_classes.base_cluster import BaseCluster
from assisted_test_infra.test_inf... |
9,830 | validate | from esphome import pins
import esphome.config_validation as cv
import esphome.codegen as cg
from esphome.const import (
CONF_DOMAIN,
CONF_ID,
CONF_MANUAL_IP,
CONF_STATIC_IP,
CONF_TYPE,
CONF_USE_ADDRESS,
CONF_GATEWAY,
CONF_SUBNET,
CONF_DNS1,
CONF_DNS2,
)
from esphome.core import ... |
9,831 | test immutable creation | 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(... |
9,832 | test basic loading | # -*- coding: utf-8 -*-
# test_reader.py ---
#
# Filename: test_reader.py
# Description:
# Author:
# Maintainer:
# Created: Wed Jul 24 16:02:21 2013 (+0530)
# Version:
# Last-Updated: Sun Apr 17 16:13:01 2016 (-0400)
# By: subha
# Update #: 112
# URL:
# Keywords:
# Compatibility:
#
#
# Commentary:
#
#
#
... |
9,833 | test list all apps paginated | from unittest import mock
from unittest.mock import MagicMock
import pytest as pytest
from lightning_cloud.openapi import (
Externalv1LightningappInstance,
V1LightningappInstanceSpec,
V1LightningappInstanceState,
V1LightningappInstanceStatus,
V1LightningworkState,
V1ListLightningappInstancesRes... |
9,834 | is current | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2019 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import pkg_resources
import requests
from octoprint.util.version import (
get_comparable_version,
is_p... |
9,835 | test depth avg 1 | # Copyright 2023 Intel Corporation. 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 applicable l... |
9,836 | update docker image in script | from typing import Optional, Tuple
from demisto_sdk.commands.common.constants import (
FILETYPE_TO_DEFAULT_FROMVERSION,
TYPE_JS,
TYPE_PWSH,
FileType,
)
from demisto_sdk.commands.common.hook_validations.docker import DockerImageValidator
from demisto_sdk.commands.common.logger import logger
from demisto... |
9,837 | key cancel | from Screens.Screen import Screen
from Components.ConfigList import ConfigListScreen
from Components.config import config, ConfigSubsection, ConfigInteger, ConfigSlider, getConfigListEntry
config.plugins.VideoClippingSetup = ConfigSubsection()
config.plugins.VideoClippingSetup.clip_left = ConfigInteger(default=0)
conf... |
9,838 | function thread safety handler fn arn | import json
from time import sleep
import pytest
from tests.e2e.utils import data_fetcher
from tests.e2e.utils.data_fetcher.common import GetLambdaResponseOptions, get_lambda_response_in_parallel
@pytest.fixture
def ttl_cache_expiration_handler_fn_arn(infrastructure: dict) -> str:
return infrastructure.get("Ttl... |
9,839 | save mesh | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from collections import deque
from pathlib import Path
from typing import Deque, Optional, Union
from iopath.... |
9,840 | test object mimetype from name | import datetime
import io
import pathlib
import pytest
from werkzeug.exceptions import NotFound
from werkzeug.http import http_date
from werkzeug.test import EnvironBuilder
from werkzeug.utils import send_file
from werkzeug.utils import send_from_directory
res_path = pathlib.Path(__file__).parent / "res"
html_path =... |
9,841 | test set proc title | from __future__ import unicode_literals
from textwrap import dedent
import pytest
def test_resolve_main(mocker):
from temboardui.toolkit.proctitle import compute_main_module_name
mod = mocker.Mock(__package__='my', __name__='module')
assert 'my.module' == compute_main_module_name(mod)
mod = mocker... |
9,842 | bt jmpbuf | #
# GDB debugging support
#
# Copyright 2012 Red Hat, Inc. and/or its affiliates
#
# Authors:
# Avi Kivity <avi@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2
# or later. See the COPYING file in the top-level directory.
import gdb
VOID_PTR = gdb.lookup_type('void').pointer()
def ge... |
9,843 | test task writes config into cache | from unittest.mock import patch, sentinel
import pytest
from django.urls import reverse
from sentry.db.postgres.transactions import in_test_hide_transaction_boundary
from sentry.relay.config import ProjectConfig
from sentry.tasks.relay import build_project_config
from sentry.testutils.hybrid_cloud import simulated_tr... |
9,844 | check deduplicate by node | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from typing import List, Dict, Tuple, cast
from nni.mutable.utils import uid
from nni.common.device import GPUDevice
from nni.nas.space import GraphModelSpace, Graph, Node
from .interface import AbstractOptimizer
from .logical_plan import Abstr... |
9,845 | minigraph facts | import logging
import pytest
from ipaddress import ip_interface
from constants import ENI, VM_VNI, VNET1_VNI, VNET2_VNI, REMOTE_CA_IP, LOCAL_CA_IP, REMOTE_ENI_MAC,\
LOCAL_ENI_MAC, REMOTE_CA_PREFIX, LOOPBACK_IP, DUT_MAC, LOCAL_PA_IP, LOCAL_PTF_INTF, LOCAL_PTF_MAC,\
REMOTE_PA_IP, REMOTE_PTF_INTF, REMOTE_PTF_MAC,... |
9,846 | merge on | #
# Copyright 2002-2011 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 lat... |
9,847 | get nuvs blast | from logging import getLogger
from typing import List, TYPE_CHECKING
from zipfile import BadZipFile
from aiohttp import ClientSession
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncEngine, AsyncSession
from virtool_core.models.blast import NuvsBlast
import virtool.utils
from virtool.analyses.ut... |
9,848 | notify download | import requests
import twitter
from requests_oauthlib import OAuth1Session
from sickchill import logger, settings
from sickchill.oldbeard import common
class Notifier(object):
consumer_key = "vHHtcB6WzpWDG6KYlBMr8g"
consumer_hash = "zMqq5CB3f8cWKiRO2KzWPTlBanYmV0VYxSXZ0Pxds0E" # (consumer_secret)
REQUE... |
9,849 | get crashing thread | from __future__ import annotations
from copy import deepcopy
from dataclasses import dataclass, field
from typing import (
Any,
Callable,
Mapping,
MutableMapping,
Optional,
Protocol,
Sequence,
Set,
Tuple,
cast,
)
from sentry.utils.safe import PathSearchable, get_path
# mypy h... |
9,850 | set select path | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#******************************************************************************
# ZYNTHIAN PROJECT: Zynthian GUI
#
# Zynthian GUI Midi-Channel Selector Class
#
# Copyright (C) 2015-2016 Fernando Moyano <jofemodo@zynthian.org>
#
#**********************************************... |
9,851 | arr to similarity mat | # Copyright (c) 2020-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 agre... |
9,852 | current theme id | # -*- coding: utf-8 -*-
import json
from functools import wraps
from urllib.parse import unquote, urljoin, urlparse
import flask
import flask_themes2
from pyload.core.api import Perms, Role, has_permission
class JSONEncoder(json.JSONEncoder):
def default(self, obj):
try:
return dict(obj)
... |
9,853 | build conv2d | # 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... |
9,854 | test l10n uk | # python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2... |
9,855 | export sparse model | # 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... |
9,856 | tear down module | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... |
9,857 | main | # 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 ... |
9,858 | find visible by css | import os
import random
import subprocess
import unittest
from pathlib import Path
from django.conf import settings
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
... |
9,859 | 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
__all__ =... |
9,860 | early | ######################################################################
#
# File: test/unit/v1/test_version_utils.py
#
# Copyright 2019 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
from __future__ imp... |
9,861 | cmake cache entry | # Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import socket
import llnl.util.tty as tty
from spack.package import *
def METHOD_NAME(name, value, vtype=No... |
9,862 | test add or update event tag | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Tests for the fake storage writer."""
import os
import unittest
from plaso.containers import events
from plaso.lib import definitions
from plaso.storage.sqlite import writer as sqlite_writer
from tests import test_lib as shared_test_lib
from tests.storage import test... |
9,863 | test no message alert | from zerver.lib.test_classes import WebhookTestCase
class GrafanaHookTests(WebhookTestCase):
STREAM_NAME = "grafana"
URL_TEMPLATE = "/api/v1/external/grafana?&api_key={api_key}&stream={stream}"
WEBHOOK_DIR_NAME = "grafana"
# Note: Include a test function per each distinct message condition your integ... |
9,864 | mkurl pypi url | import itertools
import logging
import os
import posixpath
import urllib.parse
from typing import List
from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.models.index import PyPI
from pip._internal.utils.compat import has_tls
from pip._internal.utils.misc import normalize_path, redact_auth_f... |
9,865 | test pretend main | import logging
import os
import sys
from unittest.mock import Mock
import pytest
from pyscaffold import cli
from pyscaffold.exceptions import ErrorLoadingExtension
from pyscaffold.file_system import localize_path as lp
from .log_helpers import find_report
if sys.version_info[:2] >= (3, 8):
# TODO: Import direct... |
9,866 | synchronize neuropixel streams | import numpy as np
def get_neuropixels_sample_shifts(num_channels=384, num_channels_per_adc=12, num_cycles=None):
"""
Calculates the relative sampling phase of each channel that results
from Neuropixels ADC multiplexing.
This information is needed to perform the preprocessing.phase_shift operation.
... |
9,867 | monitor | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
9,868 | test abort handler | # Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
import glob
import os
import shutil
import time
import unittest
import warnings
from pathlib import Path
from pymatgen.io.cp2k.inputs import Keyword, KeywordList
from pymatgen.io.cp2k.sets import StaticSet
from custodian.cp2... |
9,869 | request and response | """Tests HTTP requests between a server and a client."""
import json
from testplan.common.utils.context import context
from testplan.testing.multitest import MultiTest, testsuite, testcase
from testplan.testing.multitest.driver.http import (
HTTPServer,
HTTPClient,
HTTPResponse,
)
@testsuite
class HTTPT... |
9,870 | docker ksql cli session | import os
import uuid
import shlex
import tempfile
import subprocess
from functools import reduce
from itertools import dropwhile
from pprint import pprint
from util import in_base_dir
def get_file_name(f):
base = os.path.splitext(f)[0]
file_name = os.path.split(base)[-1]
return file_name
def make_spool... |
9,871 | path to string | from numbers import Number
from collections import Counter
from RLTest import Env
from redis.commands.graph import Graph
from redis.commands.graph.node import Node
from redis.commands.graph.edge import Edge
from redis.commands.graph.path import Path
# Returns True if value is a number or string representation of a nu... |
9,872 | get object | from django.http import Http404
from django.utils.functional import cached_property
from django_filters import rest_framework as filters
from django_scopes import scopes_disabled
from rest_framework import viewsets
from pretalx.api.serializers.submission import (
ScheduleListSerializer,
ScheduleSerializer,
... |
9,873 | test | """Implementation of the model used for the FEMNIST experiments."""
from logging import INFO
from typing import Optional, Tuple
import torch
import torch.nn as nn
from flwr.common.logger import log
from torch import Tensor
from torch.utils.data import DataLoader
class Net(nn.Module):
"""Implementation of the m... |
9,874 | test handle | from pathlib import Path
from datetime import date
from io import StringIO
import os
import pytest
import boto3 # noqa
from django.core.management import call_command, CommandError
from django.utils import timezone
from sqlite_utils import Database
from ..models import SiteCheck
from ...accounts import models as ac... |
9,875 | document auto populated param | # Copyright 2015 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... |
9,876 | test gentoo repo | import pytest
from pkgcheck import checks as checks_mod
from pkgcheck import objects, results
from ..misc import init_check
def test_checks():
"""Scan through all public checks and verify various aspects."""
for name, cls in objects.CHECKS.items():
assert cls.known_results, f"check class {name!r} doe... |
9,877 | test creation bad type | # Copyright 2021-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 ... |
9,878 | rotation2 | # coding: utf-8
# /*##########################################################################
#
# Copyright (C) 2016-2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... |
9,879 | set input tensor | # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
"""T5 model."""
import torch
from megatron import get_args
from megatron.core import tensor_parallel
from megatron.model.enums import AttnMaskType
from megatron.model.language_model import parallel_lm_logits, get_language_model
from megatron.model import... |
9,880 | test no holidays | # python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: dr-prodigy <dr.prodigy.github@gmail.com> (c) 2... |
9,881 | impl | # Copyright 2018 The Bazel 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 applicable la... |
9,882 | 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... |
9,883 | wrk data | #!/usr/bin/python3
import sys
import re
import subprocess
wrkcmd = 'wrk'
separator = ';'
def METHOD_NAME(wrk_output):
return str(wrk_output.get('lat_avg')) + separator + str(wrk_output.get('lat_stdev')) + separator + str(
wrk_output.get('lat_max')) + separator + str(wrk_output.get('req_avg')) + separator... |
9,884 | set transaction name and source | from __future__ import absolute_import
from sentry_sdk.hub import Hub
from sentry_sdk.integrations import Integration, DidNotEnable
from sentry_sdk.integrations._wsgi_common import RequestExtractor
from sentry_sdk.integrations.wsgi import SentryWsgiMiddleware
from sentry_sdk.tracing import SOURCE_FOR_STYLE
from sentry... |
9,885 | test pipe inference schedule laststage | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import pytest
import deepspeed.runtime.pipe.schedule as schedule
def _count_type(cmds, classtype):
return len(list(filter(lambda c: type(c) == classtype, cmds)))
def test_pipe_inference_schedule_singlestage():
sc... |
9,886 | i n classb | # Generated by h2py from /usr/include/netinet/in.h
IPPROTO_IP = 0
IPPROTO_HOPOPTS = 0
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
IPPROTO_GGP = 3
IPPROTO_IPV4 = 4
IPPROTO_IPIP = IPPROTO_IPV4
IPPROTO_TCP = 6
IPPROTO_ST = 7
IPPROTO_EGP = 8
IPPROTO_PIGP = 9
IPPROTO_RCCMON = 10
IPPROTO_NVPII = 11
IPPROTO_PUP = 12
IPPROTO_ARGUS = 13
... |
9,887 | get view | # 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... |
9,888 | test compiling gates different sampling number | import pytest
import numpy as np
from numpy.testing import assert_array_equal
from scipy import integrate
from qutip_qip.compiler.gatecompiler import _default_window_t_max
from qutip_qip.device import (
DispersiveCavityQED, CircularSpinChain, LinearSpinChain)
from qutip_qip.compiler import (
SpinChainCompiler,... |
9,889 | get raw point | import unittest
from unittest.mock import patch
import numpy as np
import xarray as xr
from data.calculated import CalculatedArray, CalculatedData
from data.variable import Variable
from data.variable_list import VariableList
class TestCalculatedData(unittest.TestCase):
@patch("data.sqlite_database.SQLiteDataba... |
9,890 | enqueue events for all sites | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
"""
Events:
always
daily
monthly
weekly
"""
# imports - standard imports
import os
import random
import time
from typing import NoReturn
# imports - module imports
import frappe
from frappe.utils import cint, get_date... |
9,891 | block | # 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... |
9,892 | test removing twice | from datetime import datetime
from unittest.mock import patch
import pytest
from szurubooru import api, db, errors, model
from szurubooru.func import posts
@pytest.fixture(autouse=True)
def inject_config(config_injector):
config_injector(
{"privileges": {"posts:favorite": model.User.RANK_REGULAR}}
)... |
9,893 | test unicode error | """
tests.unit.utils.cache_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test the salt cache objects
"""
import logging
import pathlib
import time
import pytest
import salt.loader
import salt.payload
import salt.utils.cache as cache
import salt.utils.data
import salt.utils.files
from tests.support.mock import patch
... |
9,894 | get alive checked torrents | from __future__ import annotations
import random
from binascii import unhexlify
from typing import List, TYPE_CHECKING
from ipv8.lazy_community import lazy_wrapper
from pony.orm import db_session
from tribler.core.components.metadata_store.remote_query_community.remote_query_community import RemoteQueryCommunity
fro... |
9,895 | 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 . im... |
9,896 | test ll82 pd2 | # pylint: disable=missing-module-docstring,missing-class-docstring,missing-function-docstring
import numpy as np
from PySDM import Formulae
from PySDM.physics.constants import si
class TestFragmentationFunctions: # pylint:disable=too-few-public-methods
@staticmethod
def test_straub_sigma1():
# arran... |
9,897 | test write contig refs two groups | from io import StringIO
from pathlib import Path
from Bio import SeqIO
from pytest import fixture, mark
from micall.core.denovo import write_contig_refs, denovo, DEFAULT_DATABASE, genotype
from micall.blast_db.make_blast_db import make_blast_db, DEFAULT_PROJECTS
@fixture(scope='session', name='hcv_db')
def check_hc... |
9,898 | process | # SPDX-FileCopyrightText: 2023 by Bundesamt für Sicherheit in der Informationstechnik (BSI)
#
# SPDX-License-Identifier: AGPL-3.0-or-later
# -*- coding: utf-8 -*-
"""
Copyright (c) 2023 by Bundesamt für Sicherheit in der Informationstechnik (BSI)
Software engineering by BSI & Intevation GmbH
This file tests IntelMQ b... |
9,899 | write code | import os
import keopscore.config.config
from keopscore.config.config import get_build_folder
from keopscore.utils.code_gen_utils import get_hash_name
from keopscore.utils.misc_utils import KeOps_Error, KeOps_Message
from keopscore.config.config import cpp_flags
class LinkCompile:
"""
Base class for compilin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.