id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
10,900 | good metadata | from types import MappingProxyType
import pytest
import requests
import requests_mock
from common.aws.aws_metadata import AWS_LATEST_METADATA_URI_PREFIX, fetch_aws_instance_metadata
INSTANCE_ID_RESPONSE = "i-1234567890abcdef0"
AVAILABILITY_ZONE_RESPONSE = "us-west-2b"
# from https://docs.aws.amazon.com/AWSEC2/late... |
10,901 | download xcarchive tar gz | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... |
10,902 | get batch data | import logging
import lxml.html as html
from airflow.models import Variable
from common import constants
from common.licenses import LicenseInfo, get_license_info
from common.loader import provider_details as prov
from providers.provider_api_scripts.provider_data_ingester import ProviderDataIngester
logger = loggin... |
10,903 | down | from ctypes import *
import os, time
class RpcError(Exception):
def __init__(self, code, message, data):
super().__init__(message + "\n" + data)
self.code = code
self.message = message
self.data = data
class ControllerSys:
def __init__(self):
_path = os.path.abspath("... |
10,904 | support | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import torch
from torch.distributions import constraints
from torch.distributions.utils import lazy_property
from pyro.distributions.torch_distribution import TorchDistribution
from pyro.distributions.util import broadcast_shape
... |
10,905 | alias secondary connection string | # 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__ ... |
10,906 | get supervisor | """
This type stub file was generated by pyright.
"""
import cmd
import threading
"""supervisorctl -- control applications run by supervisord from the cmd line.
Usage: %s [options] [action [arguments]]
Options:
-c/--configuration FILENAME -- configuration file path (searches if not given)
-h/--help -- print usage m... |
10,907 | load upscalers | from __future__ import annotations
import os
import shutil
import importlib
from urllib.parse import urlparse
from modules import shared
from modules.upscaler import Upscaler, UpscalerLanczos, UpscalerNearest, UpscalerNone
from modules.paths import script_path, models_path
def load_file_from_url(
url: str,
... |
10,908 | chatterjee object | """
This is the test module for the Chatterjee sensitivity indices.
Here, we will use the exponential function to test the output, as in
the test module for Cramer sensitivity indices for the Chatterjee indices and
the ishigami function as in the test module for Sobol sensitivity indices for the
Sobol indices.
The ... |
10,909 | test fourier modes | from hcipy import *
import numpy as np
import scipy
def test_zernike_modes():
grid = make_pupil_grid(256)
aperture_mask = make_circular_aperture(1)(grid) > 0
modes = make_zernike_basis(200, 1, grid)
assert np.abs(np.std(modes[0][aperture_mask])) < 2e-2
for m in modes[1:]:
assert np.abs(n... |
10,910 | supported percentile function types | from __future__ import annotations
from typing import Collection
from dbt_semantic_interfaces.enum_extension import assert_values_exhausted
from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity
from typing_extensions import override
from metricflow.errors.errors import UnsupportedEngineFeat... |
10,911 | get segmentation | # coding: utf-8
import numpy as np
from scipy import ndimage
import msaf.utils as U
from msaf.algorithms.interface import SegmenterInterface
from msaf import pymf
def median_filter(X, M=8):
"""Median filter along the first axis of the feature matrix X."""
for i in range(X.shape[1]):
X[:, i] = ndimage... |
10,912 | test text position | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) Vispy Development Team. All Rights Reserved.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
# -----------------------------------------------------------------------------
... |
10,913 | show roi transfer options | import logging
from src.View.ImageFusion.UITransferROIWindow import UITransferROIWindow
from src.View.mainpage.DeleteROIWindow import *
from src.View.mainpage.DrawROIWindow.UIDrawROIWindow import UIDrawROIWindow
from src.View.mainpage.ManipulateROIWindow import *
class RoiDeleteOptions(QtWidgets.QMainWindow, UIDelet... |
10,914 | id | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
fr... |
10,915 | build call recording download recording request | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from typi... |
10,916 | get group by id | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from ..uac import GroupV2_pb2 as uac_dot_GroupV2__pb2
class GroupServiceStub(object):
# missing associated documentation comment in .proto file
pass
def __init__(self, channel):
"""Constructor.
Args:
channel: A gr... |
10,917 | test limit order | import datetime
import unittest
from betfairlightweight.filters import (
market_filter,
time_range,
price_data,
ex_best_offers_overrides,
price_projection,
place_instruction,
limit_on_close_order,
limit_order,
cancel_instruction,
market_on_close_order,
replace_instruction,
... |
10,918 | to torch tensor | import functools
import importlib
import logging
import os
import tempfile
import torch
from .common import device_from_inputs, fake_tensor_unsupported
from .registry import register_backend
log = logging.getLogger(__name__)
@register_backend
@fake_tensor_unsupported
def tvm(gm, example_inputs, *, scheduler=None, ... |
10,919 | enqueue | import atexit
from collections import Counter
from contextlib import contextmanager
import json
from time import sleep
from typing import Any
from typing import Generator
from envier import En
from ddtrace.debugging._config import di_config
from ddtrace.debugging._config import ed_config
from ddtrace.debugging._debug... |
10,920 | get title | from operator import itemgetter
from celery.result import AsyncResult
from django.contrib import messages
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.http import Http404, HttpResponse, HttpResponseBadRequest, HttpResponseRedirect
from django.urls import reverse
from django.utils.html imp... |
10,921 | model | #################################################################################
# WaterTAP Copyright (c) 2020-2023, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National Laboratory,
# National Renewable Energy Laboratory, and National Energy Technology
# Labo... |
10,922 | event writing loop | """The main entrypoint for ops executed using the DatabricksPySparkStepLauncher.
This script is launched on Databricks using a `spark_python_task` and is passed the following
parameters:
- the DBFS path to the pickled `step_run_ref` file
- the DBFS path to the zipped dagster job
- paths to any other zipped packages w... |
10,923 | output | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
10,924 | find executable | """distutils.spawn
Provides the 'spawn()' function, a front-end to various platform-
specific functions for launching another program in a sub-process.
Also provides the 'find_executable()' to search the path for a given
executable name.
"""
import sys
import os
from distutils.errors import DistutilsPlatformError, D... |
10,925 | add arguments | """Script supprimant des fichiers vidéos devenus inutiles."""
from django.core.management.base import BaseCommand
from pod.video.models import Video
from django.conf import settings
from os import listdir, remove
from os.path import isfile, join
USE_PODFILE = getattr(settings, "USE_PODFILE", False)
if USE_PODFILE:
... |
10,926 | test subclassed abstract property | #tests/unit/test_baseObject.py
#A part of NonVisual Desktop Access (NVDA)
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
#Copyright (C) 2018-2019 NV Access Limited, Babbage B.V.
"""Unit tests for the baseObject module, its classes and their derivatives."""
import unit... |
10,927 | will anything be replaced |
from env_var_names import *
from shasta.ast_node import *
from shasta.json_to_ast import *
from util import *
## This class is used by the preprocessor in ast_to_ir
class PreprocessedAST:
def __init__(self, ast, replace_whole, non_maximal, something_replaced=True, last_ast=False):
assert(isinstance(ast, ... |
10,928 | repr | import pprint
import reprlib
from typing import Any
from typing import Dict
from typing import IO
from typing import Optional
def _try_repr_or_str(obj: object) -> str:
try:
return METHOD_NAME(obj)
except (KeyboardInterrupt, SystemExit):
raise
except BaseException:
return f'{type(ob... |
10,929 | get tokens of interest |
from vsg import parser
from vsg import violation
from vsg.rule_group import whitespace
from vsg.rules import utils as rules_utils
from vsg.vhdlFile import utils
class Rule(whitespace.Rule):
'''
Checks for a single space between two tokens.
Parameters
----------
name : string
The group... |
10,930 | touch class | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for Deferred handling by L{twisted.trial.unittest.TestCase}.
"""
from twisted.internet import defer, reactor, threads
from twisted.python.util import runWithWarningsSuppressed
from twisted.trial import unittest
from twisted.trial.util ... |
10,931 | add values where | """
# Author: qhouyee #
This module provides functionality to build a SPARQL query or update.
"""
# Third party imports
from py4jps import agentlogging
# Self imports
from agent.exceptions.exceptions import QueryBuilderError
logger = agentlogging.get_logger('prod')
class QueryBuilder:
"""
A class to build... |
10,932 | analyser osmosis common | #!/usr/bin/env python
#-*- coding: utf-8 -*-
###########################################################################
## ##
## Copyrights Frédéric Rodrigo 2014 ##
## ... |
10,933 | request timeout | from pubnub import utils
from pubnub.endpoints.endpoint import Endpoint
from pubnub.errors import PNERR_PAM_NO_FLAGS, PNERR_PAM_INVALID_ARGUMENTS
from pubnub.exceptions import PubNubException
from pubnub.enums import HttpMethod, PNOperationType
from pubnub.models.consumer.access_manager import PNAccessManagerGrantResul... |
10,934 | apply | # coding=utf-8
# Copyright 2020-present, AllenAI Authors, University of Illinois Urbana-Champaign,
# Intel Nervana Systems and the HuggingFace Inc. 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 ... |
10,935 | powerset | #!/usr/bin/env python3
import subprocess
import pytest
import os
import stat
import time
from os.path import join as pjoin
import sys
import re
import itertools
basename = pjoin(os.path.dirname(__file__), '..')
def get_printcap():
cmdline = base_cmdline + [ pjoin(basename, 'example', 'printcap') ]
proc = subp... |
10,936 | make sure is visible | from qtpy import QtWidgets, QtCore
from .widgets import (
GridLabelWidget,
SpacerWidget
)
from .base import BaseWidget
class ListStrictWidget(BaseWidget):
def create_ui(self):
self.setObjectName("ListStrictWidget")
self._child_style_state = ""
self.input_fields = []
cont... |
10,937 | test negative | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe.tests.utils import FrappeTestCase
from frappe.utils import fmt_money
class TestFmtMoney(FrappeTestCase):
def test_standard(self):
frappe.db.set_default("number_format", "#,###.##")
self.asse... |
10,938 | make ext | # 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
# d... |
10,939 | download bin main | """
Console scripts and associated helper methods for imageio.
"""
import argparse
import os
from os import path as op
import shutil
import sys
from . import plugins
from .core import util
# A list of plugins that require binaries from the imageio-binaries
# repository. These plugins must implement the `download` m... |
10,940 | test getbbox no args | import array
import math
import struct
import pytest
from PIL import Image, ImagePath
def test_path():
p = ImagePath.Path(list(range(10)))
# sequence interface
assert len(p) == 5
assert p[0] == (0.0, 1.0)
assert p[-1] == (8.0, 9.0)
assert list(p[:1]) == [(0.0, 1.0)]
with pytest.raises(T... |
10,941 | img | # (C) Copyright 2005-2023 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
10,942 | test word tokens all oov | # Copyright 2020, Google LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
10,943 | spam buttons command | from openpilot.common.conversions import Conversions as CV
from openpilot.selfdrive.car.honda.values import HondaFlags, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, CAR, CarControllerParams
# CAN bus layout with relay
# 0 = ACC-CAN - radar side
# 1 = F-CAN B - powertrain
# 2 = ACC-CAN - camera side
# 3 = F-CAN A - OBDII port
... |
10,944 | main | from argparse import ArgumentParser
import girder_client
import glob
import multiprocessing
import os
import shutil
import signal
import sys
from subprocess import run
from tempfile import TemporaryDirectory
import urllib
run_dir = os.path.dirname(__file__)
cmake_template = """
project({data_name}Data NONE)
if(NOT E... |
10,945 | delete | # Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
from copy import copy
from django.conf import settings
from django.db import models, transaction
from django.db.models import Q, Sum
from django.utils.translation import gettext
from weblate.checks.models import CHECKS, Che... |
10,946 | get schema | import io
import os
import tempfile
import pytest
from django.core.management import call_command
from django.test import TestCase
from django.test.utils import override_settings
from django.urls import path
from rest_framework.compat import uritemplate, yaml
from rest_framework.management.commands import generatesch... |
10,947 | time | # 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... |
10,948 | join master | import logging
import time
from tests.common.helpers.assertions import pytest_assert
logger = logging.getLogger(__name__)
def METHOD_NAME(duthost, master_vip):
"""
Joins DUT to Kubernetes master
Args:
duthost: DUT host object
master_vip: VIP of high availability Kubernetes master
I... |
10,949 | remove | # 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 errno
import math
import os
import shutil
from llnl.util.filesystem import mkdirp, rename
from spack.error import... |
10,950 | intermediate layers | """
Provides a class for torch model evaluation.
"""
from __future__ import absolute_import
import warnings
import torch
from .utils import common
from pdb import set_trace as st
class PyTorchModel:
""" Class for torch model evaluation.
Provide predict, intermediate_layer_outputs and adversarial_attack
... |
10,951 | center crop | """
Copyright (c) 2020-2023 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 i... |
10,952 | test it raises if group type invalid | from unittest import mock
from unittest.mock import call
import colander
import pytest
from h.models.group import (
GROUP_DESCRIPTION_MAX_LENGTH,
GROUP_NAME_MAX_LENGTH,
GROUP_NAME_MIN_LENGTH,
)
from h.models.organization import Organization
from h.schemas.forms.admin.group import AdminGroupSchema
class ... |
10,953 | determine syntax files | from collections import defaultdict
from contextlib import contextmanager
import os
import sublime
from GitSavvy.core.fns import maybe
MYPY = False
if MYPY:
from typing import DefaultDict, List, Optional
SUBLIME_HAS_SYNTAX_FUNCTIONS = int(sublime.version()) >= 4080
if 'syntax_file_map' not in globals():
... |
10,954 | test contract and invoices | # Copyright 2015 Antiun Ingenieria S.L. - Antonio Espinosa
# Copyright 2017 Tecnativa - Vicent Cubells
# Copyright 2017 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
import odoo.tests
from odoo.tests import tagged
from ..hooks import post_init_hook
@tagged("post_instal... |
10,955 | reset activity | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt
"""
Types for use throughout coverage.py.
"""
from __future__ import annotations
import os
import pathlib
from types import FrameType, ModuleType
from typing imp... |
10,956 | test shutdown check stderr | #!/usr/bin/env python
# SPDX-License-Identifier: ISC
#
# test_bgp_rr_ibgp_topo1.py
#
# Copyright (c) 2019 by
# Cumulus Networks, Inc.
# Donald Sharp
#
"""
test_bgp_rr_ibgp_topo1.py: Testing IBGP with RR and no IGP
Ensure that a basic rr topology comes up and correctly passes
routes around
"""
import os
import sys
... |
10,957 | set up | # 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... |
10,958 | on ready | # SPDX-License-Identifier: MIT
"""A basic example showing how to integrate audio from youtube-dl into voice chat."""
# NOTE: this example requires ffmpeg (https://ffmpeg.org/download.html) to be installed
# and available in your `%PATH%` or `$PATH`
# pyright: reportUnknownLambdaType=false
import asyncio
impor... |
10,959 | get scanning args | # SPDX-License-Identifier: GPL-3.0-or-later
# SPDX-FileCopyrightText: Copyright contributors to the OpenScanHub project.
import logging
import os
import shutil
from kobo.client.constants import TASK_STATES
from kobo.django.upload.models import FileUpload
from kobo.hub.decorators import validate_worker
from kobo.hub.m... |
10,960 | generate inputs | import unittest
from unittest import mock
import cupy # NOQA
from cupy import testing
from cupy_tests.core_tests.fusion_tests import fusion_utils
class CreateMock(object):
def __init__(self, target):
self.target = eval(target)
self.retvals = []
def __call__(self, *args, **kwargs):
... |
10,961 | create sub metrics | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
10,962 | test source with offset and len | #!/usr/bin/env python
#
# Copyright 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import os
import tempfile
import array
import pmt
from gnuradio import gr, gr_unittest, blocks
class test_file_source(gr_unittest.TestCase):
@classmethod
... |
10,963 | batch | # Copyright (c) 2011 Jeff Garzik
#
# Previous copyright, from python-jsonrpc/jsonrpc/proxy.py:
#
# Copyright (c) 2007 Jan-Klaas Kollhof
#
# This file is part of jsonrpc.
#
# jsonrpc is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# th... |
10,964 | test conditional | # Copyright 2016 Ryan Dellenbaugh
#
# 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.
import os
from tests.plugin import... |
10,965 | append stream output | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Output class.
Represents a widget that can be used to display output within the widget area.
"""
import sys
from functools import wraps
from .domwidget import DOMWidget
from .trait_types import TypedTuple
from .w... |
10,966 | get const value by name | # Copyright 2022 The BladeDISC 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 law or ... |
10,967 | has string escape chars | import json
import logging
import os
import re
from typing import Any, Dict, Optional, Text, Match, List
import scipy.sparse
from rasa.shared.nlu.constants import (
ENTITIES,
EXTRACTOR,
PRETRAINED_EXTRACTORS,
ENTITY_ATTRIBUTE_START,
ENTITY_ATTRIBUTE_END,
ENTITY_ATTRIBUTE_VALUE,
ENTITY_ATTRI... |
10,968 | num warn chats | # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# CatUserBot #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Copyright (C) 2020-2023 by TgCatUB@Github.
# This file is part of: https://github.com/TgCatUB/catuserbot
# and is released under the "GNU v3.0 License Agreement".
# Please see: https://github.com/TgCatUB/catuserbot/blob/... |
10,969 | prefech qs for filter | import django_filters
import graphene
from django.db.models import Exists, OuterRef, Q
from ...account.models import Address
from ...product.models import Product, ProductVariant
from ...warehouse import WarehouseClickAndCollectOption
from ...warehouse.models import Stock, Warehouse
from ..channel.types import Channel... |
10,970 | test vertex only mesh manual example | from firedrake import *
import pytest
# Ensure that the code shown in the manual runs without error. If you change
# the code here make sure you update the .. literalinclude:: bits in the manual
# too!
def METHOD_NAME():
parent_mesh = UnitSquareMesh(10, 10)
V = FunctionSpace(parent_mesh, "CG", 2)
# Crea... |
10,971 | create model from scheduler data | import asyncio
import logging
from typing import Final
from fastapi import FastAPI
from models_library.api_schemas_directorv2.dynamic_services_service import (
RunningDynamicServiceDetails,
)
from models_library.projects_nodes_io import NodeID
from models_library.services_enums import ServiceBootType, ServiceState... |
10,972 | test cal3 unified | """
GTSAM Copyright 2010-2019, Georgia Tech Research Corporation,
Atlanta, Georgia 30332-0415
All Rights Reserved
See LICENSE for the license information
Cal3Unified unit tests.
Author: Frank Dellaert & Duy Nguyen Ta (Python)
"""
import unittest
import numpy as np
from gtsam.symbol_shorthand import K, L, P
from gtsa... |
10,973 | name | # SPDX-License-Identifier: Apache-2.0
# Copyright Contributors to the Rez Project
"""
Sends a post-release email
"""
from __future__ import print_function
from rez.release_hook import ReleaseHook
from rez.system import system
from email.mime.text import MIMEText
from rez.utils.logging_ import print_warning, print_er... |
10,974 | test language equals pool intance list subtitles | from pathlib import Path
import pytest
from subliminal_patch import core
def test_scan_video_movie(tmpdir):
video_path = Path(tmpdir, "Taxi Driver 1976 Bluray 720p x264.mkv")
video_path.touch()
result = core.scan_video(str(video_path))
assert isinstance(result, core.Movie)
def test_scan_video_epi... |
10,975 | test treediff r f dis t 1 | import unittest
from ete4.coretype.tree import Tree
from ete4.tools import ete_diff as ediff
example1_nw = '(((ao:1,(ap:1,aq:1)1:1)1:1,(ar:1,(as:1,at:1)1:1)1:1)1:1,((aa:1,ab:1)1:1,((ac:1,(ad:1,(ae:1,(af:1,(ag:1,ah:1)1:1)1:1)1:1)1:1)1:1,((ai:1,(aj:1,(ak:1,al:1)1:1)1:1)1:1,(am:1,an:1)1:1)1:1)1:1)1:1);'
example2_nw = ... |
10,976 | render individual css | # lint-amnesty, pylint: disable=missing-module-docstring
from django.conf import settings as django_settings
from django.contrib.staticfiles.storage import staticfiles_storage
from pipeline.conf import settings
from pipeline.packager import Packager
from pipeline.utils import guess_type
from common.djangoapps.edxmako... |
10,977 | parse dep | import xml
from src.pipeline.parsers.ers.childless_parsers import (
parse_gea,
parse_pos,
parse_ras,
parse_spe,
)
from src.pipeline.parsers.utils import (
get_root_tag,
make_datetime_json_serializable,
tagged_children,
try_float,
)
def default_log_parser(el: xml.etree.ElementTree.Elem... |
10,978 | clean test files | import h5py as h5
import numpy as np
import os
def METHOD_NAME(route, case_name):
fem_file_name = route + '/' + case_name + '.fem.h5'
if os.path.isfile(fem_file_name):
os.remove(fem_file_name)
solver_file_name = route + '/' + case_name + '.sharpy'
if os.path.isfile(solver_file_name):
o... |
10,979 | test import job | from os import environ
import pytest
from marshmallow.exceptions import ValidationError
from azure.ai.ml import load_component, load_job
from azure.ai.ml.constants import ImportSourceType
from azure.ai.ml.constants._common import AZUREML_PRIVATE_FEATURES_ENV_VAR, AssetTypes
from azure.ai.ml.entities._builders.import_... |
10,980 | test bytes repr | import unittest
import re
from robot.utils import safe_str, prepr, DotDict
from robot.utils.asserts import assert_equal, assert_true
class TestSafeStr(unittest.TestCase):
def test_unicode_nfc_and_nfd_decomposition_equality(self):
import unicodedata
text = 'Hyv\xe4'
assert_equal(safe_str(... |
10,981 | digest path | import os
from FWCore.ParameterSet.pfnInPath import pfnInPath
import ROOT
##############################################
def METHOD_NAME(path):
##############################################
""" Ensure that everything is done for path to exist
Arguments:
- path: String that can be both directory and file
... |
10,982 | origin | """
Ethereum Virtual Machine (EVM) Environmental Instructions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. contents:: Table of Contents
:backlinks: none
:local:
Introduction
------------
Implementations of the EVM environment related instructions.
"""
from ethereum.base_types import U256, Ui... |
10,983 | attempt yaml load | from pprint import pformat
import yaml.parser
import yaml.scanner
import yaml
from awxkit.utils import args_string_to_list, seconds_since_date_string
from awxkit.api.resources import resources
from awxkit.api.mixins import HasStatus
import awxkit.exceptions as exc
from . import base
from . import page
class Unified... |
10,984 | run | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
# Name: treeYield.py
# Purpose: traverse a complex datastructure and yield elements
# that fit a given criteria
#
# Authors: Michael Scott Asato Cuthbert
#
# Copyright: Copyright ©... |
10,985 | test brace in str | """Tests for format_grammar.py."""
__copyright__ = """
Part of the Carbon Language project, under the Apache License v2.0 with LLVM
Exceptions. See /LICENSE for license information.
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
"""
import unittest
from carbon.explorer.syntax import format_grammar
class T... |
10,986 | test invalid constraint | """
Copyright 2019, the cvxpy developers.
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, ... |
10,987 | provisioning state | # 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... |
10,988 | test var units | #! /usr/bin/env python
"""
Unit tests for landlab.components.flexure.flexure
"""
import numpy as np
import pytest
from landlab import RasterModelGrid
from landlab.components import Flexure
(_SHAPE, _SPACING, _ORIGIN) = ((20, 20), (10e3, 10e3), (0.0, 0.0))
def test_method_names():
grid = RasterModelGrid((20, 20)... |
10,989 | list tags | """Handles incoming opensearch requests, invokes methods, returns responses."""
import json
from moto.core.responses import BaseResponse
from .models import opensearch_backends, OpenSearchServiceBackend
class OpenSearchServiceResponse(BaseResponse):
"""Handler for OpenSearchService requests and responses."""
... |
10,990 | on conversation suspend | import sudo
import signal
from os import path
class ReasonLoggerIOPlugin(sudo.Plugin):
"""
An example sudo plugin demonstrating how to use the sudo conversation API.
From the python plugin, you can ask something from the user using the
"sudo.conv" function. It expects one or more "sudo.ConvMessage" i... |
10,991 | ref2 | """
Copyright 2020 The OneFlow 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 law or agr... |
10,992 | set sample config | # --------------------------------------------------------
# LightHuBERT: Lightweight and Configurable Speech Representation Learning with Once-for-All Hidden-Unit BERT (https://arxiv.org/pdf/2203.15610.pdf)
# Github source: https://github.com/mechanicalsea/lighthubert
# Licensed under The MIT License [see LICENSE for ... |
10,993 | create subscriber ip requests | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... |
10,994 | rule runner | # Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import sys
from http.client import HTTPMessage
from http.server import BaseHTTPRequestHandler
from types import SimpleNamespace
import pytest
from pants.backend.url_handlers.s3.register ... |
10,995 | send request | # 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 ... |
10,996 | update field | import sys
import click
from swsscommon import swsscommon
from utilities_common.cli import AbbreviationGroup, pass_db
from .validated_config_db_connector import ValidatedConfigDBConnector
SELECT_TIMEOUT = 1000 # ms
def set_feature_state(cfgdb_clients, name, state, block):
"""Enable/disable a feature"""
ent... |
10,997 | test strftime 1 | # 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.
import unittest
import datetime
import sys
import time
from iptest import run_test, skipUnlessIronPython
class... |
10,998 | display name | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
fr... |
10,999 | test filter vlans remove | """Testing"""
import unittest
from mock import Mock
from nav.web.portadmin.utils import (
find_allowed_vlans_for_user,
find_vlans_in_org,
filter_vlans,
)
from nav.portadmin.vlan import FantasyVlan
class TestPortAdminUtil(unittest.TestCase):
"""Test PortAdmin util functions"""
# pylint: disable=C0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.