id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
10,200 | test build filter pre | from __future__ import annotations
from packaging.specifiers import SpecifierSet
from cibuildwheel.util import BuildSelector
def test_build():
build_selector = BuildSelector(build_config="cp3*-* *-manylinux*", skip_config="")
assert build_selector("cp36-manylinux_x86_64")
assert build_selector("cp37-ma... |
10,201 | set reference point vec | '''
Created on Dec 4, 2012
Module to handle dynamic decoration of LCIO classes
@author: <a href="mailto:christian.grefe@cern.ch">Christian Grefe</a>
'''
from __future__ import absolute_import, unicode_literals
from ROOT import TVector3, TLorentzVector
from pyLCIO import EVENT, IMPL, IO, UTIL
from array import array
... |
10,202 | open | """Log readers used by the log pytask commands to read out log from targets"""
import time
import os
from serial import Serial
from pylink import JLink, jlock, library
from pylink.enums import JLinkInterfaces
class URttReader:
"""A simple JLink RTT reader"""
def __init__(self, device, jlink_serial=None,
... |
10,203 | test decorator expression | # -*- coding: utf-8 -*-
from textwrap import dedent
import pytest
from parso import parse
from parso.python import tree
from parso.utils import split_lines
def test_basic_parsing(each_version):
def compare(string):
"""Generates the AST object and then regenerates the code."""
assert parse(string... |
10,204 | expected filtered table excludes | # Copyright 2022 Collate
# 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... |
10,205 | mish | import inspect
import itertools
import sys
import time
import click
import torch
torch.set_num_threads(1)
torch._C._debug_set_fusion_group_inlining(False)
def rand(*shape):
return torch.rand(*shape).mul(16).add(1)
# ------------------------------------------------------------------------------
# Shape test ca... |
10,206 | call | # Copyright (c) 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 in writ... |
10,207 | span | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
from token import LPAR, RPAR
from .attribute import Att... |
10,208 | test completions throws if prompt contains non | from unittest import mock
import pytest
from fastapi import HTTPException
from fastapi.encoders import jsonable_encoder
from pydantic import ValidationError
from mlflow.gateway.config import RouteConfig
from mlflow.gateway.constants import MLFLOW_AI_GATEWAY_ANTHROPIC_MAXIMUM_MAX_TOKENS
from mlflow.gateway.providers.a... |
10,209 | test rotate certificate | import pytest
from lemur.endpoints.views import * # noqa
from lemur.tests.factories import EndpointFactory, CertificateFactory
from .vectors import (
VALID_ADMIN_API_TOKEN,
VALID_ADMIN_HEADER_TOKEN,
VALID_USER_HEADER_TOKEN,
)
def METHOD_NAME(client, source_plugin):
from lemur.deployment.service im... |
10,210 | id | # Copyright (C) 2019-2021 Zilliz. 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 ag... |
10,211 | has children | # /*##########################################################################
#
# Copyright (c) 2016 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software... |
10,212 | test has readme | """Template to base the test of the datasets.
"""
import json
import os
import time
from threading import Lock
import git
import humanfriendly
import pytest
from datalad import api
from scripts.dats_validator.validator import validate_date_types
from scripts.dats_validator.validator import validate_is_about
from scri... |
10,213 | get search model id | """Search utility functions."""
import copy
from django.db.models import Value
from django.contrib.postgres.search import SearchVector
from lxml.html import fromstring
from lxml.cssselect import CSSSelector
from django.template.loader import render_to_string
from django.template.exceptions import TemplateSyntaxError
... |
10,214 | get samples | # 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,215 | get flags |
# http://www.absoft.com/literature/osxuserguide.pdf
# http://www.absoft.com/documentation.html
# Notes:
# - when using -g77 then use -DUNDERSCORE_G77 to compile f2py
# generated extension modules (works for f2py v2.45.241_1936 and up)
import os
from numpy.distutils.cpuinfo import cpu
from numpy.distutils.fcompiler... |
10,216 | test day id property | # This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# wger W... |
10,217 | get trim len | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
class AdaptiveMask(nn.Module):
"""Soft masking function f... |
10,218 | wait systemd boot | import uuid
import os
import re
import string
import subprocess
def get_package_list(client):
"""Return list with the installed packages.
Needs the fixture client to connect into the image"""
(exit_code, output, error) = client.execute_command("dpkg -l", quiet=True)
assert exit_code == 0, f"no {error=... |
10,219 | list | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... |
10,220 | get response status code | """
Context object of incoming request
"""
from typing import Dict, Optional, Tuple
class Context(object):
"""
Context stores model relevant worker information
Some fixed during load times and some set by the service
"""
def __init__(
self,
model_name,
model_dir,
... |
10,221 | location | # 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... |
10,222 | 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,223 | query | from typing import Optional
from collections import OrderedDict
import pandas as pd
import redshift_connector
from mindsdb_sql import parse_sql
from mindsdb_sql.render.sqlalchemy_render import SqlalchemyRender
from redshift_sqlalchemy import dialect
from mindsdb.integrations.libs.base import DatabaseHandler
from min... |
10,224 | node id | ############################ Copyrights and license ############################
# #
# Copyright 2021 Jeppe Fihl-Pearson <jeppe@tenzer.dk> #
# ... |
10,225 | test get fields cyclic with fragment | from graphql import Source, parse as parse_source
from pontoon.api.util import get_fields
class MockResolveInfo:
"""Mock of ResolveInfo with data required by get_fields.
GraphQL passes ResolveInfo objects to resolvers. They include the name of the field being
resolved, the query AST, fragments ASTs, the... |
10,226 | list | """
Microsoft Update files management via wusa.exe
:maintainer: Thomas Lemarchand
:platform: Windows
:depends: PowerShell
.. versionadded:: 2018.3.4
"""
import logging
import os
import salt.utils.platform
from salt.exceptions import CommandExecutionError
log = logging.getLogger(__name__)
# Define t... |
10,227 | get target os | #!/usr/bin/env python3
#
# Copyright 2017 Steven Watanabe
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.txt or copy at
# https://www.bfgroup.xyz/b2/LICENSE.txt)
# validates a toolset using a mock of the compiler
import BoostBuild
import os
import re
import sys
rename... |
10,228 | set bandwidth | from optparse import OptionParser
import Initializer
from InputHandlerThread import InputHandlerThread
Initializer.init_path()
from gnuradio import blocks
from gnuradio import gr
import osmosdr
class top_block(gr.top_block):
def __init__(self, sample_rate, frequency, freq_correction, rf_gain, if_gain, bb_gain... |
10,229 | cid | """Provides data related to payment."""
import re
import string
import typing as t
from mimesis.data import CREDIT_CARD_NETWORKS
from mimesis.enums import CardType, Gender
from mimesis.exceptions import NonEnumerableError
from mimesis.locales import Locale
from mimesis.providers.base import BaseProvider
from mimesis.... |
10,230 | 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
# --------------------------------... |
10,231 | add blank choice | import re
from django import forms as django_forms
from django.forms.models import fields_for_model
from nautobot.core import forms
from nautobot.core.models import querysets
__all__ = (
"add_blank_choice",
"add_field_to_filter_form_class",
"expand_alphanumeric_pattern",
"expand_ipaddress_pattern",
... |
10,232 | attempt install protobuf version | import pathlib
import platform
import re
import subprocess
import sys
from typing import List, Tuple
from pkg_resources import parse_version # noqa: F401
def get_available_protobuf_versions() -> List[str]:
"""Get a list of available protobuf versions."""
try:
output = subprocess.check_output(
... |
10,233 | translate |
"""
Extensions for using the LeapMotion controller with the wxGLWindow class.
Should be safe to use even if no controller (and no supporting Python module)
is present.
The basic functionality (though not the actual code) is cribbed from Brad
Larson's BSD-licensed Molecules app for Mac.
Copyright (c) 2013, Sunset Lake... |
10,234 | test mappings rdf | import os
import unittest
from typing import List
from pyshex.shex_evaluator import EvaluationResult
from linkml import LOCAL_MAPPINGS_YAML_FILE, LOCAL_METAMODEL_LDCONTEXT_FILE
from linkml.generators.jsonldcontextgen import ContextGenerator
from linkml.generators.jsonldgen import JSONLDGenerator
from linkml.generator... |
10,235 | test exists not | import pytest
import salt.states.mac_xattr as xattr
from tests.support.mock import MagicMock, patch
@pytest.fixture
def configure_loader_modules():
return {xattr: {}}
def METHOD_NAME():
"""
Test adding an attribute when it doesn't exist
"""
with patch("os.path.exists") as exists_mock:
e... |
10,236 | create recursively | #!/usr/bin/env python2.7
# -*- coding: utf-8; -*-
#
# (c) 2018 siveo, http://www.siveo.net
#
# This file is part of Pulse 2, http://www.siveo.net
#
# Pulse 2 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; eit... |
10,237 | test run in executor execution | # -------------------------------------------------------------------------------------------------
# Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved.
# https://nautechsystems.io
#
# Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
# You may not use this file ex... |
10,238 | use super5 | # This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__ = "biotite.application.muscle"
__author__ = "Patrick Kunzmann"
__all__ = ["Muscle5App"]
import numbers
import warnings
from tempfile import NamedTemporary... |
10,239 | test delete workout other | # This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# wger W... |
10,240 | do options | import json
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from threading import Thread
from extensions.api.util import build_parameters, try_start_cloudflared
from modules import shared
from modules.chat import generate_chat_reply
from modules.LoRA import add_lora_to_model
from modules.models imp... |
10,241 | symmetric test with odd number of elements | # SPDX-FileCopyrightText: 2021 Division of Intelligent Medical Systems, DKFZ
# SPDX-FileCopyrightText: 2021 Janek Groehl
# SPDX-License-Identifier: MIT
import unittest
from simpa.core.device_digital_twins.detection_geometries.detection_geometry_base import DetectionGeometryBase
from simpa.log.file_logger import Logger... |
10,242 | test notification method | """Tests for basic notification methods and functions in InvenTree."""
import plugin.templatetags.plugin_extras as plugin_tags
from common.notifications import (BulkNotificationMethod, NotificationMethod,
SingleNotificationMethod, storage)
from part.test_part import BaseNotificationIn... |
10,243 | pack 1byte integer | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------
# Filename: unpack.py
# Purpose: Routines for unpacking SEG Y data formats.
# Author: Lion Krischer
# Email: krischer@geophysik.uni-muenchen.de
#
# Copyright (C) 2010 Lion Krischer
# -------------------------------------... |
10,244 | equals | #
# 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... |
10,245 | test issue1799 | import copy
import pickle
import numpy
import pytest
from spacy.attrs import DEP, HEAD
from spacy.lang.en import English
from spacy.language import Language
from spacy.matcher import Matcher, PhraseMatcher
from spacy.tokens import Doc
from spacy.vectors import Vectors
from spacy.vocab import Vocab
from ..util import... |
10,246 | mounts remove | from __future__ import annotations
import os
import click
import yaml
from tutor import bindmount
from tutor import config as tutor_config
from tutor import exceptions, fmt, hooks
from tutor.commands.config import save as config_save
from tutor.commands.context import Context
from tutor.commands.params import Config... |
10,247 | cleanup | """
Copyright 2021 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,248 | scan | import jax
import jax.numpy as jnp
from pytensor.link.jax.dispatch.basic import jax_funcify
from pytensor.METHOD_NAME.op import Scan
@jax_funcify.register(Scan)
def jax_funcify_Scan(op: Scan, **kwargs):
info = op.info
if info.as_while:
raise NotImplementedError("While Scan cannot yet be converted to... |
10,249 | apply | # Copyright 2019 Xilinx Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
10,250 | test list tasks | import sys
import os
import time
import pytest
import numpy as np
thisfile = os.path.abspath(__file__)
modulepath = os.path.dirname(os.path.dirname(thisfile))
sys.path.insert(0, modulepath)
import tensorcircuit as tc
from tensorcircuit.cloud import apis, wrapper
from tensorcircuit.results import counts
if "TC_CLOUD_... |
10,251 | label to flags | """Extra methods for DesignSpaceDocument to generate its STAT table data."""
from __future__ import annotations
from typing import Dict, List, Union
import fontTools.otlLib.builder
from fontTools.designspaceLib import (
AxisLabelDescriptor,
DesignSpaceDocument,
DesignSpaceDocumentError,
LocationLabel... |
10,252 | build candidates | import os
import sys
import typing
from decimal import Decimal
from knowit import VIDEO_EXTENSIONS
if sys.version_info < (3, 8):
OS_FAMILY = str
else:
OS_FAMILY = typing.Literal['windows', 'macos', 'unix']
OPTION_MAP = typing.Dict[str, typing.Tuple[str]]
def recurse_paths(
paths: typing.Union[str, ... |
10,253 | test assign change asset permission | # -*- coding: utf-8 -*-
"""
Test onadata.libs.utils.project_utils
"""
from django.test.utils import override_settings
from kombu.exceptions import OperationalError
from mock import MagicMock, patch
from requests import Response
from onadata.apps.logger.models import Project
from onadata.apps.main.tests.test_base impo... |
10,254 | track | # Copyright 2019 Kakao Brain
#
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
#
# This source code is licensed under the BSD license found in the
# LICENSE file in the root directory of this source tree.
"""Tracks the running statistics per mini-batch instead of micro-batch."""
from typing impo... |
10,255 | progenynames | # Copyright 2020 by B. Knueven, D. Mildebrath, C. Muir, J-P Watson, and D.L. Woodruff
# This software is distributed under the 3-clause BSD License.
#Tree ideas; dlw Fall 2019
# Stage numbers and scenario numbers are one-based, but lists are all zero-based
# Tree node numbers used in node names are zero-based.
# NOTE: ... |
10,256 | drive all undriven clocks in value | import itertools
from typing import Iterable, Mapping
from magma.array import Array
from magma.circuit import Circuit, DefineCircuitKind
from magma.clock import (
ClockTypes, Clock, Reset, Enable, ResetN, AsyncReset, AsyncResetN,
is_clock_or_nested_clock)
from magma.common import (
only, IterableException,... |
10,257 | get default config | from __future__ import annotations
import glob
import logging
import os
import shutil
from typing import Any, Dict, List, Optional, Text
from rasa.engine.graph import ExecutionContext
from rasa.engine.recipes.default_recipe import DefaultV1Recipe
from rasa.engine.storage.resource import Resource
from rasa.engine.stora... |
10,258 | fin | import pytest
from settings import TEST_DATA
from suite.utils.resources_utils import (
create_example_app,
create_items_from_yaml,
create_secret_from_yaml,
delete_common_app,
delete_items_from_yaml,
delete_secret,
ensure_connection_to_public_endpoint,
get_first_pod_name,
get_ingress_... |
10,259 | build source | import unittest
from os.path import join
import numpy as np
from rastervision.core import Box
from rastervision.core.data import (
IdentityCRSTransformer, RasterizedSourceConfig, RasterizerConfig,
GeoJSONVectorSourceConfig, ClassConfig, ClassInferenceTransformerConfig,
BufferTransformerConfig)
from raster... |
10,260 | add edge | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import array
import mmap
import re
import struct
re_methodname = r"^(ENTRY|EXIT|(L.+;\..+:\((\[?(L.+;|Z|B|S|C|I|J|F|... |
10,261 | get real ip | # SPDX-License-Identifier: AGPL-3.0-or-later
# lint: pylint
# pylint: disable=missing-module-docstring, invalid-name
from __future__ import annotations
from ipaddress import (
IPv4Network,
IPv6Network,
IPv4Address,
IPv6Address,
ip_network,
)
import flask
import werkzeug
from searx.tools import con... |
10,262 | urlretrieve | #!/usr/bin/env python
import unittest
from test import test_support
import socket
import urllib
import sys
import os
import time
mimetools = test_support.import_module("mimetools", deprecated=True)
def _open_with_retry(func, host, *args, **kwargs):
# Connecting to remote hosts is flaky. Make it more robust
... |
10,263 | set up | from wagtail.models import Site, Page
from django.test import TestCase, Client
from common.tests.factories import PersonPageFactory, OrganizationPageFactory, CustomImageFactory
from home.tests.factories import HomePageFactory
from blog.models import BlogIndexPageFeature
from .factories import (
BlogIndexPageFactor... |
10,264 | test future3 | # Test various flavors of legal and illegal future statements
import unittest
from test import support
import re
rx = re.compile('\((\S+).py, line (\d+)')
def get_error_location(msg):
mo = rx.search(str(msg))
return mo.group(1, 2)
class FutureTest(unittest.TestCase):
def test_future1(self):
wit... |
10,265 | get notes grouped by work | from . import db
from openlibrary.utils.dateutil import DATE_ONE_MONTH_AGO, DATE_ONE_WEEK_AGO
class Booknotes(db.CommonExtras):
TABLENAME = "booknotes"
PRIMARY_KEY = ["username", "work_id", "edition_id"]
NULL_EDITION_VALUE = -1
ALLOW_DELETE_ON_CONFLICT = False
@classmethod
def summary(cls) -... |
10,266 | package | from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import os
required_conan_version = ">=1.43.0"
class EnjinCppSdk(ConanFile):
name = "enjincppsdk"
description = "A C++ SDK for development on the Enjin blockchain platform."
license = "Apache-2.0"
topics = (... |
10,267 | test key format | # -*- coding: utf-8 -*-
# pylint: disable=redefined-outer-name,invalid-name
"""Tests for the :mod:`aiida.repository.backend.sandbox` module."""
import io
import pathlib
import pytest
from aiida.repository.backend.sandbox import SandboxRepositoryBackend
@pytest.fixture(scope='function')
def repository():
"""Retu... |
10,268 | test other alphabets | # coding=utf-8
#
# 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 ver... |
10,269 | test quadmesh nodata | import numpy as np
from holoviews.element import QuadMesh, Image
from .test_plot import TestBokehPlot, bokeh_renderer
from bokeh.models import ColorBar
class TestQuadMeshPlot(TestBokehPlot):
def test_quadmesh_colormapping(self):
n = 21
xs = np.logspace(1, 3, n)
ys = np.linspace(1, 10, ... |
10,270 | test totals nogroup 3 dimensions | import random
import numpy as np
import pandas as pd
import pytest
from tests.utils import assert_dataframes_equals
from weaverbird.backends.pandas_executor.steps.totals import execute_totals
from weaverbird.pipeline.steps.aggregate import Aggregation
from weaverbird.pipeline.steps.totals import TotalDimension, Total... |
10,271 | test drop final batch | # 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,272 | generate ann | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import os
import os.path as osp
import mmcv
import mmengine
import numpy as np
from mmocr.utils import crop_img, dump_ocr_data
def collect_files(img_dir, gt_dir):
"""Collect all images and their corresponding groundtruth files.
Args:
i... |
10,273 | generate | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.build import check_min_cppstd
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import collect_libs, copy, get, rm, rmdir, save
from conan.tools.microsoft import is_msvc, is_msvc_static... |
10,274 | sample | # Copyright Contributors to the Pyro project.
# SPDX-License-Identifier: Apache-2.0
from typing import Callable, Dict, Optional
import torch
import pyro
import pyro.poutine as poutine
from pyro.poutine.trace_struct import Trace
from pyro.poutine.util import site_is_subsample
class Resampler:
"""Resampler for i... |
10,275 | on minimal enabled change | # noinspection PyPackageRequirements
import wx
import os
from gui.preferenceView import PreferenceView
from gui.bitmap_loader import BitmapLoader
import gui.mainFrame
from service.settings import HTMLExportSettings
import wx.lib.agw.hyperlink
_t = wx.GetTranslation
class PFHTMLExportPref(PreferenceView):
def... |
10,276 | test failing op in isolation | import re
import pytest
from dagster import (
DagsterInvariantViolationError,
DagsterTypeCheckDidNotPass,
Field,
Int,
op,
resource,
)
from dagster._core.definitions.decorators import graph
from dagster._core.definitions.input import In
from dagster._core.definitions.output import Out
from dagst... |
10,277 | test checkconfig default | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
10,278 | pydantic output to selector result | from typing import Any, Optional, Sequence
from llama_index.indices.query.schema import QueryBundle
from llama_index.llms.openai import OpenAI
from llama_index.program.base_program import BasePydanticProgram
from llama_index.program.openai_program import OpenAIPydanticProgram
from llama_index.selectors.llm_selectors i... |
10,279 | test len | import sys
from random import randint
import unittest
try:
from itertools import pairwise # type: ignore
except ImportError:
from itertools import tee
def pairwise(iterable): # type: ignore
a, b = tee(iterable)
next(b, None)
return zip(a, b)
from bitarray import bitarray
from bit... |
10,280 | setup logging | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <|... |
10,281 | gram matrix | # Copyright 2023 The Magenta 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 ... |
10,282 | test sequence generator decoder | import pytest
import torch
from ludwig.constants import HIDDEN, LOGITS
from ludwig.decoders.sequence_decoders import (
LSTMDecoder,
RNNDecoder,
SequenceGeneratorDecoder,
SequenceLSTMDecoder,
SequenceRNNDecoder,
)
from ludwig.utils.misc_utils import set_random_seed
from tests.integration_tests.param... |
10,283 | location | # 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... |
10,284 | cache test sources | # 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 llnl.util.tty as tty
from spack.package import *
class Parsec(CMakePackage, CudaPackage):
"""PaRSEC: the Pa... |
10,285 | 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... |
10,286 | function clicked | #!/usr/bin/env python3
import sys
import os
from PyQt5 import QtGui, QtWidgets, uic
from PyQt5.QtCore import Qt, QEvent
from qtvcp.core import Info
from qtvcp import logger
LOG = logger.getLogger(__name__)
INFO = Info()
class VirtualKeyboard(QtWidgets.QWidget):
def __init__(self, parent=None):
super(Virt... |
10,287 | get admin rule collection | # 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... |
10,288 | to representation | #
# 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 ... |
10,289 | test get formatted timestamp | from corehq.apps.sms.models import QueuedSMS
from corehq.messaging.smsbackends.airtel_tcl.exceptions import AirtelTCLError, InvalidDestinationNumber
from corehq.messaging.smsbackends.airtel_tcl.models import AirtelTCLBackend
from datetime import datetime
from django.test import TestCase
from unittest.mock import patch
... |
10,290 | build gui | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import os.path
import numpy as np
from PIL import Image
from astropy.io import fits
from ginga.gw import Widgets
from ginga.util.paths import ginga_home
from ginga.util.action import AttrAction
from .base im... |
10,291 | fake predict | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright © 2023, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import json
import pytest
from sasctl import current_session
from sasctl._services.model_repository import ModelRepository as mr
from sasctl.pzmm.import_model i... |
10,292 | test conflicting simple metadata | import logging
from unittest import mock
import pytest
from server.games.game_results import (
ArmyOutcome,
ArmyReportedOutcome,
GameResultReport,
GameResultReports
)
@pytest.fixture
def game_results():
return GameResultReports(game_id=42)
def test_reported_result_to_resolved():
assert Arm... |
10,293 | test ppc 7451 | # Smoke tests for 74xx cpus (aka G4).
#
# Copyright (c) 2021, IBM Corp.
#
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
from avocado_qemu import QemuSystemTest
from avocado_qemu import wait_for_console_pattern
class ppc74xxCpu(QemuSyste... |
10,294 | generate dataset id | #
# Copyright 2017-2023 - Swiss Data Science Center (SDSC)
# A partnership between École Polytechnique Fédérale de Lausanne (EPFL) and
# Eidgenössische Technische Hochschule Zürich (ETHZ).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licen... |
10,295 | convert xml | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import os
import os.path as op
from collections import namedtuple
from multiprocessing import cpu_count
from typing import Li... |
10,296 | check available | import ctypes
import sys
from collections.abc import Callable, Iterable, Sequence
from ctypes import _CData
from logging import Logger, _Level as _LoggingLevel
from multiprocessing import popen_fork, popen_forkserver, popen_spawn_posix, popen_spawn_win32, queues, synchronize
from multiprocessing.managers import SyncMan... |
10,297 | attribution | import json
from abc import ABCMeta, abstractmethod
import plotly.graph_objects as go
from geojson import Feature
from ohsome_quality_api.definitions import get_attribution, get_metadata
from ohsome_quality_api.indicators.models import IndicatorMetadata, Result
from ohsome_quality_api.topics.models import BaseTopic a... |
10,298 | do post | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
import websocket
import threading
from parlai.core.params import ParlaiParser
from parlai.scripts.interactiv... |
10,299 | list tags for resource | import json
from typing import Any, Dict, List, Tuple
from moto.core.utils import iso_8601_datetime_with_milliseconds, utcnow
from moto.iam.exceptions import IAMNotFoundException
from moto.iam.models import iam_backends, IAMBackend
from moto.codepipeline.exceptions import (
InvalidStructureException,
PipelineN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.