id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
4,100
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 __all__ =...
4,101
delete
import functools import json import os from datetime import datetime, timedelta, timezone import subprocess import time from typing import Any, Dict, List, Tuple from time import sleep from joblib import Parallel, delayed import requests_wrapper as requests import logging from datahub.cli import cli_utils from datahub...
4,102
plugin reconfigure
# -*- coding: utf-8 -*- # FOGLAMP_BEGIN # See: https://foglamp-foglamp-documentation.readthedocs-hosted.com # FOGLAMP_END """ Plugin module which adds a square block of specific monochrome shade on images """ import os import logging import datetime import filter_ingest import traceback import copy import json impor...
4,103
go to last page
import discord from redbot.core.bank import get_currency_name from redbot.vendored.discord.ext import menus class BadgeMenu(menus.MenuPages, inherit_buttons=False): def __init__( self, source: menus.PageSource, timeout: int = 30, can_buy=False, ): super().__init__( ...
4,104
test send confirmation email
# coding: utf-8 from flask import render_template, url_for from itsdangerous import URLSafeTimedSerializer from mock import patch from webapp.notifications import send_confirmation_email, send_reset_password_email from webapp.utils import get_timed_serializer from .base import BaseTestCase class NotificationsTestCa...
4,105
test missing column
import json import os import pytest from dbt.tests.util import run_dbt from dbt.tests.adapter.persist_docs.fixtures import ( _DOCS__MY_FUN_DOCS, _MODELS__MISSING_COLUMN, _MODELS__MODEL_USING_QUOTE_UTIL, _MODELS__NO_DOCS_MODEL, _MODELS__TABLE, _MODELS__VIEW, _PROPERTIES__QUOTE_MODEL, _P...
4,106
test angle sexagesimal args
"""Tests of whether units behave.""" from assay import assert_raises from numpy import array, nan from skyfield.units import ( Angle, Distance, Velocity, UnpackingError, WrongUnitError, ) try: from astropy import units as u except ImportError: u = None def needs_astropy(test): """Skip `test` if Astro...
4,107
test brackets
from common import * from trezor.utils import ensure from apps.common.paths import * # NOTE: moved into tests not to occupy flash space # in firmware binary, when it is not used in production class NeverMatchingSchema: @staticmethod def match(path: "Bip32Path") -> bool: return False class TestPaths(u...
4,108
c main
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Convert plain qtest traces to C or Bash reproducers Use this to help build bug-reports or create in-tree reproducers for bugs. Note: This will not format C code for you. Pipe the output through clang-format -style="{BasedOnStyle: llvm, IndentWidth: 4, ColumnLimit: 90...
4,109
get to choices
# Copyright The IETF Trust 2013-2020, All Rights Reserved # -*- coding: utf-8 -*- from django import forms from ietf.group.models import Group, Role from ietf.utils.html import unescape from ietf.ietfauth.utils import has_role from ietf.message.models import Message, AnnouncementFrom from ietf.utils.fields import Mu...
4,110
rst body
# Copyright (C) British Crown (Met Office) & Contributors. # This file is part of Rose, a framework for meteorological suites. # # Rose is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the L...
4,111
lint file
from __future__ import annotations import abc import glob from collections.abc import Iterable from pathlib import Path from typing import Any, Protocol import click import yaml from commodore.config import Config from commodore.helpers import yaml_load_all from .lint_dependency_specification import lint_componen...
4,112
test serialisation with zero alpha
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
4,113
rouge
# Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
4,114
add args
# 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. from fairseq import utils from fairseq.models import ( FairseqLanguageModel, register_model, register_model_architecture, ) from f...
4,115
prepare
#!/usr/bin/env python3 # ------------------------------------------------------------------------- # # Part of the CodeChecker project, under the Apache License v2.0 with # LLVM Exceptions. See LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # ----------------------------...
4,116
start vertex
from compas.geometry import BrepEdge from compas.geometry import Line from compas.geometry import Circle from compas.geometry import Ellipse from compas.geometry import Frame from compas.geometry import Arc from compas_rhino.geometry import RhinoNurbsCurve from compas_rhino.conversions import curve_to_compas_line from ...
4,117
get send msg progress
import base64 import hmac import time from common.sdk.im.mixin import BaseRequest from common.sdk.im.utils import digest, as_request from common.utils import get_logger from users.utils import construct_user_email logger = get_logger(__file__) def sign(secret, data): digest = hmac.HMAC( key=secret.enco...
4,118
test swap name
import json from django.contrib.messages import get_messages from django.test import Client, TestCase from django.urls import reverse from unittest import mock from corehq.apps.domain.shortcuts import create_domain from corehq.apps.locations.exceptions import LocationConsistencyError from corehq.apps.locations.model...
4,119
widgets
''' conv_ellipse.py Copyright (C) 2021, 2022 Phillip A Carter Copyright (C) 2021, 2022 Gregory D Carl 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 o...
4,120
alanize fix
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
4,121
test subscription manager list docs
import doctest from insights.parsers import subscription_manager_list from insights.tests import context_wrap subscription_manager_list_consumed_in_docs = ''' +-------------------------------------------+ Consumed Subscriptions +-------------------------------------------+ Subscription Name: Red Hat Enterprise Lin...
4,122
test qa mocks
# Licensed under a 3-clause BSD style license - see LICENSE.rst # -*- coding: utf-8 -*- """Test desitarget.QA. """ import unittest import os import sys import shutil import tempfile import warnings import numpy as np import healpy as hp from pkg_resources import resource_filename from glob import glob from desitarget.Q...
4,123
print sol
# 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. import numpy as np import pyomo.environ as pyo import mpisppy.utils.sputils as sputils from mpisppy.extensions.extension import Extension class NetworkDesignTracker(Exten...
4,124
get energies
#Copyright (c) 2008 Erik Tollerud (etolleru@uci.edu) import numpy as np class Pca: """ A basic class for Principal Component Analysis (PCA). p is the number of dimensions, while N is the number of data points """ _colors=('r','g','b','c','y','m','k') #defaults def __calc(self): A = s...
4,125
test has permission as non owner
""" Tests for API permissions classes. """ import ddt import pytest from django.contrib.auth.models import AnonymousUser from django.http import Http404 from django.test import RequestFactory, TestCase from opaque_keys.edx.keys import CourseKey from rest_framework.generics import GenericAPIView from common.djangoapps....
4,126
sample n
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
4,127
test parse device information success
from typing import Dict import pytest from opentrons.drivers import utils from opentrons.drivers.types import ( Temperature, PlateTemperature, RPM, HeaterShakerLabwareLatchStatus, ) @pytest.mark.parametrize( argnames=["input_str", "expected_result"], argvalues=[ [ "version:...
4,128
on track end
import logging from datetime import timedelta from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Type, Union from ..adapters.api_objects import Song from .base import PlayerDeviceEvent, PlayerEvent from .chromecast import ChromecastPlayer # noqa: F401 from .mpv import MPVPlayer # noqa: F401 class ...
4,129
irreps in
import torch from e3nn import o3 from e3nn.nn import Extract, Activation from e3nn.util.jit import compile_mode @compile_mode("script") class _Sortcut(torch.nn.Module): def __init__(self, *irreps_outs) -> None: super().__init__() self.irreps_outs = tuple(o3.Irreps(irreps).simplify() for irreps in...
4,130
detector fails properly
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com from json import loads from unittest import mock from preggy import...
4,131
reference
from typing import List import re class Technicaldetails: def __init__(self, node): self.node = node @property def request(self) -> str: if self.node in ('', None): return '' return self.node.findtext('Request', '') @property def response(self) -> str: ...
4,132
test effective url
# -*- coding: utf-8 -*- """Integration tests with httplib2""" import sys from six.moves.urllib_parse import urlencode import pytest import pytest_httpbin.certs import vcr from assertions import assert_cassette_has_one_response httplib2 = pytest.importorskip("httplib2") def http(): """ Returns an httplib2...
4,133
test daemon
import logging import time from dagster import DagsterEvent, DagsterEventType, EventLogEntry from dagster._core.instance import DagsterInstance from dagster._core.test_utils import create_run_for_test from dagster._daemon.auto_run_reexecution.event_log_consumer import ( EventLogConsumerDaemon, get_new_cursor, ...
4,134
set up class
from typing import Tuple import unittest import panda.tests.safety.common as common from panda.tests.libpanda import libpanda_py from panda.tests.safety.common import make_msg class Buttons: NONE = 0 RESUME = 1 SET = 2 CANCEL = 4 PREV_BUTTON_SAMPLES = 8 ENABLE_BUTTONS = (Buttons.RESUME, Buttons.SET, Button...
4,135
print applied undef
from sympy.core import Symbol from sympy.core import S from sympy.printing.precedence import precedence from psydac.pyccel.codegen.printing.pycode import PythonCodePrinter as PyccelPythonCodePrinter from sympde.topology.derivatives import _partial_derivatives from sympde.topology import SymbolicExpr #==...
4,136
package
from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os, fix_apple_shared_install_name from conan.tools.build import cross_building from conan.tools.env import VirtualBuildEnv, VirtualRunEnv from conan.tools.files import get, copy, rmdir, rm, export_conan...
4,137
sample
import random from typing import Any, Dict, List, Optional, cast from lale.helpers import nest_HPparams from lale.lib.lale import NoOp from lale.operators import ( BasePipeline, IndividualOp, Operator, OperatorChoice, PlannedOperator, clone_op, make_choice, make_pipeline, make_pipel...
4,138
read
#!/usr/bin/env python3 # # Cross Platform and Multi Architecture Advanced Binary Emulation Framework # import ctypes from qiling.hw.peripheral import QlPeripheral class CortexMNvic(QlPeripheral): class Type(ctypes.Structure): _fields_ = [ ('ISER' , ctypes.c_uint32 * 8), ('RE...
4,139
test false bool home
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """Unit tests for the `iris.io.expand_filespecs` function.""" # Import iris.tests first so that some things can be initialised...
4,140
inductor aten mm
import torch import torch._dynamo import torch._dynamo.config import torch._inductor.config as config import triton from benchmark_helper import time_with_torch_timer # The flag below controls whether to allow TF32 on matmul. This flag defaults to True. torch.backends.cuda.matmul.allow_tf32 = True # The flag below co...
4,141
set target region
# # AUTHOR(S): Caitlin Haedrich <caitlin DOT haedrich AT gmail> # # PURPOSE: This module contains utility functions for InteractiveMap. # # COPYRIGHT: (C) 2021-2022 Caitlin Haedrich, and by the GRASS Development Team # # This program is free software under the GNU General Public # License (>=v2)...
4,142
values or range
from portality.lib import dates, plugin import json from portality.lib.dates import FMT_DATE_STD DO_TYPE_TO_JSON_TYPE = { "str": "string", "utcdatetime": "timestamp", "integer": 0, "bool": True, "float": 0.0, "isolang": "string", "url": "string", "isolang_2letter": "string", "bigen...
4,143
last modified at
# 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 ._en...
4,144
safe int
# Copyright (c) 2016 Tomas Machalek <tomas.machalek@gmail.com> # Copyright (c) 2016 Charles University, Faculty of Arts, # Institute of the Czech National Corpus # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as publis...
4,145
new main mod
# # Copyright (c) 2009- Spyder Kernels Contributors # # Licensed under the terms of the MIT License # (see spyder_kernels/__init__.py for details) import linecache import os.path import types import sys def METHOD_NAME(filename, modname): """ Reimplemented from IPython/core/interactiveshell.py to avoid cachi...
4,146
update data
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from __future__ import annotations import logging from schema import Schema, Optional from typing_extensions import Literal from nni import ClassArgsValidator from nni.assessor import Assessor, AssessResult from nni.utils import extract_scalar...
4,147
test provides user
#!/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. """ Tests `requires_provides.py`. """ import unittest from antlir.compiler.requires_provides import ( _normalize...
4,148
get qt ui
# -*- coding: utf-8 -*- """ Created on Thu Jul 30 13:13:27 2015 """ from nplab.utils.gui import QtWidgets, uic, QtCore import os from nplab.instrument.visa_instrument import VisaInstrument from nplab.instrument.temperatureControl import TemperatureControlMixin class OxfordITC(VisaInstrument, TemperatureControlMixi...
4,149
get dimension config
# -*- coding: utf-8 -*- from django.utils import translation from django.utils.translation import ugettext_lazy as _ from pipeline.core.flow.io import ObjectItemSchema, StringItemSchema from api.collections.monitor import BKMonitorClient from pipeline_plugins.base.utils.inject import supplier_account_for_business from...
4,150
options
"""Init file for Supervisor Supervisor RESTful API.""" import asyncio from collections.abc import Awaitable import logging from typing import Any from aiohttp import web import voluptuous as vol from ..const import ( ATTR_ADDONS, ATTR_ADDONS_REPOSITORIES, ATTR_ARCH, ATTR_AUTO_UPDATE, ATTR_BLK_READ...
4,151
test read unknown error
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the internal implementation details of L{twisted.internet.udp}. """ import socket from twisted.internet import udp from twisted.internet.protocol import DatagramProtocol from twisted.python.runtime import platformType from twisted...
4,152
read
# Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved. # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # http://www.apache.org/licenses/LICENSE-2.0 # or in the "license" file...
4,153
retrieve inventory
# Copyright 2019 Lenovo # # 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, soft...
4,154
handle subawards
import copy import logging from sys import maxsize from django.conf import settings from django.db.models import Count from rest_framework.response import Response from rest_framework.views import APIView from elasticsearch_dsl import Q from usaspending_api.awards.v2.filters.sub_award import subaward_filter from usas...
4,155
test encode input data
import pytest import torch from ignite.distributed.comp_models.base import _SerialModel, ComputationModel def test_serial_model(): _SerialModel.create_from_backend() model = _SerialModel.create_from_context() assert model.get_local_rank() == 0 assert model.get_rank() == 0 assert model.get_world_...
4,156
find config templates
#!/usr/bin/env python """script to concatenate the dirac.cfg file's Systems sections with the content of the ConfigTemplate.cfg files.""" from collections import OrderedDict import logging import os import re import textwrap import sys import shutil from diracdoctools.Config import Configuration from diracdoctools.Uti...
4,157
get render dir
""" Flowblade Movie Editor is a nonlinear video editor. Copyright 2012 Janne Liljeblad. This file is part of Flowblade Movie Editor <https://github.com/jliljebl/flowblade/>. Flowblade Movie Editor is free software: you can redistribute it and/or modify it under the terms of the GNU General Public ...
4,158
pieslice
# # The Python Imaging Library # $Id$ # # WCK-style drawing interface operations # # History: # 2003-12-07 fl created # 2005-05-15 fl updated; added to PIL as ImageDraw2 # 2005-05-15 fl added text support # 2005-05-20 fl added arc/chord/pieslice support # # Copyright (c) 2003-2005 by Secret Labs AB # Copyright ...
4,159
test hackrf class send
import time import unittest import os import tempfile import numpy as np from urh.util import util util.set_shared_library_path() from urh.dev.native.lib import hackrf from urh.dev.native.Rad1o import Rad1o class TestHackRF(unittest.TestCase): def callback_fun(self, buffer): print(buffer) for ...
4,160
render
from typing import cast, List, Optional, TYPE_CHECKING, Union from ._spinners import SPINNERS from .measure import Measurement from .table import Table from .text import Text if TYPE_CHECKING: from .console import Console, ConsoleOptions, RenderResult, RenderableType from .style import StyleType class Spinn...
4,161
test pyobj constructor
import neuron import pytest def test_hocbase(): class MyList(neuron.HocBaseObject, hoc_type=neuron.h.Vector): pass assert issubclass(MyList, neuron.hoc.HocObject) assert issubclass(MyList, neuron.HocBaseObject) assert MyList._hoc_type == neuron.h.Vector def test_hoc_template_hclass(): n...
4,162
tool activated
import unicodedata from PyQt5.QtCore import Qt from PyQt5.QtGui import QColor, QKeySequence, QPainterPath from PyQt5.QtWidgets import QApplication from trufont.drawingTools.baseTool import BaseTool _path = QPainterPath() _path.moveTo(5.29, 17.96) _path.lineTo(6.94, 17.96) _path.lineTo(7.36, 21.5) _path.lineTo(7.78, ...
4,163
get author
# Code generated by sqlc. DO NOT EDIT. # versions: # sqlc v1.21.0 # source: query.sql import dataclasses import datetime from typing import AsyncIterator, List, Optional import sqlalchemy import sqlalchemy.ext.asyncio from booktest import models BOOKS_BY_TAGS = """-- name: books_by_tags \\:many SELECT book_id,...
4,164
test unpassed entrance exam
""" Milestone related tests for the mobile_api """ from unittest.mock import patch from crum import set_current_request from django.conf import settings from common.djangoapps.util.milestones_helpers import add_prerequisite_course, fulfill_course_milestone from lms.djangoapps.courseware.access_response import Miles...
4,165
check exists
import re from pathlib import PurePosixPath from typing import TYPE_CHECKING, Optional, Type from lisa.executable import Tool from lisa.tools.ls import Ls from lisa.tools.mkdir import Mkdir from lisa.tools.powershell import PowerShell from lisa.tools.rm import Rm from lisa.util import LisaException, is_valid_url if T...
4,166
create annotation table
"""create annotation table Revision ID: 7f8b8920355f Revises: c1d316c60985 Create Date: 2022-01-29 20:23:29.996133 """ from alembic import op import click import sqlalchemy as sa # revision identifiers, used by Alembic. revision = "7f8b8920355f" down_revision = "c1d316c60985" branch_labels = None depends_on = None ...
4,167
test task postrun handler
import uuid from unittest import mock import celery from django.test import TestCase from documents.data_models import ConsumableDocument from documents.data_models import DocumentSource from documents.models import PaperlessTask from documents.signals.handlers import before_task_publish_handler from documents.signal...
4,168
test compute angstrom coeff
from __future__ import annotations import numpy as np import pytest from pyaerocom.aux_var_helpers import ( _calc_od_helper, calc_abs550aer, calc_ang4487aer, calc_od550aer, calc_od550gt1aer, calc_od550lt1aer, compute_angstrom_coeff, compute_od_from_angstromexp, vmrx_to_concx, ) d...
4,169
extract into event
import json from copy import deepcopy from sentry_sdk.hub import Hub, _should_send_default_pii from sentry_sdk.utils import AnnotatedValue from sentry_sdk._compat import text_type, iteritems from sentry_sdk._types import TYPE_CHECKING if TYPE_CHECKING: import sentry_sdk from typing import Any from typin...
4,170
printf
#!/usr/bin/env python3 # # Copyright (c) 2014-2017, Linaro Limited # # SPDX-License-Identifier: BSD-3-Clause import argparse import os import subprocess import sys def get_args(): parser = argparse.ArgumentParser(description='Shows the memory usage ' 'of an OP-TEE based on EL...
4,171
check escalation finished task
import datetime import typing import requests from celery import shared_task from django.conf import settings from django.db.models import Q from django.utils import timezone from apps.alerts.tasks.task_logger import task_logger from common.database import get_random_readonly_database_key_if_present_otherwise_default...
4,172
not acceptable
import warnings import pytest from starlette.exceptions import HTTPException, WebSocketException from starlette.middleware.exceptions import ExceptionMiddleware from starlette.requests import Request from starlette.responses import JSONResponse, PlainTextResponse from starlette.routing import Route, Router, WebSocket...
4,173
test trigger set math1
# # @file TestTrigger.py # @brief SBML Trigger unit tests # # @author Akiya Jouraku (Python conversion) # @author Sarah Keating # # ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ====== # # DO NOT EDIT THIS FILE. # # This file was generated automatically by converting the file located a...
4,174
kill process
"""Internal py2/3 compatibility library. A little more than six.""" import inspect import os import shlex import sys import threading import time from contextlib import contextmanager from datetime import timezone from types import ModuleType from typing import Any, Callable, List, Sequence, Type import pendulum from ...
4,175
communicated node list
#------------------------------------------------------------------------------- # DistributedBoundary #------------------------------------------------------------------------------- from PYB11Generator import * from Boundary import * from BoundaryAbstractMethods import * @PYB11template("Dimension") class Distribute...
4,176
get application output
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
4,177
report error
#!/usr/bin/env python3 import requests import os import sys CURDIR = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(CURDIR, "helpers")) from pure_http_client import ClickHouseClient class Tester: """ - Creates test table with multiple integer columns - Runs read queries with...
4,178
test user can read all
from rest_framework import status from care.users.models import GENDER_CHOICES, User from care.utils.tests.test_base import TestBase class TestSuperUser(TestBase): def setUp(self): """ Run once before every test - login the super user """ self.client.force_authenticate...
4,179
run
# -*- coding: utf-8 -*- """ amanzi_xml ~~~~~~~~~~ Original code from sphinx.directives.code - literalinclude directive :copyright: Copyright 2007-2011 by the Sphinx team, see Sphinx AUTHORS. :license: BSD, see Sphinx LICENSE for details. Derivative work - custom amanzi_xml_include directive ...
4,180
test cache list
""" :codeauthor: Jayesh Kariya <jayeshk@saltstack.com> Test cases for salt.modules.npm """ import textwrap import pytest import salt.modules.npm as npm import salt.utils.json from salt.exceptions import CommandExecutionError from tests.support.mock import MagicMock, patch @pytest.fixture def configure_lo...
4,181
build update
#!/usr/bin/env python """ Module running the set command ============================== Update data of experiments and trials in the storage """ import argparse import logging import sys # pylint:disable=consider-using-from-import import orion.core.io.experiment_builder as experiment_builder from orion.core.utils.pp...
4,182
test angled drill hole
#************************************************************************** # Copyright (c) 2017 Kurt Kremitzki <kkremitzki@gmail.com> * # * # This file is part of the FreeCAD CAx development system. * # ...
4,183
parse file entry
# -*- coding: utf-8 -*- """File system stat object parser.""" import pytsk3 from dfvfs.lib import definitions as dfvfs_definitions from plaso.containers import events from plaso.parsers import interface from plaso.parsers import manager class FileStatEventData(events.EventData): """File system stat event data. ...
4,184
monkey patch
# SPDX-FileCopyrightText: Red Hat, Inc. # SPDX-License-Identifier: GPL-2.0-or-later from __future__ import absolute_import from __future__ import division from contextlib import contextmanager from functools import wraps import inspect import six # # Monkey patch. # # Usage: # --- # import monkeypatch # # class Te...
4,185
get resolvable version
import platform import json import argparse import urllib import urllib.request from subprocess import check_call, CalledProcessError import sys import os import zipfile import tarfile import time from packaging.version import Version, InvalidVersion # SOURCE OF THIS FILE: https://github.com/actions/python-versions #...
4,186
connect
# tbot, Embedded Automation Tool # Copyright (C) 2019 Harald Seiler # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
4,187
word problem
""" Abelian group elements AUTHORS: - David Joyner (2006-02); based on free_abelian_monoid_element.py, written by David Kohel. - David Joyner (2006-05); bug fix in order - David Joyner (2006-08); bug fix+new method in pow for negatives+fixed corresponding examples. - David Joyner (2009-02): Fixed bug in order. - ...
4,188
is random datapipe
import inspect import warnings from typing import Any, List, Optional, Set import torch from torch.utils.data.datapipes.iter.sharding import ( _ShardingIterDataPipe, SHARDING_PRIORITIES, ) from torch.utils.data.graph import DataPipe, DataPipeGraph, traverse_dps __all__ = [ "apply_random_seed", "appl...
4,189
scan completed
import logging from ipaddress import IPv4Address from queue import Queue from threading import Barrier, Event from typing import Callable, Collection, Iterable, Sequence, Tuple from unittest.mock import MagicMock import pytest from tests.unit_tests.infection_monkey.master.mock_puppet import MockPuppet from common imp...
4,190
service loop
# # Copyright (c) 2011-2014 Red Hat, Inc. <http://www.redhat.com> # This file is part of GlusterFS. # This file is licensed to you under your choice of the GNU Lesser # General Public License, version 3 or any later version (LGPLv3 or # later), or the GNU General Public License, version 2 (GPLv2), in all # cases as pu...
4,191
get form kwargs
from django.contrib.auth.mixins import PermissionRequiredMixin, LoginRequiredMixin from django.db import transaction from django.urls import reverse from django.utils.translation import gettext_lazy as _ from django.views.generic import ( CreateView, UpdateView, ListView, ) from tapir.accounts.models impor...
4,192
ensure localedir
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2018 (ita) """ Support for translation tools such as msgfmt and intltool Usage:: def configure(conf): conf.load('gnu_dirs intltool') def build(bld): # process the .po files into .gmo files, and install them in LOCALEDIR bld(features='intltool_po', ...
4,193
forward
# 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 torch import torch.nn.functional as F from fairseq import utils from fairseq.incremental_decoding_utils import with_incremental_state ...
4,194
test record deletion status default
# -*- coding: utf-8 -*- # # Copyright (C) 2023 TU Wien. # # Invenio-RDM-Records is free software; you can redistribute it and/or modify # it under the terms of the MIT License; see LICENSE file for more details. """Tests for the tombstone field and record deletion field.""" import datetime import pytest from invenio...
4,195
uploaded image file
import os from contextlib import contextmanager from django.conf import settings from django.contrib.auth import get_user_model from django.core.files.base import ContentFile from grandchallenge.algorithms.models import Algorithm, AlgorithmImage from grandchallenge.archives.models import Archive, ArchiveItem from gra...
4,196
balance
from PyQt5.QtCore import pyqtProperty, pyqtSignal, pyqtSlot, QObject from electrum.logging import get_logger from .auth import auth_protect, AuthMixin from .qetransactionlistmodel import QETransactionListModel from .qetypes import QEAmount from .qewallet import QEWallet class QEAddressDetails(AuthMixin, QObject): ...
4,197
test composition level stateful function resets
import psyneulink as pnl import pytest import numpy as np @pytest.mark.composition class TestCompositionMethods: def test_get_output_values_prop(self): A = pnl.ProcessingMechanism() c = pnl.Composition() c.add_node(A) result = c.run(inputs={A: [1]}, num_trials=2) assert res...
4,198
main
"""Image classification benchmark. This script runs image classification benchmark with "dogs vs cats" datasets. It supports the following 3 models: - EfficientNetV2B0 - Xception - ResNet50V2 To run the benchmark, make sure you are in model_benchmark/ directory, and run the command below: python3 -m model_benchmark...
4,199
json
""" ******************************************************************* Copyright (c) 2017, 2019 IBM Corp. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 and Eclipse Distribution License v1.0 which accompany this distributi...