id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
12,100
parse
""" Parser for Lucene syntax. The query parser which converts our subset of the Apache Lucene syntax and transforms it into a MultiDict structure that h.search understands. """ from collections import namedtuple from functools import lru_cache import pyparsing as pp from webob.multidict import MultiDict # Enable me...
12,101
blocks relay conn tests
#!/usr/bin/env python3 # Copyright (c) 2019-2022 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test p2p blocksonly mode & block-relay-only connections.""" import time from test_framework.messages ...
12,102
prepare
# ======================================================================================== # Parthenon performance portable AMR framework # Copyright(C) 2020 The Parthenon collaboration # Licensed under the 3-clause BSD License, see LICENSE file for details # ============================================================...
12,103
search
# Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html from __future__ import annotations from typing import cast import aqt import aqt.browser from aqt.browser.sidebar.item import SidebarItem from aqt.qt import * from aqt.theme import theme_mana...
12,104
test set operation mode to highdemand
from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.components.water_heater import ( STATE_ECO, STATE_ELECTRIC, STATE_HEAT_PUMP, STATE_HIGH_DEMAND, STATE_OFF, STATE_PERFORMANCE, WaterHeaterEntityFeature, ) from homeassistant.const import PRECISION_WH...
12,105
updatepar
#!/usr/bin/python3 from smarthome.smartbase import Sbase from typing import Dict import logging log = logging.getLogger(__name__) class Sacthor(Sbase): def __init__(self) -> None: # setting super().__init__() self._smart_paramadd = {} # type: Dict[str, str] self._device_acthortype...
12,106
test active io flushed
#!/usr/bin/env python3 # # Tests for active mirroring # # Copyright (C) 2018 Red Hat, Inc. # # 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...
12,107
test mpirun command errors
""" Tests the QCEngine compute module configuration """ import copy try: import pydantic.v1 as pydantic except ImportError: import pydantic import pytest import qcengine as qcng from qcengine.config import NodeDescriptor from qcengine.util import create_mpi_invocation, environ_context def test_node_blank()...
12,108
test version updated
""" Tests for `kolibri.utils.main` module. """ from __future__ import absolute_import from __future__ import print_function import unittest import pytest from django.db.utils import OperationalError from mock import patch import kolibri from kolibri.utils import main from kolibri.utils.version import truncate_versio...
12,109
find inps
# Copyright 2017 Battelle Energy Alliance, 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 t...
12,110
test permutation from id
################################################################################ # # Copyright (c) 2013 The MadGraph Development team and Contributors # # This file is a part of the MadGraph 5 project, an application which # automatically generates Feynman diagrams and matrix elements for arbitrary # high-energy proce...
12,111
set up class
import unittest import os import overrides_hack from utils import run, create_sparse_tempfile, create_lio_device, delete_lio_device, fake_utils, fake_path, TestTags, tag_test import gi gi.require_version('GLib', '2.0') gi.require_version('BlockDev', '3.0') from gi.repository import GLib, BlockDev class DevMapperTes...
12,112
add or update project collaborator
# THIS FILE IS AUTO-GENERATED. DO NOT EDIT class CollaboratorApi: def __init__(self, client, base_path = "/v1"): self.client = client self.base_path = base_path def addOrUpdateDatasetCollaborator(self, body=None): __query = { } if body is None: raise Exception("Missing required parameter...
12,113
test wrap exception
from docker.errors import APIError import unittest from codalab.worker.docker_utils import ( DockerUserErrorException, DockerException, wrap_exception, parse_image_progress, ) class ParseImageProgressTest(unittest.TestCase): def test_parse_image_progress_expected(self): image_info = { ...
12,114
init
#!/usr/bin/env python ''' Proximity sensor module Peter Barker, August 2020 Deals with proximity sensor data like 360-degree lidars from the vehicle. Plots them on the map, for example. ''' import os import os.path import sys from pymavlink import mavutil import errno import time import math from MAVProxy.modules...
12,115
get locales key
# -------------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: invesalius@cti.gov.br # License: GNU...
12,116
test bad direction raises error
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. """ Tests for the spatial activity class """ import pytest from flowmachine.core import make_spatial_unit from flowmach...
12,117
materialize
# Licensed to Modin Development Team under one or more contributor license agreements. # See the NOTICE file distributed with this work for additional information regarding # copyright ownership. The Modin Development Team licenses this file to you under the # Apache License, Version 2.0 (the "License"); you may not u...
12,118
set config
from .cspace import CSpace from .. import robotsim from ..model import collide from ..model import trajectory from ..math import vectorops,so3,se3 import math import random class RigidObjectCSpace(CSpace): """A basic free-flying rigid object cspace that allows collision free motion. The C-space is 6D, with pa...
12,119
soft fuse squeeze
# # 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 writi...
12,120
test invalid user id
from rest_framework import status from sentry.models import NotificationSetting from sentry.notifications.types import NotificationSettingOptionValues, NotificationSettingTypes from sentry.testutils.cases import APITestCase from sentry.testutils.silo import control_silo_test from sentry.types.integrations import Exter...
12,121
load config
# -*- coding: utf-8 -*- # # 2016-04-08 Cornelius Kölbel <cornelius@privacyidea.org> # Avoid consecutive if-statements # 2015-02-25 Cornelius Kölbel <cornelius@privacyidea.org> # Initial writup # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU...
12,122
rotation lambda arn
# 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...
12,123
from indices shape
# Copyright 2023 The JAX 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
12,124
test killed subprocess
import os import sys import pytest import jedi from jedi.api.environment import get_default_environment, find_virtualenvs, \ InvalidPythonEnvironment, find_system_environments, \ get_system_environment, create_environment, InterpreterEnvironment, \ get_cached_default_environment def test_sys_path(): ...
12,125
get doors max list
from functools import lru_cache from math import floor from typing import List, Collection from pkgutil import get_data def build_weighted_int_list(inputs: Collection[float], total: int) -> List[int]: """ Converts a list of floats to a list of ints of a given length, using the Largest Remainder Method. ""...
12,126
on activate
import enum import logging import os import time import subprocess import attr from ..factory import target_factory from ..step import step from ..util.managedfile import ManagedFile from .common import Driver from ..driver.exception import ExecutionError from ..util.helper import processwrapper from ..util import T...
12,127
test credential rotate api key only
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import py...
12,128
regex
#!/usr/bin/env python """Standard RDFValues.""" import re from typing import Text from urllib import parse as urlparse from grr_response_core.lib import config_lib from grr_response_core.lib import rdfvalue from grr_response_core.lib.rdfvalues import structs as rdf_structs from grr_response_core.lib.util import pre...
12,129
cf resources
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
12,130
pad loss mask
# Copyright © 2022 BAAI. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License") import pandas as pd import os import numpy as np import torch from torch.utils.data import Dataset from flagai.auto_model.auto_loader import AutoLoader from flagai.trainer import Trainer from tqdm import tqd...
12,131
header parameters
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
12,132
test tuple float range interact with step
from datetime import date from bokeh.models import Column as BkColumn, Div as BkDiv from panel import widgets from panel.interact import interactive from panel.models import HTML as BkHTML from panel.pane import HTML def test_interact_title(): def test(a): return a interact_pane = interactive(test,...
12,133
on moved
import asyncio import queue import pathlib import click from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler import watchdog.events as events from typing import TYPE_CHECKING if TYPE_CHECKING: from aim._sdk.repo import Repo class SourceFileChangeHandler(FileSystemEventHandl...
12,134
test write image
#!/usr/bin/env python """Perform a functional test of the plot command.""" import random import pytest import orion.core.cli import orion.plotting.backend_plotly from orion.core.cli.plot import IMAGE_TYPES, VALID_TYPES from orion.plotting.base import SINGLE_EXPERIMENT_PLOTS from orion.storage.base import setup_storag...
12,135
delete objects
""" Definition for abstract Object storage manager class """ # Copyright (c) 2019, IRIS-HEP # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the a...
12,136
get cloudkit server shared data
import glob import os import nska_deserialize as nd import sqlite3 import datetime import io from scripts.artifact_report import ArtifactHtmlReport from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_readonly def get_cloudkitSharing(files_found, report_folder, seeker, wrap_text):...
12,137
test python types
import json import warnings from collections import OrderedDict, UserDict import hypothesis.strategies as hst import numpy as np import pytest from hypothesis import given with warnings.catch_warnings(): # this context manager can be removed when uncertainties # no longer triggers deprecation warnings war...
12,138
sigma clipped mean
from __future__ import absolute_import, division, print_function, unicode_literals import numpy as np from banzai.utils import median_utils __author__ = 'cmccully' def median(d, axis=None, mask=None): """ Find the median of a numpy array. If an axis is provided, then find the median along the given axis...
12,139
run
""" Table of Contents Extension for Python-Markdown * * * (c) 2008 [Jack Miller](http://codezen.org) Dependencies: * [Markdown 2.0+](http://www.freewisdom.org/projects/python-markdown/) """ import markdown from markdown import etree import re class TocTreeprocessor(markdown.treeprocessors.Treeprocessor): # Iter...
12,140
get private endpoint connection 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...
12,141
query parameters
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
12,142
terminate
# Copyright 2022 Least Authority TFA GmbH # See COPYING for details. import re import sys from subprocess import ( Popen, PIPE, ) from twisted.logger import ( Logger, ) from twisted.python.filepath import ( FilePath, ) from testtools.matchers import ( Always, Equals, Contains, Contains...
12,143
read subset faces
""" defines: - model = FaceFile(log=None, debug=False) """ from copy import deepcopy import numpy as np from cpylog import get_logger2 class FaceFile: def __init__(self, log=None, debug=False): self.log = get_logger2(log, debug=debug) def read_face_file(self, face_filename, ifaces_to_read=None): ...
12,144
test loop look alike
import math import pytest from jinja2.exceptions import UndefinedError from jinja2.nativetypes import NativeEnvironment from jinja2.nativetypes import NativeTemplate from jinja2.runtime import Undefined @pytest.fixture def env(): return NativeEnvironment() def test_is_defined_native_return(env): t = env.f...
12,145
get archive directory
import os import time import logging import Session from mxcubecore import HardwareRepository as HWR class SOLEILSession(Session.Session): def __init__(self, *args, **kwargs): Session.Session.__init__(self, *args, **kwargs) self.username = "" self.gid = "" self.uid = "" se...
12,146
test continuous medication required
import pytest from assessclaimdc6510.src.lib import medication @pytest.mark.parametrize( "request_body, continuous_medication_required_calculation", [ # Service connected and medication used to treat hypertension ( { "evidence": { "medications": ...
12,147
fills
import numpy as np import pandas as pd from syscore.constants import arg_not_supplied from systems.accounts.pandl_calculators.pandl_calculation import ( pandlCalculation, apply_weighting, ) from sysobjects.METHOD_NAME import ListOfFills, Fill class pandlCalculationWithFills(pandlCalculation): def __init...
12,148
execute shifts
# Authors: William Mill (bill@billmill.org) # License: BSD 3 clause import numpy as np class DrawTree: def __init__(self, tree, parent=None, depth=0, number=1): self.x = -1.0 self.y = depth self.tree = tree self.children = [ DrawTree(c, self, depth + 1, i + 1) for i, c...
12,149
export annotation to local files
"""This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license. """ import json import logging import os import re from pathlib import Path from urllib.parse import quote from django.conf import settings from djang...
12,150
test publisher close not open
# Copyright 2017 Workiva # 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 #...
12,151
get random hex
import base64 import binascii import hashlib import itertools import random import re import string import uuid import zlib from typing import Dict, List, Union from localstack.config import DEFAULT_ENCODING _unprintables = ( range(0x00, 0x09), range(0x0A, 0x0A), range(0x0B, 0x0D), range(0x0E, 0x20), ...
12,152
top
import ast import time from nubia import command from suzieq.cli.nubia_patch import argument from suzieq.cli.sqcmds.command import SqCommand from suzieq.sqobjects.network import NetworkObj @command("network", help="Act on network-wide data") class NetworkCmd(SqCommand): """Advanced commands across all the networ...
12,153
calc zn rad
from ctypes import c_int, c_double, POINTER, c_uint64 from random import getrandbits import numpy as np from numpy.ctypeslib import ndpointer from . import _dll _dll.t_percentile.restype = c_double _dll.t_percentile.argtypes = [c_double, c_int] _dll.calc_pn_c.restype = None _dll.calc_pn_c.argtypes = [c_int, c_doub...
12,154
build
#!/usr/bin/env python # # Copyright 2009-2023 NTESS. Under the terms # of Contract DE-NA0003525 with NTESS, the U.S. # Government retains certain rights in this software. # # Copyright (c) 2009-2023, NTESS # All rights reserved. # # Portions are copyright of other developers: # See the file CONTRIBUTORS.TXT in the top ...
12,155
build realm root certif
# Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS from __future__ import annotations from typing import Any from parsec._parsec_pyi.crypto import ( PublicKey, SequesterPublicKeyDer, SequesterVerifyKeyDer, SigningKey, VerifyKey, ) from parsec._parsec_pyi.enumerat...
12,156
make config vect
# -*- coding: utf-8 -*- # Copyright (C) 2011-2012 Quang-Cuong Pham <cuong.pham@normalesup.org> # # 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....
12,157
header parameters
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
12,158
anonymize cfr arr
from collections import defaultdict import numpy as np from faker import Faker class DataAnonymizer(object): __faker = Faker("FR") def __init__(self, data_type: str = "cfr"): self.__cfr_dict = defaultdict(self.make_fake_cfr) self.__external_immatriculation_dict = defaultdict( se...
12,159
set up
""" Tests calling the grades api directly """ from unittest.mock import patch import ddt from common.djangoapps.student.tests.factories import UserFactory from lms.djangoapps.grades import api from lms.djangoapps.grades.models import PersistentSubsectionGrade, PersistentSubsectionGradeOverride from xmodule.modulest...
12,160
is iron python
import os import platform import re import sys REPO_ROOT = os.path.normpath( os.path.join( os.path.abspath(os.path.dirname(__file__)), "..", "..", "..", ".." ) ) system_name = None def overridePlatform(platform): global system_name system_name = platform def METHOD_NAME(): return sys.pl...
12,161
plot bm bars
import sys import os import re thisdir = os.path.dirname(os.path.abspath(__file__)) moddir = os.path.abspath(f"{thisdir}/../ext/c4core/cmake/bm-xp") sys.path.insert(0, moddir) import bm_plot as bm from bm_util import first from dataclasses import dataclass import prettytable def get_function_benchmark(libname, run:...
12,162
test newsletter send test email
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # MIT License. See LICENSE from random import choice from unittest.mock import MagicMock, PropertyMock, patch import frappe from frappe.email.doctype.newsletter.exceptions import ( NewsletterAlreadySentError, NoRecipientFoundError, ) from frappe.e...
12,163
translated
import parler from django import forms from django.conf import settings from django.core.exceptions import ValidationError from django.utils.translation import gettext_lazy as _ from euth.organisations.models import Organisation class OrganisationForm(forms.ModelForm): translated_fields = [ ('descriptio...
12,164
test user email attr
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022) # # 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 appl...
12,165
load tag
# Copyright (c) Princeton University. # This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory of this source tree. # Authors: Yihan Wang import os import bpy import json import numpy as np import util.blender as butil from nodes.node_wrangler import Nodes, NodeWr...
12,166
on team join
# Released under the MIT License. See LICENSE for details. # """DeathMatch game and support classes.""" # ba_meta require api 8 # (see https://ballistica.net/wiki/meta-tag-system) from __future__ import annotations from typing import TYPE_CHECKING from bascenev1lib.actor.playerspaz import PlayerSpaz from bascenev1l...
12,167
get managed environments storage 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 . imp...
12,168
progress
# Copyright (c) 2015 SUSE Linux GmbH. All rights reserved. # # This file is part of kiwi. # # kiwi 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 la...
12,169
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. """ A modified version of the legacy DistributedDataParallel module that uses c10d communication primitives. This version is simpler than the ...
12,170
filter
# ~*~ coding: utf-8 ~*~ import datetime from django.db import transaction from django.utils import timezone from django.db.utils import OperationalError from common.utils.common import pretty_string from .base import CommandBase class CommandStore(CommandBase): def __init__(self, params): from terminal...
12,171
build nexus
"""Nexus setup. To build the nexus wheel only for a specific platform, run: python -m build -w -n ./nexus --config-setting=--build-option=--nexus-build=darwin-arm64,linux-amd64 To build the nexus wheel for all platforms, run: python -m build -w -n ./nexus To install the nexus wheel, run: pip install --force-reinstal...
12,172
output markdown
""" Page scraping (to be used later to fixup internal cross references off anchor IDs). - First back up without edits here: b5e26e9b81b58ffe9a2dc9b39c76c1ed06cc8d20 .. code-block:: console $ curl 'https://github.com/intel/dffml/discussions/1369/comments/2603280/threads?back_page=1&forward_page=0&anchor_id=281354...
12,173
test deserialize ors policies
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import pyt...
12,174
resume
# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function from stripe import util from stripe.api_resources.abstract import CreateableAPIResource from stripe.api_resources.abstract import DeletableAPIResource from stripe.api_resources.abstract impor...
12,175
gen icons
import requests def get_waste_types(hpid, realmid): r = requests.get( f"http://slim.cmcitymedia.de/v1/{hpid}/waste/{realmid}/types") r.raise_for_status() r = r.json() items = r["result"][1]["items"] return items def get_waste_districts(hpid, realmid): r = requests.get( f"http://slim.cmcity...
12,176
error format
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
12,177
test init stores handler
from unittest import mock import kombu import pytest from h_matchers import Any from kombu.exceptions import LimitExceeded, OperationalError from h import realtime from h.exceptions import RealtimeMessageQueueError from h.tasks import RETRY_POLICY_QUICK, RETRY_POLICY_VERY_QUICK class TestConsumer: def test_init...
12,178
hover leave event
# -*- coding: utf-8 -*- # # Copyright (C) 2014 GNS3 Technologies Inc. # # 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. ...
12,179
file exists
import uuid from datetime import datetime, timedelta import botocore import pytz from boto3 import client, resource from flask import current_app from notifications_utils.s3 import s3upload as utils_s3upload FILE_LOCATION_STRUCTURE = "service-{}-notify/{}.csv" def get_s3_file(bucket_name, file_location): s3_fil...
12,180
rebase
class Region: """ A region of memory that is mapped in the object's file. :ivar offset: The offset into the file the region starts. :ivar vaddr: The virtual address. :ivar filesize: The size of the region in the file. :ivar memsize: The size of the region when loaded into ...
12,181
init sanity
import logging import pytest from ocs_ci.framework.testlib import ( tier4a, ManageTest, aws_based_platform_required, ipi_deployment_required, ignore_leftovers, ) from ocs_ci.ocs import machine, constants, ocp from ocs_ci.helpers.helpers import verify_storagecluster_nodetopology from ocs_ci.ocs.reso...
12,182
set up
"""seahub/api2/views.py::Repo api tests. """ import json import pytest from seaserv import seafile_api, ccnet_api from django.urls import reverse from seahub.test_utils import BaseTestCase from tests.common.utils import randstring from seahub.group.utils import is_group_admin try: from seahub.settings import LOC...
12,183
main
#!/usr/bin/env python3 # Copyright © 2012-2023 Forschungszentrum Jülich GmbH # SPDX-License-Identifier: LGPL-3.0-or-later import argparse import logging import os import pathlib import shutil import tarfile import docker logging.basicConfig( level=logging.DEBUG, format="%(asctime)s - %(levelname)s - %(messag...
12,184
getoutput
"""Common utilities for the various process_* implementations. This file is only meant to be imported by the platform-specific implementations of subprocess utilities, and it contains tools that are common to all of them. """ #----------------------------------------------------------------------------- # Copyright ...
12,185
test measurement spec
# Copyright 2020 The Cirq 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
12,186
check thp
#!/usr/bin/env python # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that ...
12,187
do
# Copyright 2023 Iguazio # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
12,188
time unary predicate
import random import numpy as np from geopandas import GeoSeries from shapely.geometry import Point, Polygon, MultiPolygon def with_attributes(**attrs): def decorator(func): for key, value in attrs.items(): setattr(func, key, value) return func return decorator class Bench: ...
12,189
mult
from __future__ import unicode_literals from builtins import object from builtins import zip from builtins import range __docformat__ = 'restructuredtext' __all__ = [] import itertools from fipy.tools.dimensions.physicalField import PhysicalField from fipy.tools import numerix from functools import reduce class _Ab...
12,190
calculate c and iterations
import logging from abc import ABC, abstractmethod from typing import Union import numpy as np from beartype import beartype from UQpy.utilities.ValidationTypes import PositiveInteger, PositiveFloat class POD(ABC): @beartype def __init__(self, solution_snapshots: Union[np.ndarray, list] = N...
12,191
filter accepts row
# -*- coding: utf-8 -*- import utool from wbia.guitool.__PYQT__ import QtCore, QtGui # NOQA from wbia.guitool.__PYQT__.QtCore import Qt utool.noinject(__name__, '[APIItemView]', DEBUG=False) # BASE_CLASS = QtGui.QAbstractProxyModel try: BASE_CLASS = QtGui.QSortFilterProxyModel except Exception: BASE_CLASS =...
12,192
gen mirror bank
import networkx as nx import networkx.algorithms.isomorphism from sgi import * def test_monomorphic_but_not_isomorphic(): g = nx.Graph() g.add_nodes_from( [0, 1, 2]) g.add_edges_from( [(0,1), (0,2), (1,2)]) h = nx.Graph() h.add_nodes_from( [0, 1, 2]) h.add_edges_from( [(0,1), (0,2)]) m = ...
12,193
test json formatter severity
import json import logging from unittest import mock import olympia.core.logger from olympia.amo.tests import TestCase from olympia.users.models import UserProfile class LoggerTests(TestCase): def make_fake_record(self, msg='Some fake message', level=logging.NOTSET): return logging.LogRecord( ...
12,194
test accesskey already in text
# # Copyright 2008 Zuza Software Foundation # # This file is part of The Translate Toolkit. # # 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 optio...
12,195
test accessor grid source file not exist
""" Test the behaviour of the GMTDataArrayAccessor class. """ import os import sys from pathlib import Path import pytest import xarray as xr from packaging.version import Version from pygmt import __gmt_version__, which from pygmt.datasets import load_earth_relief from pygmt.exceptions import GMTInvalidInput def te...
12,196
get operation
from PIL import Image, ImageEnhance, ImageOps import numpy as np import random class AutoaugmentImageNetPolicy(object): """ Randomly choose one of the best 24 Sub-policies on ImageNet. Reference: https://arxiv.org/abs/1805.09501 """ def __init__(self): self.policies = [ SubPoli...
12,197
test not equal canary mock array
# Data Parallel Control (dpctl) # # Copyright 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/LICE...
12,198
on byebye
import asyncio import sys from ipaddress import IPv4Address from aiohttp import ClientSession from async_upnp_client.advertisement import SsdpAdvertisementListener from async_upnp_client.aiohttp import AiohttpSessionRequester from async_upnp_client.client_factory import UpnpFactory from async_upnp_client.search import...
12,199
test output
import string from binascii import hexlify, unhexlify import pytest from hypothesis import assume, given from hypothesis import strategies as st from passlib.context import CryptContext from h.security.encryption import derive_key, password_context, token_urlsafe REASONABLE_INFO = st.text(alphabet=string.printable) ...