id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
16,600 | test deduct v3io paths | # Copyright 2023 Iguazio
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... |
16,601 | draw choice pseudostate | """Pseudostate diagram items.
See also gaphor.UML.states package description.
"""
from gaphas.item import SE
from gaphor import UML
from gaphor.core.modeling.properties import relation_one
from gaphor.diagram.presentation import ElementPresentation, Named
from gaphor.diagram.shapes import Box, IconBox, Text, ellipse... |
16,602 | test concat reorder nested | # 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... |
16,603 | test submission export with mixed fields | from datetime import datetime
from django.test import TestCase, tag
from django.utils import timezone
from freezegun import freeze_time
from openforms.forms.tests.factories import FormFactory, FormStepFactory
from openforms.variables.constants import FormVariableSources
from ..exports import create_submission_expor... |
16,604 | parse spec | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import os.path
from pathlib import Path, PurePath
from typing import Iterable
from pants.base.build_environment import get_buildroot
from pants.base.gl... |
16,605 | extract data | # 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 ... |
16,606 | diff dir | #!/usr/bin/env python
#
# scons-diff.py - diff-like utility for comparing SCons trees
#
# This supports most common diff options (with some quirks, like you can't
# just say -c and have it use a default value), but canonicalizes the
# various version strings within the file like __revision__, __build__,
# etc. so that ... |
16,607 | tear down | import unittest
from unittest.mock import patch, Mock
from flask import Flask
from lemur.plugins.lemur_acme import plugin, ultradns
from requests.models import Response
class TestUltradns(unittest.TestCase):
@patch("lemur.plugins.lemur_acme.plugin.dns_provider_service")
def setUp(self, mock_dns_provider_serv... |
16,608 | render | from django.core.exceptions import ValidationError
from multiupload.fields import MultiUploadMetaField, MultiUploadMetaInput
from django import forms
from django.utils.translation import gettext as _, gettext_lazy as _L
from dal import autocomplete
from . import models
# Django 2 fix (https://github.com/Chive/django-m... |
16,609 | process record message | """Abstract base class for stream mapper plugins."""
from __future__ import annotations
import abc
import typing as t
import click
import singer_sdk._singerlib as singer
from singer_sdk.helpers._classproperty import classproperty
from singer_sdk.helpers.capabilities import CapabilitiesEnum, PluginCapabilities
from ... |
16,610 | test cp14861 | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
'''
Calls to constructor.
'''
import unittest
from iptest import IronPythonTestCase, run_test, skipUnlessIronP... |
16,611 | alpha test | import numpy as np
from ...shader_base import Nodes
from ..source2_shader_base import Source2ShaderBase
class VRGeneric(Source2ShaderBase):
SHADER: str = 'vr_standard.vfx'
@property
def color_texture(self):
texture_path = self._material_resource.get_texture_property('g_tColor', None)
if ... |
16,612 | update core | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
16,613 | basic auth credentials | """Utility functions."""
import hashlib
import re
import uuid as _uuid
from base64 import b64decode, b64encode
from collections.abc import Callable, Hashable, Iterable, Iterator
from typing import cast, TypeVar
import bottle
import requests
from cryptography.hazmat.backends import default_backend, openssl
from crypto... |
16,614 | get project | # copytrue (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applicab... |
16,615 | main | # pywws - Python software for USB Wireless Weather Stations
# http://github.com/jim-easterbrook/pywws
# Copyright (C) 2008-21 pywws contributors
# 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;... |
16,616 | advection | r"""Conjugate heat transfer.
The forced convection example can be extended to conjugate heat transfer by
giving a finite thickness and thermal conductivity to one of the walls.
The example is modified to a configuration for which there is a fully developed
solution which can be found in closed form: given a uniform (... |
16,617 | url parameters | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
16,618 | move to | import sys
import time
from typing import TYPE_CHECKING, Callable, Dict, Iterable, List, Union
if sys.version_info >= (3, 8):
from typing import Final
else:
from typing_extensions import Final # pragma: no cover
from .segment import ControlCode, ControlType, Segment
if TYPE_CHECKING:
from .console impor... |
16,619 | test when not testing and successful changed | """
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
import pytest
import salt.modules.chef
import salt.states.chef as chef
from tests.support.mock import MagicMock, create_autospec, patch
@pytest.fixture
def configure_loader_modules():
return {chef: {"__salt__": {}}}
@pytest.fixture(
params=[
... |
16,620 | test make con | """
:codeauthor: Gareth J. Greenaway <gareth@saltstack.com>
"""
import copy
import logging
import pytest
from saltfactories.utils import random_string
import salt.proxy.netmiko_px as netmiko_proxy
from tests.support.mock import MagicMock, patch
log = logging.getLogger(__name__)
@pytest.fixture(scope="module")... |
16,621 | test config exclude with subdirectory | import platform
from pathlib import Path
from typing import Mapping
import pytest
from copier.main import run_copy
from copier.template import DEFAULT_EXCLUDE
from copier.types import StrOrPath
from .helpers import PROJECT_TEMPLATE, build_file_tree
def test_exclude_recursive(tmp_path: Path) -> None:
"""Copy is... |
16,622 | is gpu compute event | import contextlib
import time
import os
import json
import torch
from torch.profiler import profile, ProfilerActivity
def synchronize():
pass
def dump_chrome_trace(f, input, trace_filename, optimize_ctx, activities, num_runs=1,
devices=None, kwargs_for_f=None, kwargs_for_profiler=None):
... |
16,623 | return bpod | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author: Niccolò Bonacchi
# @Date: Monday, December 9th 2019, 1:32:54 pm
# Rotary Encoder State Machine handler
import logging
import struct
import numpy as np
import serial
from pybpodapi.protocol import Bpod, StateMachine
from pybpod_rotaryencoder_module.module import R... |
16,624 | test s3 none object size failed validation | import pytest
from aws_lambda_powertools.utilities.parser import ValidationError
from aws_lambda_powertools.utilities.parser.models import S3Model, S3RecordModel
from tests.functional.utils import load_event
def test_s3_trigger_event():
raw_event = load_event("s3Event.json")
parsed_event: S3Model = S3Model(*... |
16,625 | unregister | #
# This file is part of Dragonfly.
# (c) Copyright 2007, 2008 by Christo Butcher
# Licensed under the LGPL.
#
# Dragonfly is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the ... |
16,626 | start | from __future__ import annotations
import functools
import socket
import struct
import threading
import time
import traceback
from typing import Optional, Tuple
import numpy as np
from .... import __rootdir__
from ...log import logger
from ..adb_client import ADBClient
from ..adb_client.socket import Socket
from . i... |
16,627 | set up class | #!/usr/bin/env python3
import copy
import json
import os
import unittest
import random
from PIL import Image, ImageDraw, ImageFont
from cereal import log, car
from cereal.messaging import SubMaster
from openpilot.common.basedir import BASEDIR
from openpilot.common.params import Params
from openpilot.selfdrive.controls... |
16,628 | test methods raise | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Li... |
16,629 | test get models which should be exported | # Copyright 2018 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
16,630 | test model with contrasts reg l2 | from __future__ import annotations
from pathlib import Path
from click.testing import CliRunner
import pytest
from nidm.experiment.tools.nidm_linreg import linear_regression
def test_simple_model(brain_vol_files: list[str]) -> None:
runner = CliRunner()
with runner.isolated_filesystem():
r = runner.in... |
16,631 | tpu command parser | #!/usr/bin/env python
# Copyright 2022 The HuggingFace Team. 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
#
# Unles... |
16,632 | set url | from __future__ import absolute_import, division, unicode_literals
from future.builtins import str
""" robotparser.py
Copyright (C) 2000 Bastian Kleineidam
You can choose between two licenses when using this package:
1) GNU GPLv2
2) PSF license for Python 2.2
The robots.txt Exclusion Protocol is... |
16,633 | resolve route target list | import graphene
from ipam import models
from utilities.graphql_optimizer import gql_query_optimizer
from netbox.graphql.fields import ObjectField, ObjectListField
from .types import *
class IPAMQuery(graphene.ObjectType):
asn = ObjectField(ASNType)
asn_list = ObjectListField(ASNType)
def resolve_asn_li... |
16,634 | test array 1d record npm | import numpy as np
from numba import njit
import unittest
from numba.core.compiler import compile_isolated, Flags
from numba.core import types, errors
from numba.tests.support import TestCase, MemoryLeakMixin, tag
from numba.np import numpy_support
enable_pyobj_flags = Flags()
enable_pyobj_flags.enable_pyobject = Tru... |
16,635 | test check version failure warning | import logging
from mock import (
patch, call
)
from pytest import (
raises, fixture
)
from collections import namedtuple
from kiwi.utils.command_capabilities import CommandCapabilities
from kiwi.exceptions import KiwiCommandCapabilitiesError
class TestCommandCapabilities:
@fixture(autouse=True)
def... |
16,636 | register | # Copyright (C) 2023 Elizabeth Esswein, Sartography
#
# This file is part of SpiffWorkflow.
#
# SpiffWorkflow is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 3.0 of the License, or (at ... |
16,637 | makedirs | import re
import os
import errno
import shutil
import logging
from argparse import ArgumentDefaultsHelpFormatter
logger = logging.getLogger(__name__)
class MiCallFormatter(ArgumentDefaultsHelpFormatter):
def _fill_text(self, text, width, indent):
import textwrap
lines = text.splitlines(keepends=T... |
16,638 | host | import discord
from redbot.core import commands
from redbot.core.utils import chat_formatting as chat
from tabulate import tabulate
from ..abc import CompositeMetaClass, MixinMeta
concurrency = commands.MaxConcurrency(1, per=commands.BucketType.default, wait=False)
def levelerset_concurrency():
"""Custom concur... |
16,639 | read | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
16,640 | main | #!/usr/bin/env python3
"""Generate Mobile Phone Regex
Usage:
generate-mobile-phone-regex.py -d [-i INPUT]
generate-mobile-phone-regex.py [-i INPUT [-o OUTPUT] [-O OUTPUT2]]
Options:
-i --input INPUT Input XML file path with phone information for all regions (from `libphonenumber`)
... |
16,641 | add edge to | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... |
16,642 | hook fwrite | from pandare import Panda
from rich import print, inspect
from sys import argv
arch = argv[1]
panda = Panda(generic=arch)
'''
the arm generic image does not have "curl"
we could install it OR we could show that it doesn't
matter which program we use
'''
if arch == "arm":
program_name = "wget"
# I tried and c... |
16,643 | test from file download | import json
from base64 import encodebytes
from shutil import which
import pytest
from nbformat import writes
from nbformat.v4 import new_code_cell, new_markdown_cell, new_notebook, new_output
from tornado.httpclient import HTTPClientError
from ..utils import expected_http_error
png_green_pixel = encodebytes(
b"... |
16,644 | get parameter | #
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
16,645 | capture data | # NanoVNASaver
#
# A python program to view and export Touchstone data from a NanoVNA
# Copyright (C) 2019, 2020 Rune B. Broberg
# Copyright (C) 2020,2021 NanoVNA-Saver Authors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publi... |
16,646 | nastran to tecplot | """
defines:
- tecplot = nastran_to_tecplot(model)
- tecplot = nastran_to_tecplot_filename(bdf_filename, tecplot_filename, z
log=None, debug=False)
"""
import numpy as np
from pyNastran.bdf.bdf import BDF
from pyNastran.converters.tecplot.tecplot import Tecplot, Zone
def ME... |
16,647 | links | #!/usr/bin/env python3
"""
Convert a yaml project list into a nice table.
Suggested usage:
./bin/projects.py docs/data/projects.yml --online --auth $GITHUB_API_TOKEN
git diff
"""
from __future__ import annotations
import builtins
import functools
import textwrap
import urllib.request
import xml.dom.minidom... |
16,648 | test reduce from model parallel region | from megatron.core.tensor_parallel import mappings
from tests.unit_tests.test_utilities import Utils
import torch
def test_CopyToModelParallelRegion():
Utils.initialize_model_parallel(4,2)
input_data = torch.ones((1)).cuda()*Utils.rank
output_data = mappings._CopyToModelParallelRegion.backward(None, input_... |
16,649 | test process template | from typing import Callable, List
import pytest
from wikidict.render import parse_word
from wikidict.stubs import Definitions
from wikidict.utils import process_templates
@pytest.mark.parametrize(
"word, pronunciations, definitions, variants",
[
("auto", [], ["automatisk; självgående", "automatiskt ... |
16,650 | get connection id | """
This module defines the base class for connection handling, and helper
functions used in our communication protocol.
Copyright 2013 Red Hat, Inc.
Licensed under the GNU General Public License, version 2 as
published by the Free Software Foundation; see COPYING for details.
"""
__author__ = """
olichtne@redhat.com... |
16,651 | on result | from android.runnable import run_on_ui_thread
from jnius import autoclass
from jnius import java_method
from jnius import PythonJavaClass
from plyer.facades import STT
from plyer.platforms.android import activity
ArrayList = autoclass('java.util.ArrayList')
Bundle = autoclass('android.os.Bundle')
Context = autoclass... |
16,652 | check pg | """ Handler functions and routing for diagnostics
"""
import asyncio
import logging
from contextlib import suppress
from typing import Any
from aiohttp import ClientError, ClientSession, web
from models_library.app_diagnostics import AppStatusCheck
from models_library.utils.pydantic_tools_extension import FieldNotReq... |
16,653 | draw | import numpy as np
from .shape import ShapeStim
from ..event import Mouse
from ..core import Clock
class ROI(ShapeStim):
"""
A class to handle regions of interest for eyetracking, is essentially a :class:`~psychopy.visual.polygon` but
with some extra methods and properties for interacting with eyetrackin... |
16,654 | stub update function configuration | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Stub functions that are used by the AWS Lambda unit tests.
When tests are run against an actual AWS account, the stubber class does not
set up stubs and passes all calls through to the Boto 3 client.
"""
fr... |
16,655 | incident | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""Sentine... |
16,656 | stackio | """ BlueSky Datalogger """
# ToDo: Add description in comments
import numbers
import itertools
from datetime import datetime
import numpy as np
from bluesky import settings, stack
from bluesky.core import varexplorer as ve
import bluesky as bs
from bluesky.stack import command
# Register settings defaults
settings.s... |
16,657 | delighted dataset | from typing import Any, Dict, Generator
import pydash
import pytest
import requests
from requests import Response
from sqlalchemy.orm import Session
from fides.api.cryptography import cryptographic_util
from fides.api.models.connectionconfig import (
AccessLevel,
ConnectionConfig,
ConnectionType,
)
from f... |
16,658 | task creator | from django.contrib import messages
from django.contrib.auth.decorators import login_required
from django.contrib.messages import constants
from django.shortcuts import redirect, render
from django.urls import reverse
from django_q.tasks import async_task
from dfirtrack_main.async_messages import message_user
from dfi... |
16,659 | update w | #!/usr/bin/python
#
# Copyright (C) Christian Thurau, 2010.
# Licensed under the GNU General Public License (GPL).
# http://www.gnu.org/licenses/gpl.txt
"""
PyMF Non-negative Matrix Factorization.
NMF: Class for Non-negative Matrix Factorization
[1] Lee, D. D. and Seung, H. S. (1999), Learning the Parts of Object... |
16,660 | strsignal | import sys
from _typeshed import structseq
from collections.abc import Callable, Iterable
from enum import IntEnum
from types import FrameType
from typing import Any
from typing_extensions import Final, Never, TypeAlias, final
NSIG: int
class Signals(IntEnum):
SIGABRT: int
SIGEMT: int
SIGFPE: int
SIGI... |
16,661 | build | # 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 inspect
import os
from typing import List
import llnl.util.filesystem as fs
import spack.builder
import spack.pack... |
16,662 | uses base tear down | # Copyright 2020 Google Inc. 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 law or agre... |
16,663 | is active | from pathlib import Path
from typing import Callable, Optional
from paramiko import SSHException
from scp import SCPException
import consts
from assisted_test_infra.test_infra.controllers.node_controllers import ssh
from assisted_test_infra.test_infra.controllers.node_controllers.disk import Disk
from service_client ... |
16,664 | test gosper sum algebraic | """Tests for Gosper's algorithm for hypergeometric summation.
Some tests were taken from :cite:`Petkovsek1997AeqB`.
"""
from diofant import Rational, binomial, factorial, pi, sin, sqrt
from diofant.abc import a, b, k, m, n, r, x
from diofant.concrete.gosper import gosper_sum
__all__ = ()
def test_gosper_sum():
... |
16,665 | test delete default rule | #
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 Raphael Michel and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# 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 ... |
16,666 | test size is one | #! /usr/bin/env python
import numpy as np
import pytest
from numpy.testing import assert_array_equal
from landlab.field.graph_field import FieldDataset
def test_init():
ds = FieldDataset("node")
assert ds.size is None
assert ds.fixed_size is True
assert list(ds) == []
assert len(ds) == 0
def te... |
16,667 | build schema on 200 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
16,668 | send request | import asyncio
import inspect
import json
import secrets
from collections import defaultdict
from datetime import timedelta
from decimal import Decimal
from aiohttp import ClientSession
from anyio import Semaphore
from dateutil.parser import isoparse
from fastapi import HTTPException
from starlette.concurrency import ... |
16,669 | split tag | # Stubs for xlrd.xlsx (Python 3)
#
# NOTE: This dynamically typed stub was automatically generated by stubgen.
from .timemachine import *
from typing import Any, Optional
DEBUG: int
DLF: Any
ET: Any
ET_has_iterparse: bool
Element_has_iter: bool
def ensure_elementtree_imported(verbosity: Any, logfile: Any) -> None: .... |
16,670 | create resource | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
16,671 | get step space | #!/usr/bin/env python
"""
_Executor_
Interface definition for a step executor
"""
from __future__ import absolute_import
from builtins import object
import json
import logging
import os
import subprocess
import sys
from Utils.FileTools import getFullPath
from Utils.PythonVersion import PY3
from Utils.Utilities imp... |
16,672 | test general page loader missing template value | from os.path import join, dirname
from django.conf import settings
from django.test import override_settings
from tests.BaseTestWithDB import BaseTestWithDB
from general.models import GeneralPage
from general.management.commands._GeneralPagesLoader import GeneralPagesLoader
from utils.errors.CouldNotFindYAMLFileError i... |
16,673 | get cost allocation rule output | # 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... |
16,674 | test add readonly field | #-*- coding: utf-8 -*-
"""
.. codeauthor:: Rinze de Laat <delaat@delmic.com>
Copyright © 2014 Rinze de Laat, Delmic
This file is part of Odemis.
.. license::
Odemis is free software: you can redistribute it and/or modify it under the
terms of the GNU General Public License version 2 as published by the Free... |
16,675 | valid step | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import logging
import os
import nu... |
16,676 | on revealroles role | from __future__ import annotations
import random
import re
from typing import Optional
from src.containers import UserSet, UserDict
from src.decorators import command
from src.events import Event, event_listener
from src.functions import get_players, get_all_players, get_main_role, get_all_roles, get_target, change_r... |
16,677 | test find stem | """Test nimare.utils."""
import logging
import os
import os.path as op
import nibabel as nib
import numpy as np
import pytest
from nimare import utils
def METHOD_NAME():
"""Test nimare.utils._find_stem."""
test_array = [
"/home/data/dataset/file1.nii.gz",
"/home/data/dataset/file2.nii.gz",
... |
16,678 | destroy | import logging
from core.permissions import ViewClassPermission, all_permissions
from django.db.models import CharField, Count, Q
from django.db.models.functions import Cast
from django.utils.decorators import method_decorator
from django_filters.rest_framework import DjangoFilterBackend
from drf_yasg.utils import swa... |
16,679 | get info | # Copyright Contributors to the Feilong Project.
# SPDX-License-Identifier: Apache-2.0
# Copyright 2017,2023 IBM Corp.
#
# 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
#
# ... |
16,680 | wait for socket | from __future__ import annotations
import select
import socket
from functools import partial
__all__ = ["wait_for_read", "wait_for_write"]
# How should we wait on sockets?
#
# There are two types of APIs you can use for waiting on sockets: the fancy
# modern stateful APIs like epoll/kqueue, and the older stateless ... |
16,681 | get system eeprom info | #!/usr/bin/env python
#
# Name: chassis.py, version: 1.0
#
# Description: Module contains the definitions of SONiC platform APIs
#
try:
from sonic_platform_base.chassis_base import ChassisBase
from sonic_platform.eeprom import Eeprom
from .fan_drawer import FanDrawer
from .thermal import Thermal
f... |
16,682 | test pearsons warning on small input | # Copyright The Lightning 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 writin... |
16,683 | get feats | # Copyright (c) OpenMMLab. All rights reserved.
import unittest
from typing import List, Tuple
from unittest import TestCase
import torch
from mmengine.structures import InstanceData, PixelData
from torch import nn
from mmpose.models.heads import VisPredictHead
from mmpose.testing import get_packed_inputs
class Tes... |
16,684 | hat matrix | # -*- coding: utf-8 -*-
"""Kernel Smoother.
This module contains the class for kernel smoothing.
"""
from typing import Optional
import numpy as np
from ..._utils._utils import _to_grid_points
from ...misc.hat_matrix import HatMatrix, NadarayaWatsonHatMatrix
from ...typing._base import GridPointsLike
from ...typin... |
16,685 | forward gradient | # Copyright 2019 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... |
16,686 | predictor from code | import os
from typing import Union
import dill
import pandas as pd
from lightwood.api.types import JsonAI, ProblemDefinition
from dataprep_ml.insights import statistical_analysis
from type_infer.infer import infer_types
from lightwood.api.predictor import PredictorInterface
from lightwood.api.json_ai import generate_js... |
16,687 | fit to text | from ursina import Entity, Text, camera, color, mouse, BoxCollider, Sequence, Func, Vec2, Vec3, scene
from ursina.models.procedural.quad import Quad
import textwrap
from ursina.scripts.property_generator import generate_properties_for_class
@generate_properties_for_class()
class Button(Entity):
default_color = co... |
16,688 | frame interval | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Class for storing and working with movie file metadata.
"""
# Part of the PsychoPy library
# Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
__all__ = ["MovieMetadata"... |
16,689 | process line | # Copyright 2015 The Serviced 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 w... |
16,690 | encode image | import os
from typing import Dict
try:
import tensorrt as trt
from tensorrt.tensorrt import Logger, Runtime
from clip_server.model.trt_utils import load_engine, build_engine, save_engine
except ImportError:
raise ImportError(
"It seems that TensorRT is not yet installed. "
"It is requi... |
16,691 | test find all parents ignores when extends | import pytest
from amlb.utils import Namespace
from amlb.frameworks.definitions import _sanitize_and_add_defaults, \
_add_framework_name, _find_all_parents, \
_update_frameworks_with_parent_definitions, _remove_self_reference_extensions, \
_remove_frameworks_with_unknown_parent
def test_remove_frameworks_... |
16,692 | set up | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
import unittest
from unittest.mock import ANY
from databuilder.models.graph_serializable import (
RELATION_END_KEY, RELATION_END_LABEL, RELATION_REVERSE_TYPE, RELATION_START_KEY, RELATION_START_LABEL,
RELATION_TYPE,
)
from... |
16,693 | test python generator with extra test no | # 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... |
16,694 | transform | #!/usr/bin/env python3
##
## @file setNamesFromIds.py
## @brief Utility program, renaming all Names to match their ids.
##
## @author Frank T. Bergmann
##
##
## <!--------------------------------------------------------------------------
## This sample program is distributed under a different license than the ... |
16,695 | state | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
... |
16,696 | change range cb | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
The ``Colorbar`` plugin shows a colorbar indicating the colormap applied
to the image and showing the example values along the range.
**Plugin Type: Global**
``Colorbar`` is a global plugin. Only one insta... |
16,697 | load earth vertical gravity gradient | """
Function to download the IGPP Global Earth Vertical Gravity Gradient from the
GMT data server, and load as :class:`xarray.DataArray`.
The grids are available in various resolutions.
"""
from pygmt.datasets.load_remote_dataset import _load_remote_dataset
from pygmt.helpers import kwargs_to_strings
__doctest_skip__... |
16,698 | id | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
16,699 | test contact reference location stats custom geometry | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from flowmachine.features.subscriber.contact_reference_locations_stats import *
import pytest
from flowmachine.core imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.