id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
13,000 | load child node | #!/usr/bin/env python
#
# Trivial data browser
# This version:
# Copyright (C) 2010 Rob Lanphier
# Derived from browse.py in urwid distribution
# Copyright (C) 2004-2007 Ian Ward
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gener... |
13,001 | test import mock commands module | from __future__ import annotations
import os
import shutil
import sys
from pathlib import Path
from typing import TYPE_CHECKING
import pytest
if TYPE_CHECKING:
from autogpt.agents import Agent, BaseAgent
from autogpt.models.command import Command, CommandParameter
from autogpt.models.command_registry import Com... |
13,002 | check requirements | from typing import Any, NoReturn, Optional
from django.http import HttpRequest, HttpResponseBadRequest, HttpResponseRedirect
from django.utils.translation import gettext_lazy as _
from digid_eherkenning.choices import DigiDAssuranceLevels
from furl import furl
from rest_framework.reverse import reverse
from openform... |
13,003 | lm config file | import string
from argparse import ArgumentParser
from pathlib import Path
import numpy as np
import pytest
from espnet2.bin.lm_inference import GenerateText, get_parser, inference, main
from espnet2.tasks.lm import LMTask
from espnet.nets.beam_search import Hypothesis
def test_get_parser():
assert isinstance(g... |
13,004 | rebuild index | #/***************************************************************************
# * Copyright (c) 2019 Victor Titov (DeepSOIC) <vv.titov@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
13,005 | setup | # -*- coding: utf-8 -*-
import pytest
from .as_status_codes import AerospikeStatus
from .test_base_class import TestBaseClass
from aerospike import exception as e
import aerospike
class TestScanInfo(object):
udf_to_load = "bin_lua.lua"
# connection_with_udf will remove the udf at the end of the tests
@... |
13,006 | cleanup | import logging
import re
from avocado.utils import crypto
from avocado.utils import process
from virttest import error_context
from virttest import utils_misc
from provider.blockdev_snapshot_base import BlockDevSnapshotTest
from qemu.tests.qemu_guest_agent import QemuGuestAgentBasicCheckWin
LOG_JOB = logging.getLog... |
13,007 | display 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... |
13,008 | read work list | import pprint
import sys
from loadUtils import *
from EmberEP import *
from paramUtils import *
class PartInfo:
def __init__(self, nicParams, epParams, numNodes, nicsPerNode, numCores, detailedModel = None ):
self.nicParams = nicParams
self.epParams = epParams
self.numNodes = int(numNodes)... |
13,009 | cpus | # 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 ... |
13,010 | get only units grading fn | from enum import Enum
from typing import Any, Callable, Optional, Tuple
import numpy as np
import prairielearn as pl
from pint import UnitRegistry
from typing_extensions import assert_never
CORRECT_UNITS_INCORRECT_MAGNITUDE_FEEDBACK = (
"Your answer has correct units, but incorrect magnitude."
)
INCORRECT_UNITS_C... |
13,011 | build | import os
from conan import ConanFile
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import apply_conandata_patches, copy, export_conandata_patches, get, rmdir
from conan.tools.layout import basic_layout
from conan.tools.METHOD_NAME import check_min_cppstd
from conan.tools.scm... |
13,012 | pop | # ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------
import logging
from collections import deque
from typing import Dict, Optional, Union
from azure.ai.ml.entities._builders import BaseNode
f... |
13,013 | test non ints dont cause problems when | import copy
from unittest import TestCase
from unittest.mock import Mock, patch, MagicMock
from buildpack.telemetry.metrics import (
FreeAppsMetricsEmitterThread,
PaidAppsMetricsEmitterThread,
MXVERSION_MICROMETER,
)
from lib.m2ee.version import MXVersion
class TestNegativeMemoryMetricsThrowError(TestCas... |
13,014 | get list display | from copy import copy
from typing import Literal
from django.contrib import admin
from django.contrib.admin.widgets import AdminTextInputWidget
from django.utils import timezone
from django.utils.html import format_html_join
from django.utils.translation import gettext, gettext_lazy as _
from solo.admin import Single... |
13,015 | cancel transaction | import logging
from decimal import Decimal
from typing import List, Optional, Tuple
from ....order.models import Fulfillment
from ...interface import PaymentData
from ...models import Payment
from .api_helpers import (
cancel,
format_price,
handle_unrecoverable_state,
np_request,
register,
repo... |
13,016 | test ctypes array 1d | # -*- coding: utf-8 -*-
import ctypes
import io
import struct
import pytest
import env
from pybind11_tests import ConstructorStats
from pybind11_tests import buffers as m
np = pytest.importorskip("numpy")
def test_from_python():
with pytest.raises(RuntimeError) as excinfo:
m.Matrix(np.array([1, 2, 3]))... |
13,017 | test tarobj wav | import tarfile
import warnings
from unittest.mock import patch
import torch
from torchaudio._internal import module_utils as _mod_utils
from torchaudio.backend import soundfile_backend
from torchaudio_unittest.backend.common import get_bits_per_sample, get_encoding
from torchaudio_unittest.common_utils import (
ge... |
13,018 | test stress induced diffusion not implemented | #
# Tests for the lithium-ion MPM model
#
from tests import TestCase
import pybamm
import unittest
class TestMPM(TestCase):
def test_well_posed(self):
options = {"thermal": "isothermal"}
model = pybamm.lithium_ion.MPM(options)
model.check_well_posedness()
# Test build after init
... |
13,019 | eigvalsh | from __future__ import annotations
import functools
import math
from typing import Sequence
import torch
from . import _dtypes_impl, _util
from ._normalizations import ArrayLike, KeepDims, normalizer
class LinAlgError(Exception):
pass
def _atleast_float_1(a):
if not (a.dtype.is_floating_point or a.dtype.... |
13,020 | event loop | import pytest
import os
import asyncio
import numpy as np
import tensorflow as tf
from typing import Iterable
from tensorflow.keras.layers import Dense, InputLayer
from alibi_detect.cd import TabularDrift, CVMDriftOnline
from alibi_detect.od import OutlierVAE
from alibi_detect.saving import save_detector
from mlserve... |
13,021 | expected fake modifier yaml str | # Copyright (c) 2021 - present / Neuralmagic, 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 b... |
13,022 | model fn | # 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 t... |
13,023 | legacy args | # Copyright: Ankitects Pty Ltd and contributors
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
"""
Code for generating hooks.
"""
import os
import subprocess
import sys
from dataclasses import dataclass
from operator import attrgetter
from typing import Optional
sys.path.append("pylib... |
13,024 | test equal vectors | # 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... |
13,025 | strftest1 | """
Unittest for time.strftime
"""
import calendar
import sys
import re
from test import support
import time
import unittest
# helper functions
def fixasctime(s):
if s[8] == ' ':
s = s[:8] + '0' + s[9:]
return s
def escapestr(text, ampm):
"""
Escape text to deal with possible locale values t... |
13,026 | test nan input | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown copyright. The Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are me... |
13,027 | compare images | """
test_images2.py tests libqtile.images.Img for rendering quality
by comparing known good and bad images to images rendered using
Img().
Image similarity / distance is calculated using imagemagick's convert
utility.
"""
import subprocess as sp
from collections import namedtuple
from glob import glob
from os import p... |
13,028 | create token | #!/usr/bin/env python
import asyncio
import http
import http.cookies
import pathlib
import signal
import urllib.parse
import uuid
import websockets
from websockets.frames import CloseCode
# User accounts database
USERS = {}
def METHOD_NAME(user, lifetime=1):
"""Create token for user and delete it once its li... |
13,029 | build targets | # 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)
from spack.package import *
class Libceed(MakefilePackage, CudaPackage, ROCmPackage):
"""The CEED API Library: Code ... |
13,030 | host | # 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... |
13,031 | 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 . imp... |
13,032 | extract x path | # XPathUtil.py
# A collecton of utilities to extract and parse
# XPaths encountered while scraping.
#
# Steven Englehardt (github.com/englehardt)
import re
import bs4
from bs4 import BeautifulSoup as bs
def is_clickable(xpath):
# We consider any xpath that has an 'a', 'button',
# or 'input' tag to be click... |
13,033 | patch intercept mark | # -*- coding: utf-8 -*-
import re
from thonny import get_runner, get_workbench, ui_utils
from thonny.codeview import CodeViewText
cell_regex = re.compile(r"(^|\n)(# ?%%|##|# In\[\d+\]:)[^\n]*", re.MULTILINE) # @UndefinedVariable
def update_editor_cells(event):
text = event.widget
if not getattr(text, "ce... |
13,034 | define common options | import argparse
import pytest
from ...helpers import parse_storage_quota
from . import Archiver, RK_ENCRYPTION, cmd
def test_bad_filters(archiver):
cmd(archiver, "rcreate", RK_ENCRYPTION)
cmd(archiver, "create", "test", "input")
cmd(archiver, "delete", "--first", "1", "--last", "1", fork=True, exit_code=... |
13,035 | reverse | # Generated by Django 3.2.6 on 2021-11-01 09:38
import django.db.models.deletion
from django.db import migrations, models
from baserow.contrib.database.formula import FormulaHandler
from baserow.formula import BaserowFormula, BaserowFormulaVisitor
# noinspection PyPep8Naming
def METHOD_NAME(apps, schema_editor):
... |
13,036 | remove as system manager | # pylint: disable=unused-import
from __future__ import annotations
from datetime import datetime
from typing import TYPE_CHECKING, Any, List
from citext import CIText
from sqlalchemy import Column, DateTime, String
from sqlalchemy.orm import Session, relationship
from fides.api.common_exceptions import SystemManager... |
13,037 | upgrade | """create privacy declarations table
Revision ID: 48d9caacebd4
Revises: 3842d1acac5f
Create Date: 2023-04-20 20:35:05.377471
"""
import json
import uuid
from collections import defaultdict
import sqlalchemy as sa
from alembic import op
from sqlalchemy import text
from sqlalchemy.dialects import postgresql
# revisio... |
13,038 | session | """AWS cloud adaptors
Thread safety notes:
The results of session(), resource(), and client() are cached by each thread
in a thread.local() storage. This means using their results is completely
thread-safe.
Calling them is thread-safe too, since they use a lock to protect
each object's first creation.
This is infor... |
13,039 | wav write | #!/usr/bin/env python3
"""
Copyright (C) 2022-2023 Intel Corporation
SPDX-License-Identifier: Apache-2.0
"""
import copy
import logging as log
import sys
from argparse import ArgumentParser
from pathlib import Path
from time import perf_counter
import numpy as np
import wave
from openvino.runtime import Core, get_ve... |
13,040 | testspackage date name generator | import os
import shutil
import tempfile
import zipfile
from django.core.files import File
from django.core.validators import RegexValidator
from django.db import models
from django.db.models.signals import m2m_changed
from django.utils.translation import gettext_lazy as _
from oioioi.base.utils import strip_num_or_ha... |
13,041 | test retrieve | # 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... |
13,042 | get cases | """
Base class for all CaseReaders.
"""
from openmdao.core.constants import _DEFAULT_OUT_STREAM
class BaseCaseReader(object):
"""
Base class of all CaseReader implementations.
Parameters
----------
filename : str
The path to the file containing the recorded data.
pre_load : bool
... |
13,043 | 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
# --------------------------------... |
13,044 | ws connect | import abc
import json
from dataclasses import dataclass
from io import BytesIO
from typing import (
Any,
AsyncContextManager,
AsyncGenerator,
Callable,
Dict,
List,
Mapping,
Optional,
)
from typing_extensions import Literal
from strawberry.http import GraphQLHTTPResponse
from strawberry... |
13,045 | test complex64 basic | # Copyright 2015 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... |
13,046 | timer cb | import numpy as np
import rospy
import serial
from std_srvs.srv import SetBool, SetBoolResponse
from . import constants
class NoopSerial(serial.Serial):
"""
Inherits from serial.Serial, doing nothing for each function.
Allows super classes to implement custom behavior for simulating
serial devices.
... |
13,047 | on spin | from __future__ import absolute_import, division, print_function
# -*- Mode: Python; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*-
#
# $Id: ring_frame.py 18950 2013-12-20 20:23:08Z phyy-nx $
import wx
### Enable the plugin by renaming to end in "_frame_plugin.py"
class ExampleSettingsFrame(wx.MiniFrame)... |
13,048 | str to datetime processor factory | # sqlalchemy/processors.py
# Copyright (C) 2010-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
# Copyright (C) 2010 Gaetan de Menten gdementen@gmail.com
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""defines generi... |
13,049 | update regions | """State items property pages.
To register property pages implemented in this module, it is imported in
gaphor.adapter package.
"""
from __future__ import annotations
from gi.repository import Gio
from gaphor import UML
from gaphor.core import transactional
from gaphor.diagram.propertypages import (
LabelValue,
... |
13,050 | on run start | import importlib
import sys
from typing import Any
from omegaconf import OmegaConf, DictConfig
from hydra.experimental.callback import Callback
class RecipeShortcutsCallback(Callback):
"""
Interpolates the shortcuts defined in variable_set.yaml:
lr
batch_size
val_batch_si... |
13,051 | test users activate redirects | from datetime import datetime
from unittest import mock
import pytest
from pyramid import httpexceptions
from h.models import Annotation
from h.services.annotation_stats import AnnotationStatsService
from h.services.user_delete import UserDeleteService
from h.views.admin.users import (
UserNotFoundError,
form... |
13,052 | inverse choices | from django.conf import settings
from django.db.models.query_utils import Q
from django_filters import rest_framework as filters
from djqscsv import render_to_csv_response
from dry_rest_permissions.generics import DRYPermissions
from rest_framework import filters as rest_framework_filters
from rest_framework import mix... |
13,053 | test final resource | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import pytest
from azure.core.exceptions import HttpResponseError, ResourceNotFoundError
from azure.keyvault.secrets._shared._polling import DeleteRecoverPollingMethod
... |
13,054 | status | #!/usr/bin/env python
"""Devenv subcommands."""
# This module contains only CLI subcommands, documented via the cli.subcommand()
# decorator. This makes function docstrings superflous.
#
# pylint: disable=missing-function-docstring
import argparse
import shutil
import subprocess
from typing import List
import uuid
f... |
13,055 | stub update table | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Stub functions that are used by the Amazon Keyspaces (for Apache Cassandra) unit tests.
"""
from botocore.stub import ANY
from test_tools.example_stubber import ExampleStubber
class KeyspacesStubber(Exampl... |
13,056 | instance ids edited by | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from django.db.models import Q
from treemap.audit import Audit, Authorizable, get_auditable_class
from treemap.models import Instance, MapFeature, InstanceUser, User
from treemap.util ... |
13,057 | cluster plan | """
Riak Salt Module
"""
import salt.utils.path
def __virtual__():
"""
Only available on systems with Riak installed.
"""
if salt.utils.path.which("riak"):
return True
return (
False,
"The riak execution module failed to load: the riak binary is not in the path.",
)
... |
13,058 | to member name | #!/usr/bin/python2.7
# Copyright 2011 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 requi... |
13,059 | postgres select | import json
import threading
from django import VERSION
from django.contrib.auth import login
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse, HttpResponseNotFound, HttpResponseServerError
from django.shortcuts import render
from djan... |
13,060 | add abbreviation | from collections.abc import Callable, Generator, Iterable, Sequence
from queue import Queue
from threading import Event as _UninterruptibleEvent
from typing_extensions import TypeAlias
from ._canonical_names import all_modifiers as all_modifiers, sided_modifiers as sided_modifiers
from ._keyboard_event import KEY_DOWN... |
13,061 | is parameter type | # ___________________________________________________________________________
#
# Pyomo: Python Optimization Modeling Objects
# Copyright (c) 2008-2022
# National Technology and Engineering Solutions of Sandia, LLC
# Under the terms of Contract DE-NA0003525 with National Technology and
# Engineering Solutions of ... |
13,062 | result | # Copyright 2016 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... |
13,063 | prepare request | # 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... |
13,064 | event | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed.accelerator.abstract_accelerator import DeepSpeedAccelerator
import oneccl_bindings_for_pytorch # noqa: F401 # type: ignore
import psutil
import os
# accelerator for Intel CPU
class CPU_Acceler... |
13,065 | flush | import inspect
from sentry_sdk._types import TYPE_CHECKING
from sentry_sdk.hub import Hub
from sentry_sdk.scope import Scope
from sentry_sdk.tracing import NoOpSpan, Transaction
if TYPE_CHECKING:
from typing import Any
from typing import Dict
from typing import Optional
from typing import overload
... |
13,066 | new short uuid | import uuid
from flask_login import UserMixin
from datetime import timedelta
from werkzeug.security import generate_password_hash, check_password_hash
from portality.dao import DomainObject as DomainObject
from portality.core import app
from portality.authorise import Authorise
from portality.lib import dates
from por... |
13,067 | test apply slice | import unittest
import numpy as np
import openmdao.api as om
from openmdao.utils.testing_utils import use_tempdirs
from openmdao.utils.assert_utils import assert_near_equal
from openmdao.test_suite.components.paraboloid import Paraboloid
from openmdao.visualization.case_viewer.case_viewer import _apply_slice, _apply... |
13,068 | test ctor | # Copyright (c) 2019-2020 SAP SE or an SAP affiliate company. All rights reserved. This file is
# licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the L... |
13,069 | is likely yaml file | import os
import shutil
import tempfile
import uuid
from enum import Enum
from pathlib import Path
from typing import Text, Optional, Union, List, Callable, Set, Iterable
YAML_FILE_EXTENSIONS = [".yml", ".yaml"]
JSON_FILE_EXTENSIONS = [".json"]
TRAINING_DATA_EXTENSIONS = set(JSON_FILE_EXTENSIONS + YAML_FILE_EXTENSIONS... |
13,070 | test arp expect reply | import logging
import pytest
import time
from datetime import datetime
from tests.arp.arp_utils import clear_dut_arp_cache
from tests.ptf_runner import ptf_runner
from tests.common.helpers.assertions import pytest_assert
from tests.common.fixtures.ptfhost_utils import copy_ptftests_directory # noqa F401
from tests... |
13,071 | close | # 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 ... |
13,072 | obj prepare | import sys
import time
from os.path import join
from bzt.modules.aggregator import DataPoint, KPISet
from bzt.modules._molotov import MolotovExecutor, MolotovReportReader
from bzt.utils import EXE_SUFFIX
from tests.unit import BZTestCase, ExecutorTestCase, RESOURCES_DIR, close_reader_file, ROOT_LOGGER
TOOL_NAME = 'mo... |
13,073 | run | # 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... |
13,074 | npc on hit | import arcemu
from arcemu import Unit
def npc_onCombatStart( unit, event, target ):
unit.sendChatMessage( arcemu.CHAT_MSG_MONSTER_YELL, arcemu.LANG_UNIVERSAL, "I am going to kill you " + target.getName() + "!" )
def npc_onCombatStop( unit, event, target ):
unit.sendChatMessage( arcemu.CHAT_MSG_MONSTER_SAY, arcemu.... |
13,075 | test register admin plugin script | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from CTFd.plugins import (
bypass_csrf_protection,
get_admin_plugin_menu_bar,
get_user_page_menu_bar,
override_template,
register_admin_plugin_menu_bar,
register_admin_plugin_script,
register_admin_plugin_stylesheet,
register_plugin_asset,
... |
13,076 | custom converter | from graphql import graphql_sync
from ariadne import QueryType, gql, make_executable_schema
def test_field_names_without_resolvers_are_converted():
type_defs = gql(
"""
type Query {
field: String
convertedField: String
}
"""
)
schema = make_executa... |
13,077 | null | """
tdop.py
"""
from _devbuild.gen.typed_arith_asdl import arith_expr_t
from typing import (Dict, List, Callable, Optional, Iterator, Tuple, NoReturn)
from typing import TYPE_CHECKING
class ParseError(Exception):
pass
#
# Default parsing functions give errors
#
def NullError(p, token, bp):
# type: (Parser, Tok... |
13,078 | check sm m code chk en | # -*- coding: utf-8 -*-
# CHIPSEC: Platform Security Assessment Framework
# Copyright (c) 2021, SentinelOne
# Copyright (c) 2021, Intel
#
# 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 ... |
13,079 | set trace | import signal
import sys
from bdb import Bdb
from cmd import Cmd
from collections.abc import Callable, Iterable, Mapping, Sequence
from inspect import _SourceObjectType
from types import CodeType, FrameType, TracebackType
from typing import IO, Any, ClassVar, TypeVar
from typing_extensions import ParamSpec, Self
__all... |
13,080 | test missing vararg | from __future__ import annotations
import builtins
import sys
import tempfile
import pytest
from ibis.backends.bigquery.udf.core import PythonToJavaScriptTranslator, SymbolTable
def test_symbol_table():
symbols = SymbolTable()
assert symbols["a"] == "let a"
assert symbols["a"] == "a"
def compile(f):
... |
13,081 | check anchors | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
AutoAnchor utils
"""
import random
import numpy as np
import torch
import yaml
from tqdm import tqdm
from .general import LOGGER, colorstr, emojis
PREFIX = colorstr('AutoAnchor: ')
def check_anchor_order(m):
# Check anchor order against stride order for YOLOv5 D... |
13,082 | test disabled | import unittest
from tempfile import mkdtemp
from shutil import rmtree
class WidgetTestCase(unittest.TestCase):
def setUp(self):
from kivy.uix.widget import Widget
self.cls = Widget
self.root = Widget()
def test_add_remove_widget(self):
root = self.root
self.assertEqu... |
13,083 | run | import json
import logging
from datetime import datetime
import eth_abi
import pyarrow.parquet as pq
import requests
from cloudpathlib import AnyPath
from eth_utils import to_checksum_address
from hexbytes import HexBytes
from sqlalchemy.orm import Session
from . import models
MAX_INDEX_SIZE = 100
class Indexer:
... |
13,084 | validate authentication | from typing import TYPE_CHECKING
from django.core.exceptions import ValidationError
from ....order.models import Fulfillment
from ....plugins.base_plugin import BasePlugin, ConfigurationTypeField
from ....plugins.error_codes import PluginErrorCode
from ...interface import GatewayConfig
from . import capture, process_... |
13,085 | test shrinks downwards to integers | # This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Copyright the Hypothesis Authors.
# Individual contributors are listed in AUTHORS.rst and the git log.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the... |
13,086 | pull | import docker
import requests
from ... import ErsiliaBase
from ...utils.terminal import yes_no_input, run_command
from ... import throw_ersilia_exception
from ...utils.exceptions_utils.pull_exceptions import DockerImageNotAvailableError
from ...utils.docker import SimpleDocker
from ...default import DOCKERHUB_ORG, DO... |
13,087 | decode q | """ Routines for manipulating RFC2047 encoded words.
This is currently a package-private API, but will be considered for promotion
to a public API if there is demand.
"""
# An ecoded word looks like this:
#
# =?charset[*lang]?cte?encoded_string?=
#
# for more information about charset see the charset module. ... |
13,088 | parse args | #!/usr/bin/python3
# filter_unpaired_mappings.py: Filter alignments so that every pair of lines represents a valid read pair
"""
Filter out unpaired mappings so that the results can be used as input for interleaved, paired
alignment. Ensure that for each even value of i, then lines i and i+1 contain mappings for
the ... |
13,089 | pandas | """
This is a template for creating custom MulticolumnMapExpectations.
For detailed instructions on how to use it, please see:
https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_multicolumn_map_expectations
"""
from typing import Optional
from great_expect... |
13,090 | set up module | #!/usr/bin/env python
import os
from typing import Optional, Tuple
from unittest import mock
from absl.testing import absltest
from absl.testing import flagsaver
from grr_response_client import client_utils
from grr_response_client import vfs
from grr_response_core import config
from grr_response_core.lib import conf... |
13,091 | test wild | import contextlib
import concurrent.futures as futures
from itertools import chain
import json
import os
from tempfile import gettempdir
import pytest
from stress_tests.experiment import (
ExperimentConditions, Experiment, Encoder, Replication
)
from stress_tests import read_mlir
from stress_tests.utils import CO... |
13,092 | test trainer | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
from pathlib import Path
from typing import Any
import pytest
import timm
import torch
import torch.nn as nn
import torchvision
from hydra.utils import instantiate
from lightning.pytorch import Trainer
from omegaco... |
13,093 | peer adj rib in | #!/usr/bin/env python3
import json
import logging
import sys
from flask import Blueprint
import flask
from yabgp.agent import prepare_service
from yabgp.common import constants
from yabgp.handler import BaseHandler
from yabgp.api import app
from yabgp.api import utils as api_utils
from yabgp.api.v1 import auth
LOG... |
13,094 | pair ohlcv key | import logging
from typing import Optional
import numpy as np
import pandas as pd
from freqtrade.configuration import TimeRange
from freqtrade.constants import DEFAULT_DATAFRAME_COLUMNS, DEFAULT_TRADES_COLUMNS
from freqtrade.enums import CandleType
from .idatahandler import IDataHandler
logger = logging.getLogger(... |
13,095 | path contents | # -*- coding: utf-8 -*-
"""
/***************************************************************************
QFieldSync
-------------------
begin : 2016
copyright : (C) 2016 by OPENGIS.ch
email : info@opengis.ch
**************... |
13,096 | subst list | # MIT License
#
# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, ... |
13,097 | get master diff | import re
from pathlib import Path
from demisto_sdk.commands.common.errors import Errors
from demisto_sdk.commands.common.hook_validations.base_validator import (
BaseValidator,
error_codes,
)
from demisto_sdk.commands.common.tools import (
old_get_latest_release_notes_text,
old_get_release_notes_file_... |
13,098 | some other func | import pytest
import reactpy
from reactpy.core.events import (
EventHandler,
merge_event_handler_funcs,
merge_event_handlers,
to_event_handler_function,
)
from reactpy.testing import DisplayFixture, poll
from tests.tooling.common import DEFAULT_TYPE_DELAY
def test_event_handler_repr():
handler = ... |
13,099 | load arguments | # --------------------------------------------------------------------------
# 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 cause incor... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.