id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
10,600
list available filters callback
# -*- 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. ...
10,601
test get targets
# Copyright (c) OpenMMLab. All rights reserved. from unittest import TestCase import numpy as np import torch from mmengine.structures import InstanceData from mmocr.models.textdet.module_losses import TextSnakeModuleLoss from mmocr.structures import TextDetDataSample class TestTextSnakeModuleLoss(TestCase): d...
10,602
get date utc timestamp
# # Copyright (c) 2020 Seagate Technology LLC and/or its Affiliates # # 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 ap...
10,603
test complete env vars
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations from textwrap import dedent from unittest.mock import Mock import pytest from pants.build_graph.address import Address from pants.core.util_rules.envi...
10,604
get depends recursive
#!/usr/bin/env python3 # # SPDX-License-Identifier: GPL-2.0-only # # Determine dependencies of python scripts or available python modules in a search path. # # Given the -d argument and a filename/filenames, returns the modules imported by those files. # Given the -d argument and a directory/directories, recurses to fi...
10,605
validate continuation out date
# Copyright © 2023 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...
10,606
tear down
# Copyright (c) Alibaba, Inc. and its affiliates. import os import shutil import tempfile import unittest import zipfile from modelscope.msdatasets import MsDataset from modelscope.msdatasets.utils.dataset_utils import list_dataset_objects from modelscope.utils import logger as logging from modelscope.utils.constant i...
10,607
parse status
""" Lpstat - command ``lpstat`` =========================== Parsers contains in this module are: LpstatPrinters - command ``/usr/bin/lpstat -p`` LpstatProtocol - command ``/usr/bin/lpstat -v`` """ from insights.core import CommandParser from insights.core.exceptions import SkipComponent from insights.core.plugins im...
10,608
test exp power 256
from functools import partial import pytest from tests.helpers import TEST_FIXTURES from ..vm.vm_test_helpers import run_test ETHEREUM_TESTS_PATH = TEST_FIXTURES["ethereum_tests"]["fixture_path"] run_arithmetic_vm_test = partial( run_test, f"{ETHEREUM_TESTS_PATH}/LegacyTests/Constantinople/VMTests/vmArith...
10,609
test usegmt
import datetime from email import utils import test.support import time import unittest import sys import os.path class DateTimeTests(unittest.TestCase): datestring = 'Sun, 23 Sep 2001 20:10:55' dateargs = (2001, 9, 23, 20, 10, 55) offsetstring = ' -0700' utcoffset = datetime.timedelta(hours=-7) t...
10,610
evallvls
import numpy as n from numpy import * import numpy from numpy import matrix import scipy from scipy.linalg import inv, det, eig import scipy.linalg as la ''' This file containts different hamiltonians and matrices. ''' def hamilB(B0): ''' Calculate hamiltonians for all 4 orientations for specific B field of th...
10,611
test something
import json import unittest from test import DongTaiTestCase from test.apiserver.test_agent_base import REGISTER_JSON, gzipdata from rest_framework.test import APITestCase from dongtai_common.models.user import User class MyTestCase(DongTaiTestCase): def METHOD_NAME(self): self.assertEqual(True, False) ...
10,612
pre processing
#!/usr/bin/env python3 ''' Author: Kaushlendra Pratap Singh SPDX-FileCopyrightText: © 2021 Kaushlendra Pratap <kaushlendrapratap.9837@gmail.com> SPDX-License-Identifier: GPL-2.0-only ''' import spacy import pandas as pd import argparse import re import csv THE_PROBABLE_LOGIC_POS_CHECK = ['NOUN', 'NUM', 'PROPN', 'P...
10,613
test functional characterization experiment upgrade 9 to
import pytest def test_functional_characterization_experiment_upgrade_2_to_3(upgrader, pce_fcc_experiment): value = upgrader.upgrade('functional_characterization_experiment', pce_fcc_experiment, current_version='2', target_version='3') assert value['schema_version'] == '3' assert value['plasmids_library_t...
10,614
check iterable
from __future__ import annotations import urllib.parse from collections.abc import Iterable, Mapping from typing import Any, Literal, Optional, TypeVar, Union, get_args from mopidy import exceptions from mopidy.audio.constants import PlaybackState from mopidy.types import ( DistinctField, Query, QueryValu...
10,615
load rig cameras
import collections import logging import os import shelve from typing import Any, Dict, Iterator, List, Optional, Tuple, Union import numpy as np from opensfm import tracking, features as oft, types, pymap, pygeometry, io, geo from opensfm.dataset import DataSet logger: logging.Logger = logging.getLogger(__name__) ...
10,616
add arguments
import sys from django.core.management.base import BaseCommand from django.db.models import Count from data_refinery_common.logging import get_and_configure_logger from data_refinery_common.models import ( Dataset, Organism, ProcessorJob, ProcessorJobDatasetAssociation, Sample, ) from data_refiner...
10,617
pure func
# This file is part of Hypothesis, which may be found at # https://github.com/HypothesisWorks/hypothesis/ # # Copyright the Hypothesis Authors. # Individual contributors are listed in AUTHORS.rst and the git log. # # This Source Code Form is subject to the terms of the Mozilla Public License, # v. 2.0. If a copy of the...
10,618
make application
"""Http Transport classes and functions.""" import logging from aiohttp import web from ...messaging.error import MessageParseError from ..error import WireFormatParseError from ..wire_format import DIDCOMM_V0_MIME_TYPE, DIDCOMM_V1_MIME_TYPE from .base import BaseInboundTransport, InboundTransportSetupError LOGGER ...
10,619
contextlist
# # Copyright 2005, 2006 Zuza Software Foundation # # This file is part of translate. # # translate 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 la...
10,620
publish schema
import requests, json, pprint, time, threading from dateutil.relativedelta import relativedelta from datetime import datetime, timedelta from flask import request, current_app from app.config import Config class OrgBookIssuerService(): """This class is used to connect to an issuer controller, which handles the n...
10,621
get json data
""" Manage Grafana v4.0 data sources .. versionadded:: 2017.7.0 :configuration: This state requires a configuration profile to be configured in the minion config, minion pillar, or master config. The module will use the 'grafana' key by default, if defined. Example configuration using basic authenticatio...
10,622
main
#!/usr/bin/env python3 # -*- coding: utf-8; py-indent-offset: 4 -*- # # Author: Linuxfabrik GmbH, Zurich, Switzerland # Contact: info (at) linuxfabrik (dot) ch # https://www.linuxfabrik.ch/ # License: The Unlicense, see LICENSE file. # https://github.com/Linuxfabrik/monitoring-plugins/blob/main/CONTRIBUTING....
10,623
test spacetrack three line
"""Tests of how well we parse various file formats.""" import gzip from skyfield import iokit from skyfield.data import hipparcos, stellarium from skyfield.functions import BytesIO from skyfield.iokit import parse_tle old_deltat_preds = b"""\ YEAR TT-UT PREDICTION UT1-UTC PREDICTION ERROR 2017.00 68.591 ...
10,624
debug
# Copyright 2022 NXP # SPDX-License-Identifier: Apache-2.0 '''Runner for Lauterbach TRACE32.''' import argparse import os import platform import subprocess from pathlib import Path from tempfile import TemporaryDirectory from typing import List, Optional from runners.core import BuildConfiguration, RunnerCaps, Runne...
10,625
test local dimshuffle alloc
import numpy as np import pytensor import pytensor.tensor as at from pytensor import function from pytensor import scalar as aes from pytensor.configdefaults import config from pytensor.graph.fg import FunctionGraph from pytensor.graph.rewriting.basic import out2in from pytensor.link.basic import PerformLinker from py...
10,626
get alternating color list
from __future__ import annotations import json import re from datetime import timedelta from common_helper_files import get_binary_from_file from matplotlib import cm, colors from passlib.context import CryptContext from si_prefix import si_format from helperFunctions.fileSystem import get_template_dir SPECIAL_CHAR...
10,627
set catalog attributes
# -*- coding: utf-8 -*- import numpy as np import astropy.units as u from astropy.coordinates import SkyCoord from EXOSIMS.Prototypes.TargetList import TargetList import warnings class KnownRVPlanetsTargetList(TargetList): """Target list based on population of known RV planets from IPAC. Intended for use with...
10,628
print
from typing import Dict, Tuple from .Printable import Printable from .enums import NodeRole class Assigner: """! @brief Default address assigner. This replaces python's generator, as that cannot be dumped. """ __current: int __end: int __step: int def __init__(self, start: int, end: ...
10,629
remove peer
# Copyright (c) Mathias Kaerlev 2011-2012. # This file is part of pyspades. # pyspades 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...
10,630
to text
"""The match_hostname() function from Python 3.7.0, essential when using SSL.""" import sys import socket as _socket try: # Divergence: Python-3.7+'s _ssl has this exception type but older Pythons do not from _ssl import SSLCertVerificationError CertificateError = SSLCertVerificationError except: clas...
10,631
fully qualified class name
import functools import re import threading from typing import Any, Callable, Dict, Generic, List, Optional, Set, Type, TypeVar, Union from .collections import ensure_list from .strings import first_char_to_lower ComplexType = Union[List, Dict, object] _T = TypeVar("_T") class Value(Generic[_T]): """ Simpl...
10,632
update asn
from slips_files.common.imports import * import time import ipaddress import ipwhois import json import requests import maxminddb class ASN: def __init__(self, db=None): self.db = db # Open the maxminddb ASN offline db try: self.asn_db = maxminddb.open_database( ...
10,633
xmliter
import csv import logging import re from io import StringIO from typing import ( TYPE_CHECKING, Any, Callable, Dict, Generator, Iterable, List, Literal, Optional, Union, cast, overload, ) from scrapy.http import Response, TextResponse from scrapy.selector import Selector...
10,634
read entity
from contextlib import contextmanager import os import json import yaml import click import orjson from pathlib import Path from warnings import warn from typing import Any, BinaryIO, Generator, Optional, TextIO, Type from banal import is_mapping, is_listish, ensure_list from followthemoney import model from followthe...
10,635
test value with epsilon inputs returns expected
# ------------------------------------------------------------------------------------------------- # Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved. # https://nautechsystems.io # # Licensed under the GNU Lesser General Public License Version 3.0 (the "License"); # You may not use this file ex...
10,636
get hybrid identity metadatum
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
10,637
step
import contextlib from abc import ABC, abstractmethod from typing import Any, Callable, Dict, List, Optional, Tuple, Type, TYPE_CHECKING, Union import torch from torch import nn from torch.optim import Optimizer from ludwig.modules.optimization_modules import create_optimizer from ludwig.utils.torch_utils import get_...
10,638
enforce pep561
""" Invokes mypy and compare the reults with files in /pytensor and a list of files that are known to fail. Exit code 0 indicates that there are no unexpected results. Usage ----- python scripts/run_mypy.py [--verbose] """ import argparse import importlib import os import pathlib import subprocess import sys from typ...
10,639
test xml attributes copy
# # @file TestXMLAttributes.py # @brief TestXMLAttributes unit tests # # @author Akiya Jouraku (Python conversion) # @author Ben Bornstein # # ====== WARNING ===== WARNING ===== WARNING ===== WARNING ===== WARNING ====== # # DO NOT EDIT THIS FILE. # # This file was generated automatically by converting the fil...
10,640
accept
# *************************************************************************** # * Copyright (c) 2022 Uwe Stöhr <uwestoehr@lyx.org> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
10,641
test squeezenet1 0
################################################################################################### # ATTENTION! This test will most probably fail if you install TensorRT 6.0.1 only. # That's because it's shipped with older version of ONNX parser not supporting some # required features. To make it work please use new v...
10,642
main
#!/usr/bin/env python3 # A script that increments the language server version, # updates the npm package versions of the editor extensions, # updates the changelog and creates an annotated Git tag. import argparse import subprocess import re import os import tempfile from pathlib import Path from utils.cli import pr...
10,643
float to string
#!/usr/bin/env python from __future__ import print_function import sys import argparse from collections import defaultdict parser = argparse.ArgumentParser(description=""" Usage: extend_segment_times.py [options] <input-segments >output-segments This program pads the times in a 'segments' file (e.g. data/train/seg...
10,644
rotation1
# coding: utf-8 # /*########################################################################## # # Copyright (C) 2016-2018 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to d...
10,645
update fit
import time import logging from sas.sascalc.fit import FitHandler class ConsoleUpdate(FitHandler): """ Print progress to the console. """ isbetter = False """Record whether results improved since last update""" progress_delta = 60 """Number of seconds between progress updates""" improve...
10,646
build
from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os from conan.tools.METHOD_NAME import check_min_cppstd, stdcpp_library from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, collect_l...
10,647
test api key auth
import re from collections import namedtuple import pytest from test.common_helper import get_test_data_dir NO_AUTH_ENDPOINTS = ['/about', '/doc', '/static', '/swagger', '/fs-static/pathfilename'] REQUEST_FAILS = [b'404 Not Found', b'405 Method Not Allowed', b'The method is not allowed'] MockUser = namedtuple('MockU...
10,648
mask
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE from __future__ import annotations __all__ = ("ByteMaskedForm",) from collections.abc import Callable import awkward as ak from awkward._nplikes.numpylike import NumpyMetadata from awkward._parameters import type_parameters_equal ...
10,649
create vb
from asyncio import create_task import pytest import zarr from pathlib import Path import numpy as np from brainlit.algorithms.connect_fragments.viterbrain import ( ViterBrain, explain_viterbrain, ) from brainlit.preprocessing import image_process import networkx as nx from numpy.testing import ( assert_arr...
10,650
test contextualize text with non ascii context
# coding=utf-8 """ Tests capa util """ import unittest import ddt from lxml import etree from xmodule.capa.tests.helpers import test_capa_system from xmodule.capa.util import ( compare_with_tolerance, contextualize_text, get_inner_html_from_xpath, remove_markup, sanitize_html ) @ddt.ddt class ...
10,651
test no divisionset
from django.test import TestCase from elections.tests.factories import ElectedRoleFactory from organisations.models import ( DivisionProblem, OrganisationGeographyProblem, OrganisationProblem, ) from organisations.tests.factories import ( DivisionGeographyFactory, OrganisationDivisionFactory, Or...
10,652
test property setter copies getter docstring
# Test case for property # more tests are in test_descr import sys import unittest from test.support import run_unittest class PropertyBase(Exception): pass class PropertyGet(PropertyBase): pass class PropertySet(PropertyBase): pass class PropertyDel(PropertyBase): pass class BaseClass(object): ...
10,653
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 # --------------------------------...
10,654
get guardduty common attr
import json from flatten_json import flatten import copy from stix_shifter_utils.modules.base.stix_transmission.base_json_results_connector import BaseJsonResultsConnector from stix_shifter_utils.utils.error_response import ErrorResponder from stix_shifter_utils.utils import logger from stix_shifter_utils.utils.file_he...
10,655
setup stubs init
#!/usr/bin/python import unittest import os import sys from avocado.utils import path 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(...
10,656
check non empty str
# -*- coding: utf-8 -*- from verta._vendored import six class KafkaSettings(object): """ A set of Kafka topics to be used with deployed endpoints. For use during :class:`~verta.endpoint.Endpoint` creation or with :meth:`Endpoint.update() <verta.endpoint.Endpoint.update>`. Search for available K...
10,657
create notebook
# # Copyright (c) 2022, Neptune Labs Sp. z o.o. # # 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...
10,658
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...
10,659
annotate dataset
""" This script is a utility for interactively annotating data categories in the dataset manifest """ from typing import List, Union import click from fideslang import FidesModel, manifests from fideslang.manifests import ingest_manifests from fideslang.models import Dataset, DatasetCollection, DatasetField, FidesKey ...
10,660
random plan version
import random import uuid from datetime import date, timedelta from django.test import TestCase from corehq.apps.accounting.models import ( BillingAccount, DefaultProductPlan, SoftwarePlanEdition, Subscription, SubscriptionAdjustmentMethod, ) from corehq.apps.accounting.utils.subscription import e...
10,661
version to lib url
#!/usr/bin/env python3 # Shaka Player Version Index Generator # Copyright 2022 Google LLC # SPDX-License-Identifier: Apache-2.0 # Generate an index of Shaka Player versions on appspot. import collections import jinja2 import json import os import re import subprocess DEMO_URL_TEMPLATE = 'https://{0}-dot-shaka-playe...
10,662
description
# pylint: disable=C0111,R0903 """Displays information about the current song in cmus. Requires the following executable: * cmus-remote Parameters: * cmus.format: Format string for the song information. Tag values can be put in curly brackets (i.e. {artist}) Additional tags: * {file} - full son...
10,663
test roundtrip
# :copyright (c) URBANopt, Alliance for Sustainable Energy, LLC, and other contributors. # See also https://github.com/urbanopt/geojson-modelica-translator/blob/develop/LICENSE.md import filecmp import os import unittest from geojson_modelica_translator.modelica.input_parser import InputParser class InputParserTest...
10,664
rqjob
"""Miscellaneous background jobs.""" from __future__ import annotations from collections import defaultdict from functools import wraps from typing import Callable from typing_extensions import Protocol import requests from flask import g from baseframe import statsd from .. import app, rq from ..extapi.boxoffice ...
10,665
test repr
#!/usr/bin/env python # -*- coding: utf-8 -*- import unittest from datetime import datetime from pyowm.agroapi10.soil import Soil from pyowm.utils.formatting import UTC class TestSoil(unittest.TestCase): test_reference_time = 1378459200 test_iso_reference_time = "2013-09-06 09:20:00+00:00" test_date_ref...
10,666
get attached items
# This file is part of Indico. # Copyright (C) 2002 - 2023 CERN # # Indico is free software; you can redistribute it and/or # modify it under the terms of the MIT License; see the # LICENSE file for more details. from flask import session from indico.core.db import db from indico.util.signals import make_interceptabl...
10,667
get
r""" This code was generated by ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ Twilio - Studio ...
10,668
flush
# -*- coding: utf-8 -*- # Copyright (c) 2018, Samir Musali <samir.musali@logdna.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) __metacl...
10,669
new
# 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. from bkr.server.database import session from turbogears import expose,...
10,670
get x1
#! /usr/bin/env python3 # Copyright 2021 Samsung Research America # Copyright 2022 Afif Swaidan # # 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-...
10,671
update restraints
from __future__ import absolute_import, division, print_function import sys ddr_master_params = ''' ddr .style = hidden .short_caption = Density dependent restraints { enable = False .type = bool bond_weighting = True .type = bool angle_weighting = True .type = bool trans_peptide = True .ty...
10,672
configure loader modules
""" Unit tests for the docker state """ import pytest import salt.modules.dockermod as docker_mod import salt.states.docker_volume as docker_state from tests.support.mock import Mock, patch @pytest.fixture def METHOD_NAME(): return { docker_mod: {"__context__": {"docker.docker_version": ""}}, do...
10,673
azure chat messages with function calling
from typing import List import pytest from llama_index.llms.base import ChatMessage, MessageRole from llama_index.llms.openai_utils import ( from_openai_message_dicts, to_openai_message_dicts, ) @pytest.fixture def chat_messages_with_function_calling() -> List[ChatMessage]: return [ ChatMessage(...
10,674
add partition generic
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
10,675
set up
import gzip import tempfile from tests.end_to_end.helpers import assertions from tests.end_to_end.target_snowflake.tap_postgres import TapPostgres TAP_ID = 'postgres_to_sf_archive_load_files' TARGET_ID = 'snowflake' ARCHIVE_S3_PREFIX = 'archive_folder' class TestReplicatePGToSFWithArchiveLoadFiles(TapPostgres): ...
10,676
initialize psu fan
#!/usr/bin/env python ############################################################################# # Celestica # # Module contains an implementation of SONiC Platform Base API and # provides the psu status which are available in the platform # ##########################################################################...
10,677
auth none
from collections.abc import Callable, Iterable, Mapping, Sequence from logging import Logger from socket import socket from threading import Condition, Event, Lock, Thread from types import ModuleType from typing import Any, Protocol from typing_extensions import TypeAlias from paramiko.auth_handler import AuthHandler...
10,678
require
# Copyright (c) 2016 The Pycroft Authors. See the AUTHORS file. # This file is part of the Pycroft project and licensed under the terms of # the Apache License, Version 2.0. See the LICENSE file for details. """ web ~~~~~~~~~~~~~~ This package contains the web interface based on flask :copyright: (c) ...
10,679
main
# Copyright (c) 2011-present, Facebook, Inc. All rights reserved. # This source code is licensed under both the GPLv2 (found in the # COPYING file in the root directory) and Apache 2.0 License # (found in the LICENSE.Apache file in the root directory). import argparse from advisor.db_config_optimizer import Confi...
10,680
get scaled font
from typing import Any, Optional class Context: def __init__(self, target: Any) -> None: ... def get_target(self): ... def save(self) -> None: ... def restore(self) -> None: ... def __enter__(self): ... def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: ... def push_group...
10,681
user model
from __future__ import annotations import re from typing import Any from django.apps import apps from django.conf import settings from django.db import models from sentry.db.models import control_silo_only_model from .fields import JSONField from .utils import setting AUTH_USER_MODEL = settings.AUTH_USER_MODEL UI...
10,682
test person filter
from typing import Any, Dict from django.urls import reverse from rest_framework.test import APITestCase from consents.models import Consent, Term, TermEnum, TermOption, TermOptionChoices from workshops.models import Airport, Person from workshops.tests.base import consent_to_all_required_consents class TestFilter(...
10,683
decorator
import enum import sys from functools import cached_property from functools import partial from functools import wraps from typing import TYPE_CHECKING from typing import Union import pytest from _pytest.compat import _PytestWrapper from _pytest.compat import assert_never from _pytest.compat import get_real_func from ...
10,684
delete artifacts
import os import posixpath import sys import threading import urllib.parse from contextlib import contextmanager from mlflow.entities import FileInfo from mlflow.store.artifact.artifact_repo import ArtifactRepository # Based on: https://stackoverflow.com/a/58466685 def _put_r_for_windows(sftp, local_dir, remote_dir,...
10,685
test get response datetime date string is
# -*- coding: utf-8 -*- import warnings import deprecation import pytest from os.path import join, sep from datetime import datetime, timezone, timedelta from sceptre.exceptions import PathConversionError from sceptre.helpers import ( get_external_stack_name, create_deprecated_alias_property, delete_keys...
10,686
forward
# Copyright (c) 2022 PaddlePaddle 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 applic...
10,687
migrate resolver
# -*- coding: utf-8 -*- # # LinOTP - the open source solution for two factor authentication # Copyright (C) 2010-2019 KeyIdentity GmbH # Copyright (C) 2019- netgo software GmbH # # This file is part of LinOTP server. # # This program is free software: you can redistribute it and/or # modify it und...
10,688
generate report
#!/usr/bin/env python3 import argparse import subprocess import sys import os import shutil from typing import List ACCEPTABLE_COMBINATIONS = ( ("gcov", "genhtml", "html"), ("clang", "llvm-cov", "html"), ("gcov", "gcovr", "summary"), ("gcov", "gcovr", "html"), ) def parse_args(): parser = argpar...
10,689
open
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- import loggi...
10,690
forward
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import math from fairseq import metrics, utils from fairseq.criterions import register_criterion from .label_smoothed_cross_entropy import (...
10,691
test state universe get findings
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
10,692
collect prometheus metrics
from nucypher.exceptions import DevelopmentInstallationRequired try: from prometheus_client.core import Timestamp from prometheus_client.registry import REGISTRY, CollectorRegistry from prometheus_client.utils import floatToGoString except ImportError: raise DevelopmentInstallationRequired(importable_...
10,693
render actions
""" This module contains extra functions/shortcuts used to render HTML. """ import json import re import sys from django import template from django.conf import settings from django.http import HttpResponse, JsonResponse from django.shortcuts import render from django.template.loader import render_to_string def _re...
10,694
test get zone tops some wells deprecated
"""Collect deprecated stuff for Points() and Polygons().""" import glob import pathlib import pandas as pd import pytest import xtgeo from packaging import version from xtgeo import version as xtgeo_version PFILE1A = pathlib.Path("polygons/reek/1/top_upper_reek_faultpoly.zmap") PFILE1B = pathlib.Path("polygons/reek/1...
10,695
boundary cell flag
import numpy as np from scipy.sparse import csr_matrix class StructureMesh1dDataStructure(): def __init__(self, nx, itype): """ @brief Initialize 1D structured mesh data structure @param nx: int, 网格剖分数 @param itype : dtype, data type of indices """ self.nx ...
10,696
test describe unknown budget
import boto3 import pytest from botocore.exceptions import ClientError from moto import mock_budgets from moto.core import DEFAULT_ACCOUNT_ID as ACCOUNT_ID @mock_budgets def test_create_and_describe_budget_minimal_params(): client = boto3.client("budgets", region_name="us-east-1") resp = client.create_budget...
10,697
log2
#------------------------------------------------------------------------------- # Experimenting with algorithms for seeding the flaw distributions to follow # the Weibull distribution. #------------------------------------------------------------------------------- from math import * import Gnuplot import random # Th...
10,698
set ref time
""" novelWriter – GUI Main Window Status Bar ======================================== File History: Created: 2019-04-20 [0.0.1] This file is a part of novelWriter Copyright 2018–2023, Veronica Berglyd Olsen This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Pub...
10,699
description
# 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__ ...