id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
18,500
on active device changed
# Copyright (c) 2022 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot from typing import List, Mapping, Optional, TYPE_CHECKING from UM.Application import Application from UM.i18n import i18nCatalog from UM.Logger import...
18,501
put
import logging from django.http import QueryDict from rest_framework.response import Response from rest_framework.exceptions import ValidationError from rest_framework import status from rest_framework import generics from rest_framework import serializers from hs_core import hydroshare from hs_core.models import Co...
18,502
test user given does not exist
"""Tests for project transfer command""" import os import sys from django.contrib.auth import get_user_model from django.core.management import call_command from six import StringIO from onadata.apps.logger.models import Project, XForm from onadata.apps.main.tests.test_base import TestBase class TestMoveProjectToAn...
18,503
test iterator
import kdb, unittest class KeySet(unittest.TestCase): def setUp(self): self.ks = kdb.KeySet(100, kdb.Key("system:/key1"), kdb.Key("system:/key2"), kdb.Key("user:/key3"), kdb.Key("user:/key4"), kdb.KS_END, kdb.Key("user:/lost") ) def test_ctor(self): self.assertIsInstance(self.ks, kdb.KeySet...
18,504
test unitcell 0
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2017 Stanford University and the Authors # # Authors: Robert McGibbon # Contributors: Matthew Harrigan # # MDTraj is...
18,505
test phase active
import pytest import rules from adhocracy4.projects.enums import Access from adhocracy4.test.helpers import freeze_phase from adhocracy4.test.helpers import freeze_post_phase from adhocracy4.test.helpers import freeze_pre_phase from adhocracy4.test.helpers import setup_phase from adhocracy4.test.helpers import setup_u...
18,506
prepare request
# 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) AutoRest Code Generator. # Changes ...
18,507
test
#!/usr/bin/env python # =================================== # Copyright (c) Microsoft Corporation. All rights reserved. # See license.txt for license information. # =================================== from __future__ import print_function from __future__ import with_statement import os import sys import subprocess im...
18,508
generate uuid
import sys import uuid import functools from collections import defaultdict from dataclasses import dataclass import xml_dict from append_xmi import XMI fn, ofn = sys.argv[1:] content = xml_dict.read(fn) null_uuid = uuid.UUID(bytes=bytes([0])*16) def recurse(fn, nd=None, stack=None): if nd is None: nd = conten...
18,509
has quant annotation
import logging from typing import Optional import torch from torch._export.error import InternalError from torch._export.pass_base import _ExportPassBase from torch.ao.quantization.pt2e.utils import ( _filter_sym_size_users, _find_q_dq_node_for_user, _is_valid_annotation, ) from torch.ao.quantization.qua...
18,510
battle 7
from module.campaign.campaign_base import CampaignBase from module.logger import logger from module.map.map_base import CampaignMap from module.map.map_grids import RoadGrids, SelectedGrids MAP = CampaignMap('SP') MAP.shape = 'K9' MAP.camera_data = ['D3', 'E6'] MAP.camera_data_spawn_point = ['D3'] MAP.map_data = """ ...
18,511
flow
r"""Krylov–Uzawa method for the Stokes equation. This example solves the Stokes equation iteratively in a square domain. Direct solvers for the Stokes equation do not scale; iterative solvers are required for all but the smallest two-dimensional problems. A square domain is used here instead of the disk since it eas...
18,512
re emit values
""" [Name] BeamInfo [Description] BeamInfo hardware object is used to define final beam size and shape. It can include aperture, slits and/or other beam definer (lenses or other eq.) [Emited signals] beamInfoChanged beamPosChanged [Included Hardware Objects] ----------------------------------------------------------...
18,513
avoid conflicts
"""Draw generators for randomly drawn rounds, both two-team and BP.""" import random from django.utils.translation import gettext as _ from .common import BaseBPDrawGenerator, BasePairDrawGenerator, DrawUserError from .graph import GraphAllocatedSidesMixin, GraphGeneratorMixin from .pairing import BPPairing, Pairing...
18,514
on sync
# # Copyright 2018 The boardgame.io Authors # # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/MIT. # # pylint: disable=invalid-name,import-error,no-self-use """ Boardgame.io python client. """ import logging import socketIO_c...
18,515
test should return revision when git revlist
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2020 PyBuilder Team # # 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/l...
18,516
quality checks qids
""" This module computes evaluation metrics for MSMARCO dataset on the ranking task. Intenral hard coded eval files version. DO NOT PUBLISH! Command line: python msmarco_eval_ranking.py <path_to_candidate_file> Creation Date : 06/12/2018 Last Modified : 4/09/2019 Authors : Daniel Campos <dacamp@microsoft.com>, Rutger ...
18,517
update account field discourse down
from c2corg_api.models.user import User from c2corg_api.models.user_profile import USERPROFILE_TYPE from c2corg_api.search import search_documents, elasticsearch_config from c2corg_api.tests.views.test_user import BaseUserTestRest, \ forum_username_tests from unittest.mock import patch class TestUserAccountRest(...
18,518
maxmin sinr
""" Copyright 2013 Steven Diamond 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...
18,519
unload
# -*- coding: utf-8 -*- import threading from functools import wraps from ..helpers import Periodical, is_sequence from .plugin import BasePlugin def threaded(func): @wraps(func) def wrapper(self, *args, **kwargs): return self.pyload.adm.start_thread(func, self, *args, **kwargs) return wrapper ...
18,520
test str when code is not zero
# -*- coding: utf-8 -*- # Copyright (c) 2020 Nekokatt # Copyright (c) 2021-present davfsa # # 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 t...
18,521
edit url
import functools from datetime import datetime, timezone from sqlalchemy.orm import relationship from sqlalchemy.schema import Column, ForeignKey from sqlalchemy.sql.sqltypes import Boolean, Integer, String, Text from files.classes.cron.tasks import (RepeatableTask, ScheduledTaskType, ...
18,522
test forward signature
# Copyright 2021 The HuggingFace Team. 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 applicabl...
18,523
lambda client
""" Downloads Layers locally """ import logging from pathlib import Path from typing import List import boto3 from botocore.exceptions import ClientError, NoCredentialsError from samcli.commands.local.cli_common.user_exceptions import CredentialsRequired, ResourceNotFound from samcli.lib.providers.provider import La...
18,524
test docstring parsing invalid
from typing import Any, Dict, List, Optional, Tuple, Type, Union import pytest from pytest import raises from typing_extensions import Literal from knot_resolver_manager.utils.modeling import ConfigSchema, parse_json, parse_yaml from knot_resolver_manager.utils.modeling.exceptions import DataDescriptionError, DataVal...
18,525
test transformer needs covariates
import os import numpy as np from sklearn.model_selection import KFold from photonai.base import PhotonRegistry from photonai.base import PipelineElement, Hyperpipe, OutputSettings from photonai.helper.photon_base_test import PhotonBaseTest class RegistryTest(PhotonBaseTest): @classmethod def setUpClass(c...
18,526
process video classify
""" # @File : process_result.py # @Author: macaihong # @Date : 2019/12/15 # @Desc : """ import sys import os import re import numpy as np import pickle import json import logger logger = logger.Logger() def get_data_res(label_map, data, topk): """get_data_res""" sum_vid = len(data) video_result = [...
18,527
test sb parse conn str whitespace trailing
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- import os i...
18,528
test maven nonexistent
# -*- coding: utf-8 -*- # # Copyright © 2014 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed in t...
18,529
delete
from typing import Optional from flask import Flask from flask.wrappers import Request, Response from flask_restful import Api from pbench.server import JSONOBJECT, OperationCode from pbench.server.api.resources import ( ApiBase, ApiContext, ApiMethod, ApiParams, ApiSchema, ) import pbench.server....
18,530
limit order
""" Keyless interface definition Copyright (C) 2022 Emerson Dove This program 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 of the License, or (at your option) an...
18,531
request
# -*- coding: utf-8 -*- """ hyper/common/connection ~~~~~~~~~~~~~~~~~~~~~~~ Hyper's HTTP/1.1 and HTTP/2 abstraction layer. """ from .exceptions import TLSUpgrade, HTTPUpgrade from ..http11.connection import HTTP11Connection from ..http20.connection import HTTP20Connection from ..tls import H2_NPN_PROTOCOLS, H2C_PROTOC...
18,532
test format msg
# emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*- # ex: set sts=4 ts=4 sw=4 et: # ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ## # # See COPYING file distributed along with the datalad package for the # copyright and license terms. # # ## ###...
18,533
get search status
from aiogoogle import Aiogoogle, auth from aiogoogle.models import Request from aiogoogle.excs import HTTPError from aiohttp.client_exceptions import ClientConnectionError from asyncio.exceptions import TimeoutError import json from stix_shifter_utils.utils import logger from stix_shifter_utils.utils.error_response imp...
18,534
test rename use only rename
from setup_tests import ( check_post_msg, path_to_uri, run_request, test_dir, write_rpc_request, ) def rename_request(new_name: str, file_path, ln: int, ch: int): return write_rpc_request( 1, "textDocument/rename", { "newName": new_name, "textDoc...
18,535
reward metric
"""This is a minimal example of using Tianshou with MARL to train agents. Author: Will (https://github.com/WillDudley) Python version used: 3.8.10 Requirements: pettingzoo == 1.22.0 git+https://github.com/thu-ml/tianshou """ import os from typing import Optional, Tuple import gymnasium import numpy as np import to...
18,536
close
from tkinter import * from idlelib import SearchEngine from idlelib.SearchDialogBase import SearchDialogBase import re def replace(text): root = text._root() engine = SearchEngine.get(root) if not hasattr(engine, "_replacedialog"): engine._replacedialog = ReplaceDialog(root, engine) dialog = ...
18,537
default ne r converter licensed config
from nlu.pipe.extractors.extractor_methods.base_extractor_methods import * from nlu.pipe.extractors.extractor_methods.helper_extractor_methods import * """ This file contains methods to get pre-defined configurations for every annotator. Extractor_resolver.py should be used to resolve SparkNLP Annotator classes to met...
18,538
periodic clean upload directory
"""""" from __future__ import annotations import json import logging import time from datetime import timedelta from io import BufferedReader from pathlib import PosixPath from typing import Any, Dict, Optional from uuid import UUID, uuid1 from celery import shared_task from flask import current_app from abilian.app...
18,539
use
# being a bit too dynamic # pylint: disable=E1101 from __future__ import division from contextlib import contextmanager import warnings import numpy as np import pandas.compat as compat from pandas.compat import lmap, lrange from pandas.core.dtypes.common import is_list_like def _get_standard_colors(num_colors=No...
18,540
list latest
from uuid import uuid4, UUID from typing import List, Dict, Tuple, Optional, Union, Iterable, TypeVar, Generic from gemd.entity.link_by_uid import LinkByUID from citrine._session import Session from citrine.exceptions import NotFound from citrine.resources.material_run import MaterialRun from citrine.resources.gemtab...
18,541
get metrics
# Copyright 2023 Iguazio # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, softwa...
18,542
test lambda function with deployment preference uses
from unittest.case import skipIf from integration.config.service_names import CODE_DEPLOY from integration.helpers.base_test import BaseTest from integration.helpers.resource import current_region_does_not_support, generate_suffix CODEDEPLOY_APPLICATION_LOGICAL_ID = "ServerlessDeploymentApplication" LAMBDA_FUNCTION_N...
18,543
write cp last modified by
############################################################################### # # Core - A class for writing the Excel XLSX Worksheet file. # # Copyright 2013-2017, John McNamara, jmcnamara@cpan.org # # Standard packages. from datetime import datetime # Package imports. from . import xmlwriter class Core(xmlwrite...
18,544
test get normalized tokens
# Copyright (c) 2022, 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...
18,545
export and load model
import multiprocessing from typing import Callable import pytest from determined import keras from determined.experimental import client from tests import config as conf from tests import experiment as exp def METHOD_NAME(experiment_id: int, master_url: str) -> None: # Normally verifying that we can load a mode...
18,546
pull
import subprocess import os import sys from stimela import utils from stimela.cargo import cab import json import stimela import time import datetime import tempfile import hashlib from shutil import which version = None for item in ["apptainer", "singularity"]: BINARY = which(item) BINARY_NAME = item if...
18,547
calculate uv index
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # (C) British Crown copyright. The Met Office. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are me...
18,548
create next atlas relation
# Copyright Contributors to the Amundsen project. # SPDX-License-Identifier: Apache-2.0 from typing import ( Iterator, List, Optional, Union, ) from amundsen_common.utils.atlas import AtlasCommonParams, AtlasCommonTypes from amundsen_rds.models import RDSModel from amundsen_rds.models.dashboard import DashboardOw...
18,549
test get column names
# 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...
18,550
find user by email
from __future__ import annotations import random import string from flask import current_app from flask_security import current_user, SQLAlchemySessionUserDatastore from flask_security.recoverable import update_password from email_validator import ( validate_email, EmailNotValidError, EmailUndeliverableEr...
18,551
test cli
import logging import os import pytest from procrastinate import __version__, cli, exceptions pytestmark = pytest.mark.runner_setup(mix_stderr=False) @pytest.fixture def entrypoint(cli_runner): def ep(args=""): # basicConfig works better if handlers config is properly isolated logging.getLogger...
18,552
is valid episode
from logging import debug, info, warning, error, exception import re from datetime import datetime, timedelta from .. import AbstractServiceHandler from data.models import Episode, UnprocessedStream class ServiceHandler(AbstractServiceHandler): _show_url = "https://www.hidive.com/tv/{id}" _show_re = re.compil...
18,553
send request
# 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) AutoRest Code Generator. # Changes may ...
18,554
get filter names
# 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. # # This program is distributed in the hope that it will be useful # but...
18,555
cache
from collections import defaultdict from django.contrib import messages from django.template.loader import render_to_string from oscar.core.loading import get_class, get_model Applicator = get_class("offer.applicator", "Applicator") ConditionalOffer = get_model("offer", "ConditionalOffer") class BasketMessageGener...
18,556
lookup owner
# 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 # distributed under the Li...
18,557
set up
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import unittest from math import radians import torch from pytorch3d.renderer.camera_utils import camera_to_ey...
18,558
poll
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
18,559
slice into batches
""" Special views for administration. """ import collections import itertools import colander from kinto.authorization import RouteFactory from kinto.core import resource from kinto.core import utils as core_utils from kinto.core.events import ACTIONS, notify_resource_event from kinto.core.resource import viewset fr...
18,560
generate harmonics
#!/usr/bin/env python # -*- coding: utf-8 -*- # ############################################################################ # # MODULE: r.series.decompose # # AUTHOR(S): Dmitry Kolesov <kolesov.dm@gmail.com> # # PURPOSE: Perform decomposition of time series X : # X(t) = b0 + b1 *t + sin(2*...
18,561
execute
# -*- coding: utf-8 -*- try: from clickhouse.utils.github.cherrypick import CherryPick from clickhouse.utils.github.query import Query as RemoteRepo from clickhouse.utils.github.local import Repository as LocalRepo except: from .cherrypick import CherryPick from .query import Query as RemoteRepo ...
18,562
test delete
#!/usr/bin/env python # # 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...
18,563
is dim
""" pint.errors ~~~~~~~~~~~ Functions and classes related to unit definitions and conversions. :copyright: 2016 by Pint Authors, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import annotations from typing import Union import typing as ty from dat...
18,564
test gauge
# BSD 3-Clause License # # Copyright (c) 2021, Elasticsearch BV # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, t...
18,565
main
#!/usr/bin/env python3 """Script to create Github releases & generate release notes.""" import hashlib import json import logging import os import subprocess import sys import zipfile from third_party.python import colorlog, requests from third_party.python.absl import app, flags handler = colorlog.StreamHandler() h...
18,566
remove
# Copyright 2016 Battelle Energy Alliance, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
18,567
check for connection
#!/usr/bin/env python """ Fetches URL's from metadata and tests URL status in parallel using grequests library. Outputs status to 'url_database.csv' Arguments: fileinput - metadata file to be read ('od-do-canada.jsonl.gz') batch_size - maximum number of URL's to test in parallel """ import sys import grequests import ...
18,568
get aspects
import json import logging from datetime import datetime from typing import Dict, Iterable, Optional, Tuple from sqlalchemy import create_engine from datahub.emitter.aspect import ASPECT_MAP from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.emitter.serialization_helper import post_json_transf...
18,569
header parameters
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # # Code generated by aaz-dev-tools # --------------------------------...
18,570
get z values
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it a...
18,571
to numpy
"""Internal utilities.""" import inspect import sys import timeit from functools import wraps import matplotlib.pyplot as plt import numpy as np from matplotlib import animation from .external import apply from .. import backend as bkd from .. import config def timing(f): """Decorator for measuring the executio...
18,572
set up class
# SPDX-License-Identifier: LGPL-3.0-or-later import json import os import unittest import numpy as np from common import ( j_loader, run_dp, tests_path, ) from deepmd.env import ( GLOBAL_NP_FLOAT_PRECISION, tf, ) from deepmd.train.run_options import ( RunOptions, ) from deepmd.train.trainer im...
18,573
set up
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.template import Context, Template from django.test import TestCase from haystack.utils.highlighting import Highlighter class BorkHighlighter(Highlighter): def render_html(self, highlight_locations=None, start_off...
18,574
test error on missing dtypes
# 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...
18,575
test redis data info existing key
# -*- coding: utf-8 -*- # # Copyright (c) 2021, Andreas Botzner <andreas at botzner dot 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) ...
18,576
test sync meth
from concurrent.futures import Future from pathlib import Path import tempfile import pytest from asyncua.client import Client as AsyncClient from asyncua.client.ua_client import UaClient from asyncua.sync import ( Client, Server, ThreadLoop, SyncNode, call_method_full, XmlExporter, new_en...
18,577
get job
"""Supervisor job manager.""" from collections.abc import Callable from contextlib import contextmanager from contextvars import ContextVar, Token import logging from typing import Any from uuid import UUID, uuid4 from attrs import Attribute, define, field from attrs.setters import convert as attr_convert, frozen, val...
18,578
write records
from mage_integrations.utils.parsers import encode_complex from singer.messages import ( RecordMessage, SchemaMessage as SchemaMessageOriginal, StateMessage, ) from typing import List import simplejson import sys class SchemaMessage(SchemaMessageOriginal): def __init__( self, disable_c...
18,579
test select query
import time import os import shutil import tarfile import pytest import docker from mindsdb.integrations.handlers.mysql_handler.mysql_handler import MySQLHandler from mindsdb.api.mysql.mysql_proxy.libs.constants.response_type import RESPONSE_TYPE HANDLER_KWARGS = { "connection_data": { "host": "localhost...
18,580
sfm
import pytest import giskard.testing.tests.statistic as statistical from giskard.ml_worker.testing.registry.slicing_function import SlicingFunction @pytest.mark.parametrize( "data,model,label,threshold,expected_metric,actual_slices_size", [ ("german_credit_data", "german_credit_model", 0, 0.1, 0.20, ...
18,581
document sub resource
# Copyright 2015 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 # # https://aws.amazon.com/apache2.0/ # # or in the "license" file accomp...
18,582
encode delta
from __future__ import absolute_import from __future__ import division from __future__ import print_function import torch import numpy as np class AverageMeter(object): """Computes and stores the average and current value""" def __init__(self): self.reset() def reset(self): self.val = 0...
18,583
test l10n menu
from unittest.mock import Mock from django.conf import settings from django.utils import translation import pytest from olympia.addons.models import Addon from olympia.amo.tests import TestCase from olympia.amo.utils import from_string from olympia.translations.fields import save_signal from olympia.translations.mod...
18,584
get terminal size
import fcntl import os import pty import resource import signal import struct import sys import termios import time import tornado.ioloop from tornado.escape import to_unicode from tornado.ioloop import IOLoop from webtiles import util, config BUFSIZ = 2048 class TerminalRecorder(object): def __init__(self, ...
18,585
construct blueprint
from concurrent.futures import ThreadPoolExecutor from functools import wraps from flask import Blueprint from flask_login import login_required from changedetectionio.processors import text_json_diff from changedetectionio.store import ChangeDetectionStore STATUS_CHECKING = 0 STATUS_FAILED = 1 STATUS_OK = 2 THREA...
18,586
setup experiment
import functools import operator import os import os.path import sys import numpy as np # Bamboo utilities current_file = os.path.realpath(__file__) current_dir = os.path.dirname(current_file) sys.path.insert(0, os.path.join(os.path.dirname(current_dir), 'common_python')) import tools # ==============================...
18,587
show digi menu
import logging from netmiko import Netmiko class TermServ(object): def __init__(self, model, ip, cid, username=None, password=None, logger=None, desc=""): self.logger = logger or logging.getLogger() self.model = model.lower() self.ip = ip self.cid = cid s...
18,588
operate component
# Copyright 2021 4Paradigm # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, soft...
18,589
test lun input
import unittest import os import overrides_hack from utils import fake_path, TestTags, tag_test import gi gi.require_version('GLib', '2.0') gi.require_version('BlockDev', '3.0') from gi.repository import GLib, BlockDev @unittest.skipUnless(os.uname()[4].startswith('s390'), "s390x architecture required") class S390Te...
18,590
build optimizer
# Copyright (c) 2020 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 appli...
18,591
test signed response 1
#!/usr/bin/env python import os from saml2 import client from saml2 import config from saml2.authn_context import INTERNETPROTOCOLPASSWORD from saml2.saml import NAMEID_FORMAT_TRANSIENT from saml2.saml import NameID from saml2.samlp import response_from_string from saml2.server import Server import saml2.xmldsig as ds...
18,592
error
#!/usr/bin/env python2 # Copyright 2019-present Dell EMC # Copyright 2019-present Open Networking Foundation # SPDX-License-Identifier: Apache-2.0 # Translate names in tables and counters of the P4Info file to be # the same as the alias. Needed for NP4 Intel SDK. import argparse import logging import os import sys ...
18,593
ebal
# ___________________________________________________________________________ # # Pyomo: Python Optimization Modeling Objects # Copyright (c) 2008-2022 # National Technology and Engineering Solutions of Sandia, LLC # Under the terms of Contract DE-NA0003525 with National Technology and # Engineering Solutions of ...
18,594
init plugins
# 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 # distributed u...
18,595
pathify
# Copyright (c) 2019 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
18,596
prop descriptions
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Marker(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "histogram.unselected" _path_str = "histogram.unselected.marker" _valid_props = {"color", "op...
18,597
notify pushover
# Author: Marvin Pinto <me@marvinp.ca> # Author: Dennis Lutter <lad1337@gmail.com> import time import requests from sickchill import logger, settings from sickchill.oldbeard.classes import UIError from sickchill.oldbeard.common import ( NOTIFY_DOWNLOAD, NOTIFY_LOGIN, NOTIFY_LOGIN_TEXT, NOTIFY_SNATCH, ...
18,598
tester all types
from __future__ import annotations from typing import TYPE_CHECKING import pytest if TYPE_CHECKING: from cleo.testers.command_tester import CommandTester from poetry.config.source import Source from poetry.poetry import Poetry from tests.types import CommandTesterFactory @pytest.fixture def teste...
18,599
private link service connection 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 . im...