id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
4,500
test validate input value real real
#!/usr/bin/env python """Perform unit-test on functions user for insert cli.""" import numbers import pytest from orion.core.cli.insert import _validate_input_value from orion.core.io.space_builder import SpaceBuilder @pytest.fixture() def real_space(): """Fixture for real space""" return SpaceBuilder().bui...
4,501
test get queue
import os import time import uuid import grpc import pytest from armada_client.client import ArmadaClient from armada_client.k8s.io.api.core.v1 import generated_pb2 as core_v1 from armada_client.k8s.io.apimachinery.pkg.api.resource import ( generated_pb2 as api_resource, ) from armada_client.typings import JobStat...
4,502
test optimizer
""" Copyright 2020 The OneFlow Authors. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
4,503
test fill last interval
#!/usr/bin/env python3 ############################################################################### # # Copyright 2016 - 2021, Thomas Lauf, Paul Beckingham, Federico Hernandez. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the...
4,504
update doc strings
# ___________________________________________________________________________ # # 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 ...
4,505
test delete user member
# This file is part of wger Workout Manager. # # wger Workout Manager is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # wger W...
4,506
is delta set
from time import time import pytz from _datetime import datetime, timedelta from typing import Optional, Tuple from pydantic import BaseModel from enum import Enum from tracardi.service.time import parse_date, parse_date_delta class DatetimeType(str, Enum): second = 'second' minute = 'minute' hour = 'h...
4,507
fire and forget task
""" General utils IMPORTANT: lowest level module I order to avoid cyclic dependences, please DO NOT IMPORT ANYTHING from . """ import asyncio import logging import os from collections.abc import Awaitable, Coroutine, Iterable from pathlib import Path from typing import Any, Generator import toolz from pydantic ...
4,508
isfilestore
# Copyright 1999-2021 Alibaba Group Holding Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
4,509
entropy hierarchical
import matplotlib.cm import matplotlib.gridspec import matplotlib.pyplot as plt import numpy as np import pandas as pd from .entropy_sample import entropy_sample from .optim_complexity_tolerance import complexity_tolerance def METHOD_NAME( signal, scale="default", dimension=2, tolerance="sd", show=False, **kwarg...
4,510
time elapsed
# Copyright The Lightning AI 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/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
4,511
id
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from ... import _utilities from . im...
4,512
value
# coding=utf-8 # *** WARNING: this file was generated by pulumigen. *** # *** 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 ....
4,513
deps
#!/usr/bin/env python3 """ Script for initializing tests for queries related to glam-fenix-dev. This only needs to be run once for the initial testing. """ import json import shutil import warnings from collections import namedtuple from multiprocessing import Pool from pathlib import Path import click import yaml fr...
4,514
test balance after tx
import os import eth_utils import rlp import sys sys.path.append("..") from conflux.rpc import RpcClient from test_framework.util import assert_equal, assert_raises_rpc_error, assert_greater_than, test_rpc_call_with_block_object class TestGetBalance(RpcClient): def test_genesis_account_balance(self): addr...
4,515
multi cursor select all occurrences
# vs title tracking requires an extension # https://marketplace.visualstudio.com/items?itemName=mayerwin.RenameVisualStudioWindowTitle # https://github.com/mayerwin/vs-customize-window-title (VS 2022 support in releases) # I currently configure the extension as below # Document (no solution) open: [documentName] - [ide...
4,516
transport main
@coroutine def main(reactor, session): # the session is joined and ready result = yield session.call('com.example.add2', 2, 3) print('result={}'.format(result)) # as we exit, this signals we are done with the session! the session # can be recycled if __name__ == '__main__': client = Client(main...
4,517
fetch user badges
from typing import Optional from discord.ext import commands from common.models.db.item import Item from common.models.db.user import User from bot.cogs.core.database import Database from bot.utils.misc import calc_total_wealth from bot.villager_bot import VillagerBotCluster class Badges(commands.Cog): def __i...
4,518
set up class
import dns import os import subprocess import time from authtests import AuthTest from xfrserver.xfrserver import AXFRServer zones = { 1: [""" $ORIGIN example.""",""" @ 86400 SOA foo bar 1 2 3 4 5 @ 4242 NS ns1.example. @ 4242 NS ns2.example. ns1.example. 4242 A ...
4,519
num cells
#!/usr/bin/env python3 import arbor import pandas import seaborn import matplotlib.pyplot as plt # Construct chains of cells linked with gap junctions, # Chains are connected by synapses. # An event generator is attached to the first cell in the network. # # c --gj-- c --gj-- c --gj-- c --gj-- c # ...
4,520
harmonize countries
""" This code generates the garden step with the MPI dataset for both harmonized over time and current margin estimates for the variables MPI, share of MPI poor and intensity of poverty. """ import pandas as pd from owid.catalog import Dataset, Table from structlog import get_logger from etl.data_helpers import geo f...
4,521
save
# ----------------------------------------------------------------------------- # Getting Things GNOME! - a personal organizer for the GNOME desktop # Copyright (c) 2008-2015 - Lionel Dricot & Bertrand Rousseau # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Gene...
4,522
close
# 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 ...
4,523
forward
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import json import logging import os import random from collections import namedtuple import numpy as np import torch import torch.distributed as dist import torch.nn as nn from genotypes import Genotype from ops import PRIMITIVES from nni.algo...
4,524
validate private key
# Copyright 2021 Collate # 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...
4,525
xendir
import struct class XSVFParser(object): def __init__(self): self._handlers = { 0x00: self.XCOMPLETE , 0x01: self.XTDOMASK , 0x02: self.XSIR , 0x03: self.XSDR , 0x04: self.XRUNTEST , 0x07: self.XREPEAT , 0x08: self.XSDRSIZE , 0x09: self.XSDRTDO , 0x0a: sel...
4,526
test touch
import os from pathlib import Path from tempfile import TemporaryDirectory import types import unittest from unittest import mock from pythonforandroid import util class TestUtil(unittest.TestCase): """ An inherited class of `unittest.TestCase`to test the module :mod:`~pythonforandroid.util`. """ ...
4,527
debugger goto clipboard
# XXX - execute until line number/cursor # XXX - more memory printing he thumping from talon import Context, Module mod = Module() mod.tag("debugger", desc="Tag for enabling generic debugger commands") ctx = Context() ctx.matches = r""" tag: debugger """ x86_registers = { "air": "eax", "bat": "ebx", "ca...
4,528
need segmentation
import typing from os.path import basename, dirname, isdir, isfile from pathlib import Path from qtpy.QtWidgets import QFileDialog from PartSegCore.io_utils import LoadBase if typing.TYPE_CHECKING: # pragma: no cover from PartSeg.common_backend.base_settings import BaseSettings class LoadProperty(typing.Named...
4,529
plot windows
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Plot area ========= A custom QMdiArea where to add custom PlotWindows """ import numpy as np from silx.utils.weakref import WeakList from silx.gui import qt from .plot1D import Plot1D from .plot2D import Plot2D class MdiSubWindow(qt.QMdiSubWindow): def __init__...
4,530
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 # --------------------------------...
4,531
fixe d to numpy int64
#!/usr/bin/env python # # Copyright (c) 2012-2023 Snowflake Computing Inc. All rights reserved. # from __future__ import annotations import decimal import time from datetime import datetime, timedelta, tzinfo from logging import getLogger from typing import TYPE_CHECKING import pytz from pytz import UTC from .const...
4,532
test create
# ----------------------------------------------------------------------------- # BSD 3-Clause License # # Copyright (c) 2022-2023, 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 foll...
4,533
process path token
#! /usr/bin/env python import argparse import re import sys import yaml RE_TILDE = re.compile('~0') RE_SLASH = re.compile('~1') parser = argparse.ArgumentParser() parser.add_argument('orig_file', help='file to apply patch to') parser.add_argument('patch_file', help='patch to apply') parser.add_argument('-i', ...
4,534
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 . im...
4,535
sync marker
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- """Read/W...
4,536
test check existing external data
import json import pytest from asyncpg.connection import Connection from gql.client import AsyncClientSession from cdb.api.db.crud.external_data import ( get_all_external_datas_by_beneficiary_id_and_source, get_last_external_data_by_beneficiary_id_and_source, save_external_data_with_info, ) from cdb.api.d...
4,537
configure parser
"""Base provider module for all Lexicon providers""" from abc import ABC, abstractmethod from argparse import ArgumentParser from re import Pattern from typing import Any, Dict, List, Optional, Union from lexicon.config import ConfigResolver, legacy_config_resolver class Provider(ABC): """ This is the abstra...
4,538
can be accepted
import rules from django.db.models import Q from pretalx.person.permissions import can_change_submissions, is_reviewer from pretalx.submission.models import SubmissionStates @rules.predicate def has_submissions(user, obj): event = obj.event return event.submissions.filter(speakers__in=[user]).exists() @rul...
4,539
run
""" Copyright (c) 2020-2023 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 i...
4,540
tear down
import logging from unittest import mock from unittest.mock import MagicMock from django.test import TestCase from django.utils import timezone from eth_account import Account from gnosis.eth.ethereum_client import ( EthereumClient, EthereumClientProvider, EthereumNetwork, ) from ...history.tests.utils ...
4,541
compute load
# -*- coding: utf-8 -*- # from itertools import groupby from common.utils import get_logger from terminal.const import ComponentLoad logger = get_logger(__name__) class ComputeLoadUtil: # system status @staticmethod def _common_compute_system_status(value, thresholds): if thresholds[0] <= value ...
4,542
parse avi params
# Copyright 2021 VMware, Inc. # SPDX-License-Identifier: Apache License 2.0 #!/usr/bin/python import sys, os, json, traceback, re, time from avi.sdk.avi_api import ApiSession from oauth2client.client import GoogleCredentials from googleapiclient import discovery ''' This ControlScript is executed on the Avi Control...
4,543
test01 create
import pytest import drjit as dr import mitsuba as mi def METHOD_NAME(variant_scalar_rgb): s = mi.load_dict({"type" : "cube"}) assert s is not None assert s.primitive_count() == 12 assert dr.allclose(s.surface_area(), 24.0) def test02_bbox(variant_scalar_rgb): for r in [1, 2, 4]: s = mi....
4,544
check timestamps
#!/usr/bin/env python3 import h5py import numpy as np import pandas as pd from pprint import pprint from tqdm import tqdm tqdm.pandas() import matplotlib.pyplot as plt plt.style.use('../../pygama/clint.mpl') from pygama import DataGroup import pygama.io.lh5 as lh5 def main(): """ sandbox code for exploring...
4,545
get employee from user
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from collections import Counter import frappe from frappe import _ from frappe.desk.form.assign_to import add as add_assignment from frappe.model.document import Document from frappe.share import ad...
4,546
test full cec2 pipeline
"""Regression Tests for CEC2""" # pylint: disable=too-many-locals invalid-name from __future__ import annotations from typing import Final import numpy as np from cpuinfo import get_cpu_info from omegaconf import OmegaConf from scipy.io import wavfile from clarity.data.scene_renderer_cec2 import SceneRenderer from c...
4,547
icon
""" iconfont provides a barebones system to get QIcons from icon fonts (like Font Awesome). The inspiration and methodology come from the 'QtAwesome' module, which does exactly this, but is a little too big, complicated, and flexible for PyDM's needs. """ import json import os import sys from typing import Optional fr...
4,548
cond
# 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...
4,549
set up
#!/usr/bin/env python3 # group: rw # # Test streaming with throttle nodes on top # # Copyright (C) 2022 Red Hat, 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 2 of the Li...
4,550
test timesteps
import torch from diffusers import LMSDiscreteScheduler from diffusers.utils.testing_utils import torch_device from .test_schedulers import SchedulerCommonTest class LMSDiscreteSchedulerTest(SchedulerCommonTest): scheduler_classes = (LMSDiscreteScheduler,) num_inference_steps = 10 def get_scheduler_con...
4,551
pre export optional cube region
# This file is part of Korman. # # Korman 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. # # Korman is distributed i...
4,552
rand jac
""" A tool to make it easier to investigate coloring of jacobians with different sparsity structures. """ import sys import numpy as np from openmdao.utils.general_utils import printoptions from openmdao.utils.coloring import _compute_coloring class TotJacBuilder(object): def __init__(self, rows, cols): ...
4,553
wrap
# Copyright (C) 2000-2014 Bastian Kleineidam # # 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. # # This program is distr...
4,554
make screenshot
""" Copyright 2008-2011,2015 Free Software Foundation, Inc. This file is part of GNU Radio SPDX-License-Identifier: GPL-2.0-or-later """ from sys import platform import os import numbers from gi.repository import GLib import cairo from .canvas.colors import FLOWGRAPH_BACKGROUND_COLOR from . import Constants def...
4,555
test ultradns wait for dns change
import unittest from unittest.mock import patch, Mock from flask import Flask from lemur.plugins.lemur_acme import plugin, ultradns from requests.models import Response class TestUltradns(unittest.TestCase): @patch("lemur.plugins.lemur_acme.plugin.dns_provider_service") def setUp(self, mock_dns_provider_serv...
4,556
status
''' System ====== The following methods allow for interaction into the Tenable Security Center :sc-api:`System <System.htm>` API. These API calls are typically used to understand timezones, system version, etc. Methods available on ``sc.system``: .. rst-class:: hide-signature .. autoclass:: SystemAPI :members: ...
4,557
query user
""" Support for RallyDev .. versionadded:: 2015.8.0 Requires a ``username`` and a ``password`` in ``/etc/salt/minion``: .. code-block:: yaml rallydev: username: myuser@example.com password: 123pass """ import logging import salt.utils.http import salt.utils.json from salt.exceptions import SaltIn...
4,558
path
from io import BytesIO from urllib.parse import urlencode from sentry.models import EventAttachment, File from sentry.testutils.cases import APITestCase from sentry.testutils.silo import region_silo_test @region_silo_test(stable=True) class GroupEventAttachmentsTest(APITestCase): def create_attachment(self, type...
4,559
get completed step
# Copyright 2022 The DLRover Authors. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
4,560
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 # --------------------------------...
4,561
init metrics
from json import JSONDecodeError from requests.exceptions import ConnectionError, HTTPError, InvalidURL, Timeout from datadog_checks.base import AgentCheck class SonarrCheck(AgentCheck): # This will be the prefix of every metric and service check the integration sends __NAMESPACE__ = "sonarr" def __ini...
4,562
smalltalk rule0
# Leo colorizer control file for smalltalk mode. # This file is in the public domain. # Properties for smalltalk mode. properties = { "commentEnd": "\"", "commentStart": "\"", "indentCloseBrackets": "]", "indentOpenBrackets": "[", "lineUpClosingBracket": "true", } # Attributes dict for smalltalk_m...
4,563
run reindex
# # Copyright 2017-2018 Government of Canada # Public Services and Procurement Canada - buyandsell.gc.ca # # 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/LIC...
4,564
test model from pretrained
# Copyright 2020 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...
4,565
get wireframe
#! /usr/bin/env python # # example_wireframe.py -- Example of a 3D plot with octahedron and wireframe # """ Example of 3D plotting in Ginga Plots an octahedron within a wireframe sphere. Run with no parameters. Scroll to zoom in/out, click and drag to orbit. Requirements: Qt5, OpenGL, numpy """ import sys import ...
4,566
test connect execution specification to lifeline
from gaphas.canvas import instant_cairo_context from gaphas.item import Item from gaphor import UML from gaphor.core.modeling import DrawContext from gaphor.core.modeling.diagram import FALLBACK_STYLE from gaphor.diagram.tests.fixtures import allow, connect, disconnect from gaphor.UML.interactions.executionspecificati...
4,567
build shapes
''' Creates an svg-file with spawning regions of a species colored depending on the rarity. ''' from typing import List from ..common import SVGBoundaries from .consts import POINT_RADIUS from .intermediate_types import SpawnPoint, SpawnRectangle from .species import get_rarity_for_spawn # These CSS class names are ...
4,568
test start session when non custom start
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You # may not use this file except in compliance with the License. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
4,569
list app service plan hybrid connection keys
# 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__ ...
4,570
test invalid send analytic dxo
# Copyright (c) 2022, 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 appli...
4,571
get next
# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRe...
4,572
test wait until event check false
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
4,573
compute ik length height
# 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: Alexander Raistrick import logging import bpy import bpy_types import mathutils import numpy as np from numpy.random import uniform as ...
4,574
audio pipeline
#!/usr/bin/env/python3 """This minimal example trains an autoencoder over speech features. The encoder is a MLP that transforms the input into a lower-dimensional latent representation. The decoder is another MLP that predicts the input features. The system is trained with MSE. Given the tiny dataset, the expected beha...
4,575
get setup pipeline
import abc import logging from collections import namedtuple from typing import Any, Mapping, Sequence from django.utils.encoding import force_str from django.views import View from sentry.models import AuthIdentity, User from sentry.pipeline import PipelineProvider from .view import AuthView, ConfigureView class ...
4,576
wait for master
import abc from typing import Any, Dict, Iterable, List, Optional import pkg_resources from termcolor import colored import determined import determined.deploy from determined.common.api import certs from determined.deploy import healthcheck from determined.deploy.aws import aws, constants COMMON_TEMPLATE_PARAMETER_...
4,577
test raises on bad vocab size
# Copyright 2021, The TensorFlow Federated Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
4,578
test osarch detail api redirect
import urllib.parse from django.contrib.auth.models import User from django.test import TestCase from dfirtrack_main.models import Osarch class OsarchAPIViewTestCase(TestCase): """osarch API view tests""" @classmethod def setUpTestData(cls): # create object Osarch.objects.create(osarch_...
4,579
test mapping hostname and authority
import json import pytest from tests.utils import compile_with_cachecheck @pytest.mark.compilertest def test_mapping_host_star_error(): test_yaml = """ --- apiVersion: getambassador.io/v3alpha1 kind: Mapping metadata: name: bad-mapping namespace: default spec: host: "*" prefix: /star/ service: star ""...
4,580
to pkg tuple
''' dnfdragora is a graphical package management tool based on libyui python bindings License: GPLv3 Author: Angelo Naselli <anaselli@linux.it> @package dnfdragora ''' # NOTE part of this code is imported from yumex-dnf import time import configparser import gettext import locale import logging import logging.han...
4,581
test lifecycle
# Copyright (c) 2021 - present / Neuralmagic, Inc. 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 b...
4,582
test run tests
"""Unit tests for PyTest runner.""" import os import collections import pytest from testplan.report import TestCaseReport from testplan.testing import py_test as pytest_runner from testplan import defaults from testplan import report from tests.unit.testplan.testing import pytest_expected_data @pytest.fixture def ...
4,583
connect child emitters
"""MutableMapping that emits events when altered.""" from typing import Mapping, Optional, Sequence, Type, Union from napari.utils.events.containers._dict import _K, _T, TypedMutableMapping from napari.utils.events.event import EmitterGroup, Event from napari.utils.events.types import SupportsEvents class EventedDic...
4,584
test model fit tensor board epoch level
# Copyright 2021 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 applicable ...
4,585
add slave
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006-2015 (ita) """ Instead of compiling object files one by one, c/c++ compilers are often able to compile at once: cc -c ../file1.c ../file2.c ../file3.c Files are output on the directory where the compiler is called, and dependencies are more difficult to trac...
4,586
savetxt
from collections import defaultdict import numpy as np import sys #from A, except some functions class DistanceMatrix: def __init__(self, *args): self.D = np.array(*args) return def __str__(self): return str([[float(a) for a in x] for x in self.D]) def __repr__(self): ret...
4,587
list jobs
from django.contrib.auth.models import AnonymousUser from django.db.models import Q from django.template import Library, TemplateSyntaxError, Variable from django.utils.translation import gettext_lazy as _ from django.db.models import Count from tendenci.apps.jobs.models import Job from tendenci.apps.base.template_tag...
4,588
hook r
# SPDX-License-Identifier: MIT from ..hv import TraceMode from ..utils import * __all__ = [] class RegCacheAlwaysCached(Reloadable): def __init__(self, parent): self.parent = parent def read(self, addr, width): return self.parent.read_cached(addr, width) def write(self, addr, data, widt...
4,589
frame descriptors
""" ckwg +31 Copyright 2020 by Kitware, Inc. 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, this list of conditions and the ...
4,590
rei url helper
# -*- coding: utf-8 -*- """ EPA REI """ import re import pandas as pd import numpy as np from flowsa.location import US_FIPS from flowsa.flowbyfunctions import assign_fips_location_system from flowsa.fbs_allocation import direct_allocation_method def METHOD_NAME(*, build_url, config, **_): """ This helper fun...
4,591
get mock rendition
from django.db import models from django.utils.functional import cached_property from wagtail.images.image_operations import ( DoNothingOperation, MinMaxOperation, WidthHeightOperation, ) from wagtail.images.models import ( AbstractImage, AbstractRendition, Filter, Image, ) from wagtail_pl...
4,592
form type
''' See COPYRIGHT.md for copyright information. ''' import os from arelle import XmlUtil from arelle.ModelObject import ModelObject newRssWatchOptions = { "feedSource": "", "feedSourceUri": None, "matchTextExpr": "", "formulaFileUri": "", "logFileUri": "", "emailAddress": "", "validateXbrlR...
4,593
batch shape
# 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...
4,594
register
import abc import pathlib import contextlib from typing import Union, Tuple, Dict from ..util.data import merge from ..util.entrypoint import base_entry_point from ..configloader.configloader import BaseConfigLoader from .base import BaseDataFlowObjectContext, BaseDataFlowObject from .types import DataFlow # Filetype...
4,595
extract data
# pylint: disable=too-many-lines # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRe...
4,596
add args
# 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. from fairseq import options from fairseq.models import ( FairseqLanguageModel, register_model, register_model_architecture, ) from...
4,597
test dedicated host group
from conftest import roundtrip_check from resoto_plugin_azure.resource.base import GraphBuilder from resoto_plugin_azure.resource.compute import * from resotolib.baseresources import VolumeStatus, InstanceStatus def test_availability_sets(builder: GraphBuilder) -> None: collected = roundtrip_check(AzureAvailabili...
4,598
get primary sp
# Copyright (c) 2022, 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 appli...
4,599
on output click
# Generated file. To retain edits, remove this comment. from dataclasses import dataclass from typing import Any, Dict import numpy as np import js from pyodide.ffi.wrappers import add_event_listener import pyodide from itkwasm_compress_stringify import compress_stringify_async from compress_stringify_load_sample_i...