id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
14,900
test text width min height
import cairo import pytest from gaphas.geometry import Rectangle from gaphor.core.modeling.diagram import FALLBACK_STYLE from gaphor.core.styling import JustifyContent from gaphor.diagram.shapes import ( Box, DrawContext, IconBox, Text, TextAlign, VerticalAlign, Orientation, ) @pytest.fix...
14,901
secondary connection string
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities __all__ ...
14,902
input np
# 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...
14,903
run
#!/usr/bin/env python3 '''\ Helper script for the Sphinx documentation ''' import sys import os import venv import webbrowser from subprocess import check_call from shutil import rmtree from argparse import ArgumentParser from pathlib import Path docs_path = Path(__file__).parent abs_docs_path = docs_path.resolve() ...
14,904
trace
""" Declaration of `circuit` and `compiler` decorators. """ import inspect from typing import Any, Callable, Dict, Iterable, Mapping, Optional, Tuple, Union from ..representation import Graph from ..tracing.typing import ScalarAnnotation from ..values import ValueDescription from .artifacts import DebugArtifacts from...
14,905
privilege granted directly or via role
from rbac.requirements import * from rbac.helper.common import * import rbac.helper.errors as errors @TestSuite def METHOD_NAME(self, node=None): """Check that user is only able to execute CREATE DATABASE when they have required privilege, either directly or via role. """ role_name = f"role_{getuid()}" ...
14,906
compute xml data
from odoo import _, api, fields, models from odoo.tools import format_date SELF_INVOICE_TYPES = ("TD16", "TD17", "TD18", "TD19", "TD20", "TD21", "TD27", "TD28") class FatturaPAAttachmentIn(models.Model): _inherit = "fatturapa.attachment" _name = "fatturapa.attachment.in" _description = "Electronic Invoic...
14,907
run tasks
#!/usr/bin/env python3 import asyncio import aioredis import async_timeout import sys import argparse ''' To install: pip install -r requirements.txt Run dragonfly --mem_defrag_threshold=0.01 --commit_use_threshold=1.2 --mem_utilization_threshold=0.8 defrag_mem_test.py -k 800000 -v 645 This program would try to re-cr...
14,908
write routine end code
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2022 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). from __future__ import absolute_import, print_function from builtins import super # provi...
14,909
verify user pin
import utime from typing import Any, NoReturn import storage.cache as storage_cache from trezor import config, utils, wire from trezor.ui.layouts import show_error_and_raise async def _request_sd_salt( raise_cancelled_on_unavailable: bool = False, ) -> bytearray | None: """Helper to get SD salt in a general ...
14,910
on user groups change
# -*- coding: utf-8 -*- # from django.db.models.signals import m2m_changed, pre_delete, pre_save, post_save from django.dispatch import receiver from users.models import User, UserGroup from assets.models import Asset from common.utils import get_logger, get_object_or_none from common.exceptions import M2MReverseNotAl...
14,911
notify delayed report callback
from django.utils import timezone from django.db import transaction from squad.celery import app as celery from squad.core.models import ProjectStatus, Build, DelayedReport from squad.core.notification import send_status_notification import requests @celery.task def maybe_notify_project_status(status_id): """ ...
14,912
wr
import operator import pytest from pint import UnitRegistry # Conditionally import NumPy and any upcast type libraries np = pytest.importorskip("numpy", reason="NumPy is not available") sparse = pytest.importorskip("sparse", reason="sparse is not available") da = pytest.importorskip("dask.array", reason="Dask is not ...
14,913
validate order status
import graphene from django.core.exceptions import ValidationError from ....checkout.fetch import fetch_checkout_info, fetch_checkout_lines from ....checkout.models import Checkout from ....checkout.utils import invalidate_checkout_prices from ....graphql.core.mutations import BaseMutation from ....order import ORDER_...
14,914
test format hash
########################################################################## # # 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 ...
14,915
test no default namespace
import os import pytest from compas.files import XML BASE_FOLDER = os.path.dirname(__file__) @pytest.fixture def basic_xml(): return '<Tests><Test id="1"></Test></Tests>' @pytest.fixture def basic_file(): return os.path.join(BASE_FOLDER, "fixtures", "xml", "basic.xml") @pytest.fixture def basic_file_url...
14,916
monomer
""" A wrapper class, ``Builder``, that facilitates the programmatic construction of PySB models while adding a few features useful for model calibration. The pattern for model construction using this class does not rely on the SelfExporter class of PySB. Instead, the ``Builder`` class contains an instance of a PySB mo...
14,917
get formatted name
# coding=utf-8 """Csv download model definition. """ from datetime import datetime from django.db import models from django.conf import settings from django.core.exceptions import ValidationError from bims.tasks.email_csv import send_csv_via_email from bims.download.csv_download import ( send_rejection_csv, se...
14,918
test keras progbar
"""redirect tests.""" import os import re import sys import time import numpy as np import pytest import tqdm import wandb impls = [wandb.wandb_sdk.lib.redirect.StreamWrapper] if os.name != "nt": impls.append(wandb.wandb_sdk.lib.redirect.Redirect) class CapList(list): def append(self, x): if not x:...
14,919
do accumulate
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved from dataclasses import dataclass from typing import Any, Optional import torch from detectron2.structures import BoxMode, Instances from .utils import AnnotationsAccumulator @dataclass class PackedCseAnnotations: x_gt: torch.Tensor y_g...
14,920
fix up
# coding=utf-8 # # Copyright 2011-2015 Splunk, 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...
14,921
decrypt hash
# This file is Copyright 2020 Volatility Foundation and licensed under the Volatility Software License 1.0 # which is available at https://www.volatilityfoundation.org/license/vsl-v1.0 # import logging from struct import unpack from typing import Tuple from Crypto.Cipher import ARC4, AES from Crypto.Hash import HMAC ...
14,922
patched fit
import paddle import mlflow from mlflow.utils.autologging_utils import ( BatchMetricsLogger, ExceptionSafeAbstractClass, MlflowAutologgingQueueingClient, get_autologging_config, ) class __MLflowPaddleCallback(paddle.callbacks.Callback, metaclass=ExceptionSafeAbstractClass): """ Callback for a...
14,923
entities builder
# python3 # ============================================================================== # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.or...
14,924
get device capacity info
# 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...
14,925
describe entity recognizer
"""Handles incoming comprehend requests, invokes methods, returns responses.""" import json from moto.core.responses import BaseResponse from .models import comprehend_backends, ComprehendBackend class ComprehendResponse(BaseResponse): """Handler for Comprehend requests and responses.""" def __init__(self) ...
14,926
default button click
# NanoVNASaver # # A python program to view and export Touchstone data from a NanoVNA # Copyright (C) 2019, 2020 Rune B. Broberg # Copyright (C) 2020,2021 NanoVNA-Saver Authors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
14,927
test apply changelog batch key is none
from unittest.mock import Mock, patch import pytest from faust.tables.objects import ChangeloggedObjectManager from faust.types import TP from tests.helpers import AsyncMock TP1 = TP("foo", 3) @pytest.fixture() def key(): return Mock(name="key") @pytest.fixture() def table(): return Mock( name="t...
14,928
put
from p4p.client.thread import Context from p4p.nt import NTEnum, NTNDArray, NTScalar, NTTable from p4p.server import Server, ServerOperation from p4p.server.thread import SharedPV import numpy as np import random import threading class Handler(object): """ A handler for dealing with put requests to our test PVs "...
14,929
source subfolder
from conans import ConanFile, tools, CMake from conan.tools.microsoft import msvc_runtime_flag from conans.errors import ConanInvalidConfiguration import os class Opene57Conan(ConanFile): name = "opene57" description = "A C++ library for reading and writing E57 files, " \ "fork of the origina...
14,930
test remove lock
import datetime from unittest import mock from olympia.amo.tests import TestCase, addon_factory, version_factory from olympia.git.models import GitExtractionEntry from olympia.git.tasks import ( continue_git_extraction, extract_versions_to_git, on_extraction_error, remove_git_extraction_entry, ) from o...
14,931
on cr random track4 changed
# Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. # # SkyTemple 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 y...
14,932
test synonym alternate case
from rasa.nlu.extractors.entity_synonyms import EntitySynonymMapper from rasa.shared.nlu.constants import TEXT, ENTITIES from rasa.shared.nlu.training_data.training_data import TrainingData from rasa.shared.nlu.training_data.message import Message from rasa.engine.storage.storage import ModelStorage from rasa.engine.gr...
14,933
format page
import asyncio import datetime import random import typing import discord from discord.ext import menus from discord.ext.commands import MemberConverter from utils.models import DiscordChannel, get_from_db if typing.TYPE_CHECKING: from utils.bot_class import MyBot class EmbedCounterPaginator(menus.ListPageSour...
14,934
profile broadcast general
""" Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
14,935
new my widget
# # This file is part of KDDockWidgets. # # SPDX-FileCopyrightText: 2020-2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com> # Author: Renato Araujo Oliveira Filho <renato.araujo@kdab.com> # # SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only # # Contact KDAB at <info@kdab.com> for commercial li...
14,936
test interpolation function
# Copyright (C) 2011-2022 Garth N. Wells, Jørgen S. Dokken # # This file is part of DOLFINx (https://www.fenicsproject.org) # # SPDX-License-Identifier: LGPL-3.0-or-later """Unit tests for the Function class""" import importlib import cffi import numpy as np import pytest import ufl from basix.ufl import element, ...
14,937
execute operations
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
14,938
incremental timer
################################################################################ # # Copyright (C) 2019-2022 Advanced Micro Devices, Inc. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal ...
14,939
validate team id
from typing import Any, Mapping, MutableMapping, Optional from django.db import IntegrityError from django.http import Http404 from rest_framework import serializers from rest_framework.exceptions import PermissionDenied from rest_framework.request import Request from sentry import features from sentry.api.serializer...
14,940
generate image df
import torch import pandas as pd from tqdm import tqdm import torch.nn.functional as F import torch.nn as nn from autogluon.multimodal import MultiModalPredictor from datasets import list_datasets, load_dataset from setfit import sample_dataset from imagedatasets import build_dataset from torch.utils.data import Datase...
14,941
state
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
14,942
extract common fields
import json from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.middleware.csrf import get_token from django.template.loader import render_to_string from django.urls import reverse from django.utils.crypto import get_random_string from django.utils.html import escapejs, ...
14,943
fail
from collections import OrderedDict from decimal import Decimal from sqlalchemy.sql import func from isoweek import Week from baseframe import __ from coaster.utils import LabeledEnum, isoweek_datetime from ..extapi.razorpay_status import RAZORPAY_PAYMENT_STATUS from . import BaseMixin, MarkdownColumn, db from .ite...
14,944
test importmap
import logging import unittest from io import StringIO from typing import Optional from jsonasobj2 import as_json from linkml.utils.schemaloader import SchemaLoader from tests.test_utils.environment import env from tests.utils.filters import json_metadata_filter from tests.utils.test_environment import TestEnvironmen...
14,945
migration progress callback
import time from django.core.management import call_command from django.core.management.base import BaseCommand, CommandError from django.db import DEFAULT_DB_ALIAS, connections from django.db.migrations.executor import MigrationExecutor from django.db.migrations.loader import AmbiguityError from django.db.migrations....
14,946
get inner footer xml
from auslib.AUS import isForbiddenUrl from auslib.blobs.base import XMLBlob from auslib.errors import BadDataError class SystemAddonsBlob(XMLBlob): jsonschema = "systemaddons.yml" def __init__(self, **kwargs): XMLBlob.__init__(self, **kwargs) if "schema_version" not in self: self[...
14,947
handle block
# pylint:disable=unused-argument,arguments-differ from collections import defaultdict from typing import Dict, List import ailment from ..sequence_walker import SequenceWalker from ..structuring.structurer_nodes import ( SequenceNode, CodeNode, MultiNode, LoopNode, ConditionNode, ContinueNode,...
14,948
test insert
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...
14,949
resource
# 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...
14,950
list examples
#!/usr/bin/env python # -*- coding: utf-8 -*- """Utility functions for dealing with files""" from __future__ import annotations from typing import List, Optional, Union, Any, Set import os import glob import json from pathlib import Path from pkg_resources import resource_filename import pooch from .exceptions impor...
14,951
user identifier
from http import HTTPStatus from secrets import token_hex from typing import Generator, NamedTuple, Optional from uuid import UUID from fastapi import Depends, Request, Response, Security from fastapi.security import HTTPAuthorizationCredentials, HTTPBearer from fastapi.security.api_key import APIKey, APIKeyHeader, AP...
14,952
build unit
################################################################################# # The Institute for the Design of Advanced Energy Systems Integrated Platform # Framework (IDAES IP) was produced under the DOE Institute for the # Design of Advanced Energy Systems (IDAES). # # Copyright (c) 2018-2023 by the software own...
14,953
test image int32 loading
# -*- coding: utf-8 -*- # Copyright 2007-2023 The HyperSpy developers # # This file is part of RosettaSciIO. # # RosettaSciIO 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...
14,954
reconstruct pickle
import io import pickle import unittest import backend as F import dgl import dgl.function as fn import networkx as nx import pytest import scipy.sparse as ssp from dgl.graph_index import create_graph_index from dgl.utils import toindex from utils import ( assert_is_identical, assert_is_identical_hetero, ...
14,955
launch pipeline execution
from typing import TYPE_CHECKING, cast import dagster._check as check from dagster._core.definitions.selector import JobSubsetSelector from dagster._core.execution.plan.resume_retry import ReexecutionStrategy from dagster._core.storage.dagster_run import DagsterRun, RunsFilter from dagster._core.workspace.permissions ...
14,956
get nosecs from contexts
# # Copyright 2014 Hewlett-Packard Development Company, L.P. # # SPDX-License-Identifier: Apache-2.0 import copy import logging import warnings from bandit.core import constants from bandit.core import context as b_context from bandit.core import utils warnings.formatwarning = utils.warnings_formatter LOG = logging.g...
14,957
get simple label
# Copyright 2023 Avaiga Private Limited # # 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 ...
14,958
proper fsync
import contextlib import io import os import sys import tempfile try: import fcntl except ImportError: fcntl = None # `fspath` was added in Python 3.6 try: from os import fspath except ImportError: fspath = None __version__ = '1.4.1' PY2 = sys.version_info[0] == 2 text_type = unicode if PY2 else s...
14,959
extract descr
#!/usr/bin/env python3 # generate_complist() # Compares the entries in the component list (components.adoc) with the # available man pages and adds tables for missing components. # generate_links() # Generates a copy of components.adoc with added links to the man pages for the components. import os i...
14,960
test get regression function
"""Chemprop unit tests for chemprop/train/loss_functions.py""" from types import SimpleNamespace import numpy as np import torch import pytest from chemprop.train.loss_functions import ( bounded_mse_loss, dirichlet_class_loss, evidential_loss, get_loss_func, mcc_multiclass_loss, normal_mve, ) ...
14,961
test enable disable nvml
from __future__ import annotations import multiprocessing as mp import os import pytest pytestmark = pytest.mark.gpu pynvml = pytest.importorskip("pynvml") import dask from distributed.diagnostics import nvml from distributed.utils_test import gen_cluster @pytest.fixture(autouse=True) def reset_nvml_state(): ...
14,962
apply
import astropy.units as u from sunpy.coordinates.utils import get_rectangle_coordinates from sunpy.net._attrs import Time, Wavelength from sunpy.net.attr import AttrAnd, AttrComparison, AttrOr, AttrWalker, DataAttr, SimpleAttr __all__ = ['Series', 'Protocol', 'Notify', 'Segment', 'PrimeKey', 'Cutout', "Keyword"] # ...
14,963
test achat basic
from typing import Any, List, Sequence import pytest from llama_index.bridge.pydantic import PrivateAttr from llama_index.agent.react.base import ReActAgent from llama_index.chat_engine.types import AgentChatResponse, StreamingAgentChatResponse from llama_index.llms.base import ( ChatMessage, ChatResponse, ...
14,964
write files
from __future__ import annotations import csv import hashlib import os.path import re import stat import time from collections import OrderedDict from io import StringIO, TextIOWrapper from zipfile import ZIP_DEFLATED, ZipFile, ZipInfo from wheel.cli import WheelError from wheel.util import log, urlsafe_b64decode, ur...
14,965
export
""" Part of the implementation is borrowed and modified from EfficientNetV2 publicly available at <https://arxiv.org/abs/2104.00298> """ import torch import torch.nn.functional class SiLU(torch.nn.Module): """ [https://arxiv.org/pdf/1710.05941.pdf] """ def __init__(self, inplace: bool = False): ...
14,966
score style
# (C) Copyright 2005-2023 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only under # the conditions described in the aforementioned license. The license # is also available online at...
14,967
retrieve properties mock
# (C) Datadog, Inc. 2010-present # All rights reserved # Licensed under Simplified BSD License (see LICENSE) import json import os from datetime import datetime from mock import MagicMock, Mock from pyVmomi import vim from six import iteritems HERE = os.path.abspath(os.path.dirname(__file__)) class MockedMOR(Mock):...
14,968
extracted license
import os from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps, cmake_layout from conan.tools.microsoft import is_msvc from conan.tools.files import get, load, save, rmdir, rm from conan.tools.build import check_min_cppstd requi...
14,969
test spspmm duplicate
import warnings import backend as F import pytest import torch from dgl.sparse import bspmm, diag, from_coo, val_like from dgl.sparse.matmul import matmul from .utils import ( clone_detach_and_grad, dense_mask, rand_coo, rand_csc, rand_csr, rand_stride, sparse_matrix_to_dense, sparse_...
14,970
configure
from __future__ import annotations from seedemu.core import AutonomousSystem, InternetExchange, AddressAssignmentConstraint, Node, Graphable, Emulator, Layer from typing import Dict, List BaseFileTemplates: Dict[str, str] = {} BaseFileTemplates["interface_setup_script"] = """\ #!/bin/bash cidr_to_net() { ipcalc -...
14,971
spam buttons command
from openpilot.common.conversions import Conversions as CV from openpilot.selfdrive.car.honda.values import HondaFlags, HONDA_BOSCH, HONDA_BOSCH_RADARLESS, CAR, CarControllerParams # CAN bus layout with relay # 0 = ACC-CAN - radar side # 1 = F-CAN B - powertrain # 2 = ACC-CAN - camera side # 3 = F-CAN A - OBDII port ...
14,972
add user group
""" Usage:: hammer user-group [OPTIONS] SUBCOMMAND [ARG] ... Parameters:: SUBCOMMAND subcommand [ARG] ... subcommand arguments Subcommands:: add-role Assign a user role add-user Associate an user add-user-group ...
14,973
test by statement
from openlibrary.catalog.marc.get_subjects import subjects_for_work from openlibrary.catalog.marc.marc_base import MarcBase from openlibrary.catalog.marc.parse import read_isbn, read_pagination, read_title class MockField: def __init__(self, subfields): self.subfield_sequence = subfields self.cont...
14,974
user
import pytest class TestPutHide: def test_it_returns_http_204_for_group_creator( self, app, group_annotation, user_with_token ): _, token = user_with_token headers = {"Authorization": str(f"Bearer {token.value}")} res = app.put(f"/api/annotations/{group_annotation.id}/hide", h...
14,975
close
import abc import builtins import codecs import sys from _typeshed import FileDescriptorOrPath, ReadableBuffer, WriteableBuffer from collections.abc import Callable, Iterable, Iterator from os import _Opener from types import TracebackType from typing import IO, Any, BinaryIO, TextIO from typing_extensions import Liter...
14,976
client
import json import typing as t import uuid import pytest import responses from globus_compute_sdk.sdk.web_client import WebClient from globus_compute_sdk.version import __version__ @pytest.fixture(autouse=True) def mocked_responses(): """ All tests enable `responses` patching of the `requests` package, repla...
14,977
calculate runtimes
""" Salt returner to return highstate stats to Librato To enable this returner the minion will need the Librato client importable on the Python path and the following values configured in the minion or master config. The Librato python client can be found at: https://github.com/librato/python-librato .. code-block::...
14,978
test tensor struct info
# 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...
14,979
import mod
import importlib import inspect def calc_totals(base_mod, ref_mods, cls): base_obj, _ = METHOD_NAME(base_mod, cls) base_funcs = get_functions(base_obj) totals = [len(base_funcs)] for ref_mod in ref_mods: ref_obj, _ = METHOD_NAME(ref_mod, cls) ref_funcs = get_functions(ref_obj) ...
14,980
value
# 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...
14,981
test nested gs credentials
"""Tests of fiona.env""" import os import sys from unittest import mock import boto3 import pytest import fiona from fiona import _env from fiona.env import getenv, hasenv, ensure_env, ensure_env_with_credentials from fiona.errors import FionaDeprecationWarning from fiona.session import AWSSession, GSSession def t...
14,982
get symblic shape var
# 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...
14,983
main
# # Copyright 2023 Splunk 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...
14,984
test get all client users from organization
# -*- coding: utf-8 -*- # Copyright (c) 2021, Florian Dambrine <android.florian@gmail.com> # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # SPDX-License-Identifier: GPL-3.0-or-later from __future__ import absolute_import, division, print_function imp...
14,985
init reg convs
# Copyright (c) OpenMMLab. All rights reserved. import torch.nn as nn from mmcv.cnn import ConvModule, Scale from mmdet.models.utils import multi_apply from mmocr.models.textdet.heads.base import BaseTextDetHead from mmocr.registry import MODELS INF = 1e8 @MODELS.register_module() class ABCNetDetHead(BaseTextDetHea...
14,986
tplaybook
from collections.abc import Iterable from dataclasses import dataclass from typing import Any import pytest from . import tutils from mitmproxy.proxy import commands from mitmproxy.proxy import events from mitmproxy.proxy import layer class TEvent(events.Event): commands: Iterable[Any] def __init__(self, c...
14,987
update all
# encoding: utf-8 import datetime import csv from typing import NamedTuple, Optional import click import ckan.model as model import ckan.logic as logic from ckan.cli import error_shout class ViewCount(NamedTuple): id: str name: str count: int @click.group(name=u'tracking', short_help=u'Update tracki...
14,988
retrieve all party names and ids
# party/models.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- from django.db import models import wevote_functions.admin from wevote_settings.models import fetch_next_we_vote_id_party_integer, fetch_site_unique_id_prefix from exception.models import handle_record_not_found_exception logger = wevote_...
14,989
test add site again force
"""Test file for Sync Server, tests site operations add_site, remove_site. File: creates temporary directory and downloads .zip file from GDrive unzips .zip file uses content of .zip file (MongoDB's dumps) to import to new databases with use of 'monkeypatch_session' modifies require...
14,990
test circle
# Copyright Cartopy Contributors # # This file is part of Cartopy and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. import numpy as np from numpy.testing import assert_almost_equal, assert_array_almost_equal import pytest import shapely...
14,991
pwr attr set
#!/usr/bin/env python3 # # Copyright (c) 2018-2021 NVIDIA CORPORATION & AFFILIATES. # Apache-2.0 # # 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...
14,992
break check
from jedi.parser_utils import get_flow_branch_keyword, is_scope, get_parent_scope from jedi.evaluate.recursion import execution_allowed class Status(object): lookup_table = {} def __init__(self, value, name): self._value = value self._name = name Status.lookup_table[value] = self ...
14,993
match
from __future__ import (absolute_import, division, print_function) __metaclass__ = type try: from __main__ import display except ImportError: from ansible.utils.display import Display display = Display() import json import re import os import os.path import string import ansible class SafeDict(dict): ...
14,994
local ultra fast sigmoid
""" These functions implement special cases of exp and log to improve numerical stability. """ import aesara from aesara import printing from aesara import scalar as aes from aesara.graph.rewriting.basic import copy_stack_trace, node_rewriter from aesara.printing import pprint from aesara.scalar import sigmoid as sca...
14,995
unwrap
# ctrlutil.py - control system utility functions # # Author: Richard M. Murray # Date: 24 May 09 # # These are some basic utility functions that are used in the control # systems library and that didn't naturally fit anyplace else. # # Copyright (c) 2009 by California Institute of Technology # All rights reserved. # # ...
14,996
test ref str
import unittest from bsb import config from bsb.exceptions import * from bsb.unittest import get_data_path def get_content(f): with open(get_data_path("parser_tests", f), "r") as fh: return fh.read() class TestJsonBasics(unittest.TestCase): def test_get_parser(self): config.get_parser("json...
14,997
from dict
# SPDX-License-Identifier: Apache-2.0 # # The OpenSearch Contributors require contributions made to # this file be licensed under the Apache-2.0 license or a # compatible open source license. # # Modifications Copyright OpenSearch Contributors. See # GitHub history for details. # # Licensed to Elasticsearch B.V. under...
14,998
parse
"""This module contains a parser for the subset of the SNOMED CT Expression Constraint Language that describes codelists. It can handle expressions of the form: concept_ref concept_ref OR concept_ref [OR ...] (concept_ref [OR ...]) MINUS (concept_ref [OR ...]) where concept_ref of the form: operato...
14,999
get start and end date
from dataclasses import dataclass import pandas as pd import datetime from syscore.pandas.list_of_df import listOfDataFrames @dataclass class fitDates(object): fit_start: datetime.datetime fit_end: datetime.datetime period_start: datetime.datetime period_end: datetime.datetime no_data: bool = Fal...