id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
14,300
init output
from typing import Callable, List, Optional, Tuple import torch from torch import Tensor from torch_geometric.nn.aggr import Aggregation from torch_geometric.nn.inits import reset from torch_geometric.utils import scatter class ResNetPotential(torch.nn.Module): def __init__(self, in_channels: int, out_channels:...
14,301
stub create grant
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 """ Stub functions that are used by the AWS Key Management Service (AWS KMS) unit tests. """ from botocore.stub import ANY from test_tools.example_stubber import ExampleStubber class KmsStubber(ExampleStubber)...
14,302
test remove active session
# TODO(mc, 2022-07-07): these tests are very coupled to the implementation # both the tests and the code under test likely needs to be rewritten # if we want useful unit test coverage from mock import patch, AsyncMock # type: ignore[attr-defined] import pytest from robot_server.service.session.errors import SessionCr...
14,303
test empty iterable
"""Unit tests for the :mod:`networkx.algorithms.tournament` module.""" from itertools import combinations import pytest from networkx import DiGraph from networkx.algorithms.tournament import ( hamiltonian_path, index_satisfying, is_reachable, is_strongly_connected, is_tournament, random_tourn...
14,304
check inline
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file from waflib import Task from waflib.Configure import conf from waflib.TaskGen import feature, before_method, after_method LIB_CODE = ''' #ifdef _MSC_VER #define testEXPORT __declspec(dllexport) #els...
14,305
perspective thread
# ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ # ┃ ██████ ██████ ██████ █ █ █ █ █ █▄ ▀███ █ ┃ # ┃ ▄▄▄▄▄█ █▄▄▄▄▄ ▄▄▄▄▄█ ▀▀▀▀▀█▀▀▀▀▀ █ ▀▀▀▀▀█ ████████▌▐███ ███▄ ▀█ █ ▀▀▀▀▀ ┃ # ┃ █▀▀▀▀▀ █▀▀▀▀▀ █▀██▀▀ ▄▄▄▄▄ █ ▄▄▄▄▄█ ▄▄▄▄▄█ ████████▌▐███ █████▄ █ ▄▄▄▄...
14,306
transform glyphs
# Authors: see git history # # Copyright (c) 2021 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. import json import sys from math import atan2, degrees from inkex import Boolean, Transform, errormsg from inkex.units import convert_unit from ..elements import Stroke from...
14,307
read elf param dict from net
from __future__ import annotations import logging from typing import Optional, Dict from singleton_decorator import singleton from .solana_tx import SolPubKey from .environment_utils import NeonCli from .config import Config LOG = logging.getLogger(__name__) @singleton class ElfParams: def __init__(self): ...
14,308
test sparse array type
from panda3d import core import pickle def METHOD_NAME(): assert core.SparseArray.get_class_type().name == "SparseArray" def test_sparse_array_set_bit_to(): """Tests SparseArray behavior for set_bit_to().""" s = core.SparseArray() s.set_bit_to(5, True) assert s.get_bit(5) s = core.SparseAr...
14,309
wikipedia
# SPDX-License-Identifier: AGPL-3.0-or-later # lint: pylint """This module implements functions needed for the autocompleter. """ # pylint: disable=use-dict-literal import json from urllib.parse import urlencode import lxml from httpx import HTTPError from searx import settings from searx.engines import ( engin...
14,310
check manifest
""" Helper to request data from docker-registry NOTE: this could be used as draft for https://github.com/ITISFoundation/osparc-simcore/issues/2165 """ import json import os import re from dataclasses import dataclass from pathlib import Path from typing import Any, Iterator import httpx @dataclass class Registry...
14,311
load results
from __future__ import absolute_import, division, print_function from rstbx.viewer import dataset, results_base, indexing, integration from rstbx.viewer.frame import XrayFrame from wxtbx import process_control, icons import wxtbx.app from wxtbx.phil_controls import path import wx.lib.agw.flatnotebook import wx import ...
14,312
handle sequencenode
# pylint:disable=unused-argument,arguments-differ from typing import Set, Union import logging import ailment from ..sequence_walker import SequenceWalker from ..structuring.structurer_nodes import ( SequenceNode, CodeNode, MultiNode, LoopNode, ConditionNode, CascadingConditionNode, ) from .no...
14,313
get random transformation
# Copyright 2023 The KerasCV 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 ...
14,314
test settings do action raises
"""test_action_indexsettings""" # pylint: disable=missing-function-docstring, missing-class-docstring, protected-access, attribute-defined-outside-init from unittest import TestCase from mock import Mock from curator.actions import IndexSettings from curator.exceptions import ActionError, ConfigurationError, MissingArg...
14,315
get release zip path
import json import os import urllib.request import zipfile import pendulum import requests from dagster import DynamicPartitionsDefinition, Output, asset, get_dagster_logger from pandas import DataFrame releases_partitions_def = DynamicPartitionsDefinition(name="releases") @asset( partitions_def=releases_partit...
14,316
do startup
import gi gi.require_version("Gtk", "3.0") from gi.repository import Gio, GLib, Gtk import logging import signal from typing import Any, cast from blueman.Functions import * from blueman.bluez.Manager import Manager from blueman.bluez.Adapter import AnyAdapter from blueman.bluez.Device import AnyDevice import blueman...
14,317
legacy bulk add
# Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html """ Anki maintains a cache of used tags so it can quickly present a list of tags for autocomplete and in the browser. For efficiency, deletions are not tracked, so unused tags can only be remo...
14,318
decode map
""" The MIT License (MIT) Copyright (c) 2023 Arduino SA Copyright (c) 2018 KPN (Jan Bogaerts) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the...
14,319
get service 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...
14,320
test http exception
from typing import Type import pytest from hypothesis import given from hypothesis import strategies as st from starlette.exceptions import HTTPException as StarletteHTTPException from litestar import get from litestar.enums import MediaType from litestar.exceptions import ( HTTPException, ImproperlyConfigure...
14,321
hf private dataset repo txt data
import time from contextlib import contextmanager from pathlib import Path import pytest import requests from huggingface_hub.hf_api import HfApi, HfFolder CI_HUB_USER = "__DUMMY_TRANSFORMERS_USER__" CI_HUB_USER_FULL_NAME = "Dummy User" CI_HUB_USER_TOKEN = "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" CI_HUB_ENDPOINT = "...
14,322
unique id
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
14,323
enable
# Authors: Simo Sorce <ssorce@redhat.com> # Alexander Bokovoy <abokovoy@redhat.com> # Tomas Babej <tbabej@redhat.com> # # Copyright (C) 2007-2014 Red Hat # see file 'COPYING' for use and warranty information # # This program is free software; you can redistribute it and/or modify # it under the terms...
14,324
get example array
# 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...
14,325
polyval
import cupy def polyvander(x, deg): """Computes the Vandermonde matrix of given degree. Args: x (cupy.ndarray): array of points deg (int): degree of the resulting matrix. Returns: cupy.ndarray: The Vandermonde matrix .. seealso:: :func:`numpy.polynomial.polynomial.polyvander...
14,326
sub progress
import asyncio import logging from dataclasses import dataclass, field from typing import Optional, Protocol, runtime_checkable from servicelib.logging_utils import log_catch logger = logging.getLogger(__name__) @runtime_checkable class AsyncReportCB(Protocol): async def __call__(self, progress_value: float) ->...
14,327
collection date
import datetime from dateutil.relativedelta import relativedelta from care.facility.models import ( DISEASE_CHOICES_MAP, SYMPTOM_CHOICES, PatientConsultation, PatientContactDetails, PatientRegistration, PatientSample, ) class PatientIcmr(PatientRegistration): class Meta: proxy = ...
14,328
save unsharded optimizer
from typing import Callable, Iterator, List, Optional, Tuple, Union import torch.nn as nn from torch.nn.parallel import DistributedDataParallel as DDP from torch.optim import Optimizer from torch.optim.lr_scheduler import _LRScheduler as LRScheduler from torch.utils.data import DataLoader from colossalai.checkpoint_i...
14,329
get decompilation
from typing import TYPE_CHECKING, Dict, Optional, Set import networkx from angr.analyses.proximity_graph import ( BaseProxiNode, CallProxiNode, FunctionProxiNode, StringProxiNode, VariableProxiNode, ) from PySide6.QtCore import QSize from PySide6.QtWidgets import QHBoxLayout from angrmanagement.ui...
14,330
test nr df uhf
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
14,331
attempt step
"""ODE solver interface.""" from __future__ import annotations from abc import ABC, abstractmethod from collections import abc import dataclasses from typing import Iterable, Iterator, Optional, Union import numpy as np from probnum import problems from probnum.diffeq import callbacks as callback_module # see belo...
14,332
make budget dict
from __future__ import absolute_import from django.test import TestCase from ner_v1.detectors.numeral.budget.budget_detection import BudgetDetector class TestBudgetDetector(TestCase): def setUp(self): self.budget_detector = BudgetDetector(entity_name='budget') self.budget_detector.set_min_max_di...
14,333
test blockquote
# Original work Copyright 2012-2018 Matthew Tretter (MIT) # See ThirdPartyNotices.txt in the project root for license information. # All modifications Copyright (c) Robocorp Technologies Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file except in ...
14,334
etag
# 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,335
test plugin polymorphism
# # Copyright The NOMAD Authors. # # This file is part of NOMAD. See https://nomad-lab.eu for further info. # # 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/licen...
14,336
transform callback
#!/usr/bin/env python3 """ tidy-imports *.py tidy-imports < foo.py Automatically improves python import statements. - Adds missing imports and mandatory imports. - Removes unused imports. - Nicely formats imports (sorts, aligns, wraps). If filenames are given on the command line, rewrites them. Otherwise, if ...
14,337
validate
from datetime import timedelta from django.core.exceptions import ValidationError from django.db import connection from django.template.defaultfilters import floatformat from django.urls import reverse from django.utils.html import format_html from django.utils.safestring import mark_safe from django.utils.translation...
14,338
test read response headers
# 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 #...
14,339
test system exporter spreadsheet csv config template
import urllib.parse from django.contrib.auth.models import User from django.contrib.messages import get_messages from django.test import TestCase class SystemExporterSpreadsheetCsvConfigViewTestCase(TestCase): """system exporter spreadsheet CSV config view tests""" @classmethod def setUpTestData(cls): ...
14,340
test page bulk delete with file attribute
import graphene import pytest from .....attribute.models import AttributeValue from .....page.models import Page from ....attribute.utils import associate_attribute_values_to_instance from ....tests.utils import get_graphql_content PAGE_BULK_DELETE_MUTATION = """ mutation pageBulkDelete($ids: [ID!]!) { pa...
14,341
build elasticsearch query
from copy import deepcopy from elasticsearch_dsl import Q as ES_Q, A from rest_framework.response import Response from usaspending_api.awards.v2.lookups.lookups import loan_type_mapping from usaspending_api.common.cache_decorator import cache_response from usaspending_api.common.elasticsearch.aggregation_helpers impo...
14,342
train batch
""" Perform inference on pretrained CIFAR10 from https://github.com/huyvnphan/PyTorch_CIFAR10 """ import os import tempfile from typing import Any, Dict, Sequence, Tuple, Union, cast import numpy as np import resnet import torch import torchvision import torchvision.models as models from torch import nn from torchvis...
14,343
test save soft deleted
from olympia.abuse.models import AbuseReport from olympia.amo.tests import TestCase, addon_factory, user_factory class TestAbuse(TestCase): fixtures = ['base/addon_3615', 'base/user_999'] def test_choices(self): assert AbuseReport.ADDON_SIGNATURES.choices == ( (None, 'None'), ...
14,344
closed
# Copyright (C) 2012 Yipit, Inc <coders@yipit.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your option)...
14,345
test reader defaults
import os from unittest import mock import numpy as np import pytest from npe2 import DynamicPlugin from npe2.manifest.contributions import SampleDataURI from qtpy.QtWidgets import QLabel, QRadioButton from napari._qt.dialogs.qt_reader_dialog import ( QtReaderDialog, open_with_dialog_choices, prepare_rema...
14,346
check dataset
# Copyright 2018 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...
14,347
test boolean false
from argparse import ArgumentTypeError from contextlib import nullcontext from typing import Type import pytest from streamlink.utils.args import boolean, comma_list, comma_list_filter, filesize, keyvalue, num does_not_raise = nullcontext() class TestUtilsArgs: def test_boolean_true(self): assert bool...
14,348
get url
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
14,349
get sections for learner
from enum import Enum from lms.models import Course, Grouping from lms.product.plugin.grouping import GroupError, GroupingPlugin from lms.services.exceptions import CanvasAPIError class ErrorCodes(str, Enum): """Error codes that the FE is going to check for.""" STUDENT_NOT_IN_GROUP = "canvas_student_not_in_...
14,350
set up
import os import shutil from io import BytesIO from mutagen.ogg import OggPage from mutagen.oggvorbis import OggVorbis, OggVorbisInfo, delete, error from tests import TestCase, DATA_DIR, get_temp_copy from tests.test_ogg import TOggFileTypeMixin class TOggVorbis(TestCase, TOggFileTypeMixin): Kind = OggVorbis ...
14,351
strat apply mixture
# Copyright 2021 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 ...
14,352
safe str
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2018 The gPodder Team # # gPodder 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 Licens...
14,353
compare system forces
#!/usr/bin/env python # ============================================================================= # MODULE DOCSTRING # ============================================================================= """ Test force factories in forcefactories.py. """ # ==============================================================...
14,354
test has service valid service type
import unittest import cloudbridge from cloudbridge import interfaces from cloudbridge.base import helpers as cb_helpers from cloudbridge.factory import CloudProviderFactory from cloudbridge.interfaces import TestMockHelperMixin from cloudbridge.interfaces.exceptions import ProviderConnectionException from tests impo...
14,355
test find affiliation by ids
# Copyright © 2019 Province of British Columbia # # 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,356
test eval
""" Test the API of the symtable module. """ import symtable import unittest from test import test_support TEST_CODE = """ import sys glob = 42 class Mine: instance_var = 24 def a_method(p1, p2): pass def spam(a, b, *var, **kw): global bar bar = 47 x = 23 glob def internal(): ...
14,357
expansion
# Copyright 2019-2022 ETH Zurich and the DaCe authors. All rights reserved. from dace import dtypes, library, properties, subsets, symbolic from dace.data import _prod from dace.libraries.mpi import utils from dace.sdfg import nodes from dace.transformation.transformation import ExpandTransformation from .. import envi...
14,358
type
# 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,359
build arguments schema
# -------------------------------------------------------------------------------------------- # 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,360
test main pipeline fraczero high
#!/usr/bin/env python # coding: utf-8 import numpy as np from cleanlab.benchmarking import noise_generation import pytest seed = 0 np.random.seed(0) def test_main_pipeline( verbose=False, n=10, valid_noise_matrix=True, frac_zero_noise_rates=0, ): trace = 1.5 py = [0.1, 0.1, 0.2, 0.6] K =...
14,361
process operations
import abc import logging from pathlib import Path from typing import Any, Dict, Iterable, List, Optional, Sequence, Union from unittest.mock import Mock from determined import searcher from determined.common.api import bindings from determined.experimental import client class MockMaster(metaclass=abc.ABCMeta): ...
14,362
test split
import numpy as np import hypothesis.strategies as st import unittest import caffe2.python.hypothesis_test_util as hu from caffe2.python import core, workspace from hypothesis import given, settings import caffe2.python.ideep_test_util as mu @st.composite def _tensor_splits(draw, add_axis=False): """Generates...
14,363
get counts
from datetime import date, datetime from typing import List, Dict from typing import Optional, Union import attr from cattr.converters import Converter from dateutil import tz converter = Converter() converter.register_unstructure_hook(datetime, lambda dt: dt.isoformat()) converter.register_structure_hook(datetime, l...
14,364
test revoked cert should return false from
""" :codeauthor: Wayne Werner <wwerner@saltstack.com> """ # Import the future import os import tempfile # Salt Libs import salt.modules.cmdmod as cmd import salt.modules.file as file import salt.modules.tls as tls import salt.utils.files as files import salt.utils.stringutils as stringutils # Testing libs from ...
14,365
fetch labels for templates
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in complia...
14,366
test pin cpu
#!/usr/bin/python import os import tempfile import unittest import sys from avocado.utils import process # simple magic for using scripts within a source tree basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if os.path.isdir(os.path.join(basedir, 'virttest')): sys.path.append(basedir) from...
14,367
test totals
import unittest from collections import namedtuple from copy import deepcopy from openmdao.utils.assert_utils import ( assert_near_equal, assert_check_partials, assert_check_totals, ) from tacs import TACS ErrorTuple = namedtuple("ErrorTuple", ["forward", "reverse", "forward_reverse"]) """ This is a bas...
14,368
can create from shape impl
""" This file is part of the SiEPIC-EBeam-PDK Version history: Lukas Chrostowski 2023/02/19 - PCell takes an input of the waveguide type from a dropdown list Loaded from Waveguides.xml - Metal heater """ from pya import * import pya class wg_heater(pya.PCellDeclarationHelper): def __init__(self): # Imp...
14,369
test profile self not logged in
import pytest from allauth.account.models import EmailAddress from rest_framework import status from rest_framework.test import force_authenticate from grandchallenge.profiles.views import UserProfileViewSet from grandchallenge.subdomains.utils import reverse from tests.factories import PolicyFactory, UserFactory from...
14,370
save data
# Copyright (C) 2017-2023 Cleanlab Inc. # This file is part of cleanlab. # # cleanlab is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the License, or # (at your option) any later ve...
14,371
request
""" requests.api ~~~~~~~~~~~~ This module implements the Requests API. :copyright: (c) 2012 by Kenneth Reitz. :license: Apache2, see LICENSE for more details. """ from . import sessions def METHOD_NAME(method, url, **kwargs): """Constructs and sends a :class:`Request <Request>`. :param method: method for ...
14,372
test any locale word tokenize
# Copyright (c) 2023, NVIDIA CORPORATION & 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
14,373
generate
from conan import ConanFile from conan.tools.build import check_min_cppstd from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, collect_libs, copy, export_conandata_patches, get, replace_in_file, rm, rmdir import os required_conan_version = ">=1.53.0"...
14,374
cumsum
# 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 bisect import numpy as np from torch.utils.data.dataloader import default_collate from . import FairseqDataset class ConcatDataset(...
14,375
test fails with invalid agent token
''' Faraday Penetration Test IDE Copyright (C) 2013 Infobyte LLC (http://www.infobytesec.com/) See the file 'doc/LICENSE' for the license information ''' import base64 import pytest from tests import factories from flask_security.utils import hash_password from faraday.server.api.modules.websocket_auth import decode...
14,376
test update winapp2
# vim: ts=4:sw=4:expandtab # BleachBit # Copyright (C) 2008-2023 Andrew Ziem # https://www.bleachbit.org # # 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 # ...
14,377
submit sync flow task
"""SyncFlowExecutor that will run continuously until stop is called.""" import logging import time from concurrent.futures.thread import ThreadPoolExecutor from dataclasses import dataclass from typing import Callable, Optional from samcli.lib.sync.exceptions import SyncFlowException from samcli.lib.sync.sync_flow imp...
14,378
get digits graph
import pynini from fun_text_processing.inverse_text_normalization.vi.graph_utils import GraphFst, delete_extra_space, delete_space from fun_text_processing.inverse_text_normalization.vi.utils import get_abs_path from pynini.lib import pynutil graph_teen = pynini.string_file(get_abs_path("data/numbers/teen.tsv")).opti...
14,379
test validate invalid envelope expression
import re import jmespath import pytest from jmespath import functions from aws_lambda_powertools.utilities.validation import ( envelopes, exceptions, validate, validator, ) def test_validate_raw_event(schema, raw_event): validate(event=raw_event, schema=schema) def test_validate_wrapped_event...
14,380
input entry to dict
# Copyright (C) 2023 Sartography # # This file is part of SpiffWorkflow. # # SpiffWorkflow is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 3.0 of the License, or (at your option) any la...
14,381
decl
# -*- coding: utf-8 -*- ############################################################################ # Copyright 2007-2023 Universidade do Porto - Faculdade de Engenharia # # Laboratório de Sistemas e Tecnologia Subaquática (LSTS) # #################################################################...
14,382
log stats
# # Copyright (C) 2012 Uninett AS # # This file is part of Network Administration Visualized (NAV). # # NAV is free software: you can redistribute it and/or modify it under # the terms of the GNU General Public License version 3 as published by # the Free Software Foundation. # # This program is distributed in the hope...
14,383
output object
# pylint: disable=too-many-function-args """ Mock vasp command. ------------------ Separate cli interface for commands useful in development and testing. """ import os from pathlib import Path import shutil import click from aiida_vasp.parsers.content_parsers.incar import IncarParser from aiida_vasp.parsers.content_...
14,384
handle
#!/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 m...
14,385
code snippet valued
# Copyright 2020 ACSONE SA # @author Simone Orsi <simahawk@gmail.com> # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). import datetime import logging import textwrap import pytz from odoo import fields, models from odoo.tools import DotDict, safe_eval _logger = logging.getLogger(__name__) def date_t...
14,386
parse part
import email import logging from email.policy import default from email.errors import MessageError from html import escape from pantomime import normalize_mimetype from followthemoney import model from ingestors.ingestor import Ingestor from ingestors.support.email import EmailSupport from ingestors.support.encoding i...
14,387
test ip address is not changed
""" Tests for CountryMiddleware. """ from unittest.mock import MagicMock, PropertyMock, patch import geoip2 import maxminddb from django.contrib.sessions.middleware import SessionMiddleware from django.test import TestCase from django.test.client import RequestFactory from openedx.core.djangoapps.geoinfo.middleware...
14,388
balance enumerated
from collections import namedtuple from datetime import datetime from dimagi.utils.parsing import json_format_datetime SohReport = namedtuple('SohReport', 'section_id product_id amount') def balance_ota_block(sp, section_id, soh_reports, datestring): return """ <ns0:balance xmlns:ns0="http://commcarehq....
14,389
generate inc files
import logging from functools import partial from avocado.utils import memory from virttest import utils_misc from virttest import qemu_monitor from provider import backup_utils from provider import blockdev_base LOG_JOB = logging.getLogger('avocado.test') class BlockdevIncreamentalBackupTest(blockdev_base.Block...
14,390
set up
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2016-2018 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in ...
14,391
toggle properties
#!/usr/bin/env python3 # Qtvcp # # Copyright (c) 2017 Chris Morley <chrisinnanaimo@hotmail.com> # # 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 ...
14,392
apply subtask resources
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
14,393
build url
"""An SSE client wrapper to be used with split endpoint.""" import logging import threading from enum import Enum from splitio.push.sse import SSEClient, SSE_EVENT_ERROR from splitio.util.threadutil import EventGroup from splitio.api.commons import headers_from_metadata _LOGGER = logging.getLogger(__name__) class S...
14,394
test direct dark performance
import io from typing import Awaitable, TypeVar import pandas as pd import pytest from ert.async_utils import get_event_loop from ert.config import ErtConfig from ert.dark_storage.endpoints import ensembles, experiments, records, responses from ert.enkf_main import EnKFMain from ert.libres_facade import LibresFacade ...
14,395
priority execution
import functools import os from contextlib import contextmanager import torch.distributed as dist from torch.distributed import ProcessGroup from colossalai.context.singleton_meta import SingletonMeta class DistCoordinator(metaclass=SingletonMeta): """ This class is used to coordinate distributed training. ...
14,396
file line helper
"""Editor window that can serve as an output file. """ import re from tkinter import messagebox from idlelib.editor import EditorWindow file_line_pats = [ # order of patterns matters r'file "([^"]*)", line (\d+)', r'([^\s]+)\((\d+)\)', r'^(\s*\S.*?):\s*(\d+):', # Win filename, maybe starting with ...
14,397
generate
# MIT License # # Copyright The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, ...
14,398
add tag
# Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # w...
14,399
create credential offer
"""Base Indy Issuer class.""" from abc import ABC, ABCMeta, abstractmethod from typing import Sequence, Tuple from ..core.error import BaseError DEFAULT_CRED_DEF_TAG = "default" DEFAULT_SIGNATURE_TYPE = "CL" class IndyIssuerError(BaseError): """Generic issuer error.""" class IndyIssuerRevocationRegistryFull...