id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
14,800
ready
import sys import time from ...backend_api.utils import get_response_cls from .response import ResponseMeta, Response from .errors import ResultNotReadyError, TimeoutExpiredError class CallResult(object): @property def meta(self): return self.__meta @property def response(self): ret...
14,801
upgrade subsystem
#!/usr/bin/python # Authors: # Endi S. Dewata <edewata@redhat.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; version 2 of the License. # # This program is distributed in the hope tha...
14,802
suggested parameters
# # simple harmonic oscillator toy model. # # This file is part of PINTS (https://github.com/pints-team/pints/) which is # released under the BSD 3-clause license. See accompanying LICENSE.md for # copyright notice and full license details. # import numpy as np import pints from . import ToyModel class SimpleHarmoni...
14,803
get descendants
from __future__ import annotations import copy import os import typing from openfisca_core import commons, parameters, tools from . import config, helpers, AtInstantLike, Parameter, ParameterNodeAtInstant class ParameterNode(AtInstantLike): """ A node in the legislation `parameter tree <https://openfisca.or...
14,804
add single component
# 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 applic...
14,805
command test
#!/usr/bin/env python """ Commandline tool for doing operations on Problems """ import argparse import logging import sys from io import BytesIO from calc import UndefinedVariable from mako.lookup import TemplateLookup from path import Path as path from xmodule.capa.capa_problem import LoncapaProblem logging.basic...
14,806
resource guid
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities __all__ ...
14,807
persist registry to json
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import json from typing import List import sentry_sdk from dagster import MetadataValue, OpExecutionContext, Output, asset from dagster_gcp.gcs.file_manager import GCSFileHandle, GCSFileManager from google.cloud import storage from metadata_service.models.g...
14,808
backward
# 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 torch.nn as nn import torch import sys from fairseq import utils from fairseq.distributed import utils as distributed_utils from fairse...
14,809
compute logloss
#!/usr/bin/env python3 # 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. from typing import Any, cast, Dict, List, Optional, Type import torch from torchrec.met...
14,810
handle
import requests import ipaddress import logging import json from apps.greencheck.models import GreencheckIp, GreencheckASN from apps.accounts.models import Hostingprovider import pathlib from django.core.management.base import BaseCommand from django.conf import settings logger = logging.getLogger(__name__) class G...
14,811
get can parser
from cereal import car from openpilot.common.conversions import Conversions as CV from opendbc.can.can_define import CANDefine from opendbc.can.parser import CANParser from openpilot.selfdrive.car.interfaces import CarStateBase from openpilot.selfdrive.car.mazda.values import DBC, LKAS_LIMITS, GEN1 class CarState(CarS...
14,812
parse owners
from lxml import html from openpyxl import Workbook, load_workbook from typing import Optional, Dict, Any, List from urllib.parse import urljoin from zavod import Context, Entity IGNORE_COLUMNS = [ "Codul unităţii administrativ-teritoriale", "Genuri de activitate nelicentiate", "Genuri de activitate licen...
14,813
sniffer
import ptf.packet as scapy # noqa F401 import ptf.dataplane as dataplane # noqa F401 import acs_base_test from ptf.base_tests import BaseTest import scapy.all as scapy2 from time import sleep from threading import Thread class FailingTest(BaseTest): ''' Test designed to fail ''' def runTest(sel...
14,814
scan latest sth range
import logging import sqlite3 import time from ct.client.db import log_db from ct.client.db import database from ct.proto import client_pb2 class SQLiteLogDB(log_db.LogDB): def __init__(self, connection_manager): """Initialize the database and tables. Args: connection_manager: an SQLit...
14,815
debug
# Stubs for logbook.base (Python 3) # # NOTE: This dynamically typed stub was automatically generated by stubgen. from logbook._fallback import StackedObject from typing import Any, Optional def set_datetime_format(datetime_format: Any) -> None: ... CRITICAL: int ERROR: int WARNING: int NOTICE: int INFO: int DEBUG: ...
14,816
test to matrix
# Copyright (c) 2019 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. import unittest import numpy import math from UM.Math.Quaternion import Quaternion from UM.Math.Vector import Vector from UM.Math.Float import Float from UM.Math.Matrix import Matrix class TestQuaternion(unittest.TestC...
14,817
right single click
from collections import defaultdict from os.path import join as pjoin import numpy as np import numpy.testing as npt import pytest from fury import actor, interactor, ui from fury import utils as vtk_utils from fury import window from fury.data import DATA_DIR from fury.decorators import skip_osx, skip_win from fury....
14,818
test captured utf8 4byte offset0
from contextlib import redirect_stderr, redirect_stdout from io import StringIO from pybind11_tests import iostream as m def test_captured(capsys): msg = "I've been redirected to Python, I hope!" m.captured_output(msg) stdout, stderr = capsys.readouterr() assert stdout == msg assert stderr == "" ...
14,819
main
#!/usr/bin/env python3 # # Tool to manipulate QED image files # # Copyright (C) 2010 IBM, Corp. # # Authors: # Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> # # This work is licensed under the terms of the GNU GPL, version 2 or later. # See the COPYING file in the top-level directory. import sys import struct import ...
14,820
test functional characterization experiment upgrade 11 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...
14,821
member
# ----------------------------------------------------------------------------- # BSD 3-Clause License # # Copyright (c) 2020-2021, Science and Technology Facilities Council. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the fol...
14,822
var args
from collections import defaultdict from jedi.evaluate.utils import PushBackIterator from jedi.evaluate import analysis from jedi.evaluate.lazy_context import LazyKnownContext, \ LazyTreeContext, LazyUnknownContext from jedi.evaluate import docstrings from jedi.evaluate import pep0484 from jedi.evaluate.context im...
14,823
set password
""" Source: https://github.com/r4sas/PBinCLI/blob/master/pbincli/format.py """ import json import logging import ntpath import os import zlib from base64 import b64decode, b64encode from hashlib import sha256 from json import loads as json_decode from mimetypes import guess_type from base58 import b58decode, b58encode...
14,824
reset
# Copyright 2017 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,825
body context
import collections import itertools from contextlib import contextmanager from uuid import uuid4 from .code_element import CodeElement from .parameter import Parameter _FixtureSpec = collections.namedtuple('_FixtureSpec', ['alias_name', 'fixture', 'alias_with_attribute']) class Function(CodeElement): def __ini...
14,826
view dyn shapes setup parser
"""Functions for plotting the dynamic shapes dependency graph.""" import os import sys import networkx as nx from openmdao.core.problem import Problem from openmdao.utils.mpi import MPI from openmdao.utils.file_utils import _load_and_exec import openmdao.utils.hooks as hooks from openmdao.utils.general_utils import c...
14,827
insert
## @file # This file is used to create/update/query/erase table for fdf datas # # Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # from __future__ import absolute_import import Common.EdkLogger as EdkLogger import CommonDataCl...
14,828
test compile namespace
#!/usr/bin/python3 import sys from pathlib import Path import pytest from brownie.exceptions import ProjectAlreadyLoaded, ProjectNotFound from brownie.project.main import Project, TempProject, _ProjectBase def test_object(newproject): assert type(newproject) is Project assert isinstance(newproject, _Projec...
14,829
revoke envelope key records by created and
#!/usr/bin/env python3 # Until this gets put into a proper deployment model, setup to run this is: # # python3 -m virtualenv venv # source venv/bin/activate # pip install boto3 import argparse import boto3 import json import logging import os import time from boto3.dynamodb.conditions import Key, Attr logger = loggi...
14,830
test channels in slot two
import itertools import pytest from qcodes.instrument_drivers.tektronix.Keithley_3706A import Keithley_3706A @pytest.fixture(scope="function", name="driver") def _make_driver(): driver = Keithley_3706A( "Keithley_3706A", address="GPIB::11::INSTR", pyvisa_sim_file="Keithley_3706A.yaml", ...
14,831
test pareto
# Test all distributions available in UQpy, using the cdf method or pdf method for multivariate distributions from UQpy.distributions import * import numpy as np def test_beta(): result = Beta(a=1., b=2.).cdf(x=0.8) assert result == 0.96 def test_cauchy(): assert np.round(Cauchy().cdf(x=0.8), 3) == 0.7...
14,832
test bugs fails on network error
from unittest.mock import patch import grpc import pytest from couchers.config import config from proto import bugs_pb2 from tests.test_fixtures import bugs_session, db, generate_user, testconfig # noqa @pytest.fixture(autouse=True) def _(testconfig): pass def test_bugs_disabled(): with bugs_session() as...
14,833
get broadcast logs
import json from datetime import datetime from typing import Text, Dict from loguru import logger from bson import ObjectId from mongoengine import DoesNotExist from kairon import Utility from kairon.exceptions import AppException from kairon.shared.chat.data_objects import Channels from kairon.shared.chat.notificatio...
14,834
tags
# 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,835
filter fire code
# Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html """ Code for generating hooks. """ import os import subprocess import sys from dataclasses import dataclass from operator import attrgetter from typing import Optional sys.path.append("pylib...
14,836
train
import argparse import torch import torch.nn as nn import torch.nn.functional as F import torchmetrics.functional as MF import tqdm from dgl.data import AsNodePredDataset from dgl.dataloading import ( DataLoader, MultiLayerFullNeighborSampler, NeighborSampler, ) from dgl.nn import CuGraphSAGEConv from ogb....
14,837
login
# -*- coding: utf-8 -*- # Copyright 2021-2022 Mike Fährmann # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. """Extractors for https://www.pillowfort.social/""" from .common import...
14,838
kind
# 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,839
test executors with missing args
import pytest from faraday.server.models import Agent, Executor from faraday.server.websocket_factories import WorkspaceServerFactory, \ update_executors, BroadcastServerProtocol from tests.factories import AgentFactory, ExecutorFactory class TransportMock: def write(self, data: bytearray): pass @p...
14,840
reset
# Copyright 2021 Xilinx Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
14,841
start
import hashlib import logging import os import salt.auth from salt.utils.versions import Version __virtualname__ = os.path.abspath(__file__).rsplit(os.sep)[-2] or "rest_tornado" log = logging.getLogger(__virtualname__) # we require at least 4.0, as that includes all the Future's stuff we use min_tornado_version = "...
14,842
visitcompound
from typing import TYPE_CHECKING from bashlex import ast # type: ignore from subprocess import check_output from lib.pretty_printer import PrettyPrinter import sys import re # see https://github.com/idank/bashlex/blob/815653c7208a578735e18558069443cb5f67a9a2/bashlex/ast.py # for original visitor implementation # also ...
14,843
test set kernel status
# -*- coding: utf-8 -*- # # test_status.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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...
14,844
get rank
# Copyright (c) 2019 NVIDIA CORPORATION. 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...
14,845
boundary node flag
import numpy as np import torch from torch import Tensor from .mesh_ds import MeshDataStructure, Redirector class Mesh2dDataStructure(MeshDataStructure): """ @brief The topology data structure of 2-d mesh.\ This is an abstract class and can not be used directly. """ #Variables face: R...
14,846
test position y dimension
import sys from psychopy.alerts import alerttools from psychopy.alerts._errorHandler import _BaseErrorHandler from psychopy.experiment import getAllComponents, Experiment class TestAlertTools(): """A class for testing the alerttools module""" def setup_method(self): # Set ErrorHandler self.er...
14,847
make hand
#runas solve() #unittest.skip type can't be deducte #pythran export solve() def solve(): ''' In the card game poker, a hand consists of five cards and are ranked, from lowest to highest, in the following way: High Card: Highest value card. One Pair: Two cards of the same value. Two Pairs: Two d...
14,848
geo twigs
# Copyright (c) Princeton University. # This source code is licensed under the BSD 3-Clause license found in the LICENSE file in the root directory of this source tree. # Authors: Lingjie Mei import bpy import numpy as np from numpy.random import uniform from assets.trees.tree import TreeVertices, build_radius_tree...
14,849
test get owner
import responses from bugwarrior.services.bitbucket import BitbucketService from .base import ServiceTest, AbstractServiceTest class TestBitbucketIssue(AbstractServiceTest, ServiceTest): SERVICE_CONFIG = { 'service': 'bitbucket', 'username': 'somename', 'key': 'something', 'secre...
14,850
test identify c f coordhybrid
# -*- coding: utf-8 -*- """ tests._test_utils.test_netCDF4tools ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides pytest functions to tests mslib.netCDF4tools This file is part of MSS. :copyright: Copyright 2016-2017 Reimar Bauer :copyright: Copyright 2016-2023 by the MSS team, see AU...
14,851
test mnemonic generate error
# -*- coding: utf-8 -*- # # BitcoinLib - Python Cryptocurrency Library # Unit Tests for Key, Encoding and Mnemonic Class # © 2016 - 2019 December - 1200 Web Development <http://1200wd.com/> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero Gen...
14,852
data frame demo
import streamlit as st def intro(): import streamlit as st st.write("# Welcome to Streamlit! 👋") st.sidebar.success("Select a demo above.") st.markdown( """ Streamlit is an open-source app framework built specifically for Machine Learning and Data Science projects. ...
14,853
set up class
import difflib import glob import os from os.path import dirname as UP import sys from unittest import TestCase import tarfile import matplotlib.pyplot as plt from mtpy.core.edi_collection import EdiCollection from mtpy.modeling.modem import Data # patch that changes the matplotlib behaviour from tests import make_te...
14,854
test read bytes
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
14,855
oetf b t1361
""" Recommendation ITU-R BT.1361 ============================ Defines the *Recommendation ITU-R BT.1361* opto-electrical transfer function (OETF) and its inverse: - :func:`colour.models.oetf_BT1361` - :func:`colour.models.oetf_inverse_BT1361` References ---------- - :cite:`InternationalTelecommunicationUnion19...
14,856
find project root
import asyncio import functools import logging import sys import warnings from functools import partial from pathlib import Path from types import TracebackType from typing import ( Any, AsyncContextManager, AsyncIterator, Awaitable, Callable, Coroutine, Generator, Generic, Iterator,...
14,857
imap ut f7 encode sequence
# -*- coding: iso-8859-1 -*- """ Imap folder names are encoded using a special version of utf-7 as defined in RFC 2060 section 5.1.3. 5.1.3. Mailbox International Naming Convention By convention, international mailbox names are specified using a modified version of the UTF-7 encoding described in [UTF-7]. Th...
14,858
service id
# Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS from __future__ import annotations from typing import Any from parsec._parsec_pyi.crypto import ( PublicKey, SequesterPublicKeyDer, SequesterVerifyKeyDer, SigningKey, VerifyKey, ) from parsec._parsec_pyi.enumerat...
14,859
fix dll
# -*- coding: utf-8 -*- import os import shutil import sys from pathlib import Path from typing import Generator, List, Optional from macholib.MachO import MachO # Source: https://github.com/pyinstaller/pyinstaller/wiki/Recipe-OSX-Code-Signing-Qt def create_symlink(folder: Path) -> None: """Create the appropriat...
14,860
matcher func
import re import pytest import schemathesis from schemathesis import filters from schemathesis.exceptions import UsageError from schemathesis.models import APIOperation RAW_SCHEMA = { "openapi": "3.0.2", "info": {"title": "Test", "description": "Test", "version": "0.1.0"}, "paths": { "/users/": {...
14,861
delayed init
from __future__ import annotations import asyncio from typing import List, TYPE_CHECKING from scrypted_sdk.types import Device, DeviceProvider, Setting, Settings, SettingValue, SecuritySystem, SecuritySystemMode, Readme, ScryptedInterface, ScryptedDeviceType from .base import ArloDeviceBase from .siren import ArloSi...
14,862
test propagation of failure from test execution
""" Tests for threaded_test_wrapper.py """ from __future__ import print_function import sys import threading import time import unittest from unittest import mock import pika.compat from tests.wrappers import threaded_test_wrapper from tests.wrappers.threaded_test_wrapper import (_ThreadedTestWrapper, run_in_thread...
14,863
on 200
# -------------------------------------------------------------------------------------------- # 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,864
javascript tag compressed
import os from fnmatch import fnmatch import yaml from django.conf import settings DATA_URI_START = "<!--[if (!IE)|(gte IE 8)]><!-->" DATA_URI_END = "<!--<![endif]-->" MHTML_START = "<!--[if lte IE 7]>" MHTML_END = "<![endif]-->" class JammitAssets: ASSET_FILENAME = 'assets.yml' def __init__(self, asset...
14,865
size
# (C) Copyright 2004-2023 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only under # the conditions described in the aforementioned license. The license # is also available online at...
14,866
version as array
#!/usr/bin/env python3 import sys import h5py import numpy as np import argparse # Converts variational parameter files from HDF to text and back. # The suffix of the input determines the conversion direction # Sample text format #version 1.0.0 #timestamp 2021-12-02 10:48:05 CST< #jud_0 0.72053 # Format for complex ...
14,867
run
import re import markdown from markdown.extensions.attr_list import AttrListExtension from markdown.extensions.fenced_code import FencedBlockPreprocessor from markdown.extensions.codehilite import CodeHilite, CodeHiliteExtension from markdown.serializers import _escape_attrib_html class CodeBlockExtension(markdown.E...
14,868
test get configuration sock
''' copyright: Copyright (C) 2015-2022, Wazuh Inc. Created by Wazuh, Inc. <info@wazuh.com>. This program is free software; you can redistribute it and/or modify it under the terms of GPLv2 type: integration brief: The 'wazuh-logtest' tool allows the testing and verification of rules and decode...
14,869
build model
""" Title: Timeseries classification with a Transformer model Author: [Theodoros Ntakouris](https://github.com/ntakouris) Date created: 2021/06/25 Last modified: 2021/08/05 Description: This notebook demonstrates how to do timeseries classification using a Transformer model. Accelerator: GPU """ """ ## Introduction ...
14,870
get session override
from contextlib import contextmanager import json from pathlib import Path from typing import AsyncGenerator, TYPE_CHECKING from langflow.api.v1.flows import get_session from langflow.graph.graph.base import Graph from langflow.services.auth.utils import get_password_hash from langflow.services.database.models.flow.fl...
14,871
records equal
import asyncio import copy import random import re from typing import Dict, List, Optional, Tuple import backoff import kinto_http import requests from kinto_http.session import USER_AGENT as KINTO_USER_AGENT from telescope import config, utils USER_AGENT = f"telescope {KINTO_USER_AGENT}" retry_timeout = backoff....
14,872
looks like require version
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html # For details: https://github.com/pylint-dev/astroid/blob/main/LICENSE # Copyright (c) https://github.com/pylint-dev/astroid/blob/main/CONTRIBUTORS.txt """Astroid hooks for the Python 2 GObject introspection bindings. Helps with und...
14,873
standardize outputs
import json import os import click DOCS_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), "source") def _get_python_version(notebook): with open(notebook, "r") as f: source = json.load(f) version = source["metadata"]["language_info"]["version"] return version def _standardize...
14,874
che m 1832
""" https://github.com/csesoc/Circles/wiki/Manual-Fixes-to-Course-Prerequisites Apply manual [code] fixes to processed conditions in conditionsProcessed.json so that they can be fed into algorithms. If you make a mistake and need to regenerate conditionsProcessed.json, then you can run: python3 -m data.processors...
14,875
label validator
#!/usr/bin/env python ## Program: VMTK ## Module: $RCSfile: vmtkcenterlinelabeler.py,v $ ## Language: Python ## Date: $Date: 2006/05/26 12:34:45 $ ## Version: $Revision: 1.2 $ ## Copyright (c) Luca Antiga, David Steinman. All rights reserved. ## See LICENSE file for details. ## This software is...
14,876
compare hashes
# stdlib from typing import Any from typing import Callable from typing import List from typing import Union # third party import numpy as np import pandas as pd # relative from ..response import SyftError from ..response import SyftResponseMessage from ..response import SyftSuccess from .action_object import ActionO...
14,877
test multi proc dataset exception at init
""" tests for MultiProcDataset """ from __future__ import annotations import _setup_test_env # noqa import sys import numpy import signal import contextlib import unittest from returnn.util import better_exchook from returnn.datasets.basic import init_dataset from returnn.datasets.multi_proc import MultiProcDataset f...
14,878
test accept tool
import os import cherrypy from cherrypy import tools from cherrypy.test import helper localDir = os.path.dirname(__file__) logfile = os.path.join(localDir, 'test_misc_tools.log') def setup_server(): class Root: @cherrypy.expose def index(self): yield 'Hello, world' h = [('C...
14,879
feature importance
"""Vowpal Wabbit Classifiers.""" from abc import abstractmethod from skopt.space import Integer, Real from evalml.model_family import ModelFamily from evalml.pipelines.components.estimators import Estimator from evalml.problem_types import ProblemTypes from evalml.utils.gen_utils import import_or_raise class Vowpal...
14,880
setup classifier op for batch
############################################################################### # ilastik: interactive learning and segmentation toolkit # # Copyright (C) 2011-2021, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/or # mod...
14,881
test to knx invert
"""Unit test for RemoteValueSwitch objects.""" import pytest from xknx import XKNX from xknx.dpt import DPTArray, DPTBinary from xknx.exceptions import ConversionError from xknx.remote_value import RemoteValueSwitch from xknx.telegram import GroupAddress, Telegram from xknx.telegram.apci import GroupValueWrite class...
14,882
test
import logging import numpy as np import torch import wandb from sklearn.metrics import roc_auc_score, precision_recall_curve, auc from fedml.core import ClientTrainer # Trainer for MoleculeNet. The evaluation metric is ROC-AUC class GcnMoleculeNetTrainer(ClientTrainer): def get_model_params(self): re...
14,883
test raise exception
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
14,884
set prod state
""" Module for working with the Zenoss API .. versionadded:: 2016.3.0 :configuration: This module requires a 'zenoss' entry in the master/minion config. For example: .. code-block:: yaml zenoss: hostname: https://zenoss.example.com username: admin password: admin123 ...
14,885
test pbc
from numpy import array, concatenate, unique from numpy.testing import assert_array_equal, assert_equal from prody.tests import unittest from prody.tests.datafiles import parseDatafile, pathDatafile from prody.measure import Contacts, findNeighbors, iterNeighbors from prody.measure import buildDistMatrix, calcDistanc...
14,886
transform
import torch from torch.nn import LayerNorm from atorch.auto.auto_accelerate_context import AutoAccelerateContext from atorch.auto.opt_lib.optimization import Optimization from atorch.distributed.distributed import local_rank from atorch.modules.distributed_modules.materialize_modules import materialize_modules_to_dev...
14,887
set gauge value
#!/usr/bin/env python """Default implementation for a stats-collector.""" import abc from grr_response_core.lib import utils from grr_response_core.lib.rdfvalues import stats as rdf_stats from grr_response_core.stats import stats_collector from grr_response_core.stats import stats_utils def _FieldsToKey(fields): ...
14,888
convert pairwise example
# Copyright (c) 2021 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...
14,889
init roles
from dataclasses import dataclass from typing import List, Tuple import stp.rc as rc import stp.tactic as tactic import stp.role as role from rj_gameplay.skill import capture, pivot_kick, line_kick import stp.skill as skill import numpy as np from math import atan2 from rj_gameplay.role import striker import stp from...
14,890
get config
from __future__ import annotations from abc import ABC, abstractmethod from typing import Any, Dict, Optional, AsyncIterator, List, Callable, Awaitable from attrs import define from jsons import set_deserializer, set_serializer from resotocore.ids import ConfigId from resotocore.model.model import Model, Kind from r...
14,891
handler
# -------------------------------------------------------------------------------------------- # 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,892
on request
# ------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ------------------------------------------------------------------------- import hash...
14,893
available patterns
# Copyright © 2022 BAAI. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License") from flagai.trainer import Trainer from flagai.model.glm_model import GLMForSequenceClassification from flagai.model.glm_model import GLMForSingleTokenCloze from flagai.data.tokenizer import Tokenizer from ...
14,894
train
from __future__ import print_function import argparse import sys import time import torch sys.path.append("../../") import heat as ht import heat.nn.functional as F import heat.optim as optim from heat.optim.lr_scheduler import StepLR from heat.utils import vision_transforms from heat.utils.data.mnist import MNISTData...
14,895
handler
# -------------------------------------------------------------------------------------------- # 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,896
test compute
import os import numpy as np import pytest import torch import ignite.distributed as idist from ignite.exceptions import NotComputableError from ignite.metrics import RootMeanSquaredError def test_zero_sample(): rmse = RootMeanSquaredError() with pytest.raises( NotComputableError, match=r"MeanSquare...
14,897
split
import datetime import functools import numbers import time import collections.abc import contextlib import jaraco.functools class Stopwatch: """ A simple stopwatch which starts automatically. >>> w = Stopwatch() >>> _1_sec = datetime.timedelta(seconds=1) >>> w.split() < _1_sec True >>> ...
14,898
cmd mv
# Copyright (c) 2020 Kiel University and others. # This program and the accompanying materials are made available under the # terms of the Eclipse Public License 2.0 which is available at # http://www.eclipse.org/legal/epl-2.0. # # SPDX-License-Identifier: EPL-2.0 """Helper script to manage our downloads area. This s...
14,899
compute joint offset
#!/usr/bin/env python3 # This software may be modified and distributed under the terms of the # BSD-3-Clause license. # Authors: Giulio Romualdi import argparse from lxml import etree import re import math import numpy as np import os import bipedal_locomotion_framework.bindings as blf def print_info(msg): pri...