id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
12,700
get thermal val
#!/usr/bin/env python # # Copyright (C) 2017 Accton Technology Corporation # # 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 vers...
12,701
annotation
# coding=utf-8 # *** WARNING: this file was generated by pulumi. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import copy import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union, overload from .. import _utilities from . imp...
12,702
validate part ipn
"""Sample plugin which demonstrates custom validation functionality""" from datetime import datetime from django.core.exceptions import ValidationError from plugin import InvenTreePlugin from plugin.mixins import SettingsMixin, ValidationMixin class CustomValidationMixin(SettingsMixin, ValidationMixin, InvenTreePl...
12,703
test time notes
from datetime import datetime from os.path import dirname, join import pytest from city_scrapers_core.constants import COMMISSION, PASSED, TENTATIVE from city_scrapers_core.utils import file_response from freezegun import freeze_time from scrapy.settings import Settings from city_scrapers.spiders.chi_ssa_23 import Ch...
12,704
fire event
# Copyright (c) 2021, 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...
12,705
test invalid verify
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. import binascii import pytest from cryptography.exceptions import AlreadyFinalized, InvalidSignature from cryptography.hazmat.primitives...
12,706
from help
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import re from dataclasses import asdict from typing import Iterable, Iterator, List, Optional import strawberry from pants_explorer.server.graphql.con...
12,707
send msg
import json from typing import List, Text, Dict import requests from kairon import Utility from kairon.chat.handlers.channels.clients.whatsapp.factory import WhatsappFactory from kairon.exceptions import AppException from kairon.shared.channels.broadcast.from_config import MessageBroadcastFromConfig from kairon.share...
12,708
visit array type
#!/usr/bin/env python3 # # QAPI parser test harness # # Copyright (c) 2013 Red Hat Inc. # # Authors: # Markus Armbruster <armbru@redhat.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 argparse import difflib import os impo...
12,709
update data
import System.Windows.Forms as WinForms from travertino.size import at_least from .base import Widget class DetailedList(Widget): def create(self): self.native = WinForms.ListView() self.native.View = WinForms.View.Details self.native.HeaderStyle = getattr(WinForms.ColumnHeaderStyle, "Non...
12,710
get output keys
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Un...
12,711
test message json response error
from tests.unit import unittest from boto.exception import BotoServerError, S3CreateError, JSONResponseError from httpretty import HTTPretty, httprettified class TestBotoServerError(unittest.TestCase): def test_botoservererror_basics(self): bse = BotoServerError('400', 'Bad Request') self.asser...
12,712
process document
""" my.SplitSentence will split a given sentence at a given token. """ import logging from udapi.core.block import Block from udapi.core.root import Root class SplitSentence(Block): """ If the sent_id of the current sentence matches the parameter, splits the sentence into two. The first token of the second...
12,713
test make small image url when unknown
# -*- 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...
12,714
remove
#!/usr/bin/python3 import json import shutil import sys import yaml from brownie import accounts, network from brownie._config import BROWNIE_FOLDER, _get_data_folder from brownie.exceptions import ProjectNotFound, UnknownAccount from brownie.project import check_for_project, ethpm from brownie.utils import color, n...
12,715
iglob
""" Filename globbing utility. Mostly a copy of `glob` from Python 3.5. Changes include: * `yield from` and PEP3102 `*` removed. * Hidden files are not ignored. """ import os import re import fnmatch __all__ = ["glob", "iglob", "escape"] def glob(pathname, recursive=False): """Return a list of paths matching...
12,716
unequal fs series data
# -*- coding: utf-8 -*- # Copyright (C) Cardiff University (2023) # # This file is part of GWpy. # # GWpy 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) ...
12,717
list private link resource
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
12,718
remove address route
# 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...
12,719
on new version
import web import datetime from infogami.infobase import client from openlibrary.core import helpers as h import contextlib __all__ = ["InvalidationProcessor"] class InvalidationProcessor: """Application processor to invalidate/update locally cached documents. The openlibrary application caches some docume...
12,720
get channel points csv
# # Copyright (c) 2019, Neptune Labs Sp. z o.o. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
12,721
test raises on csc input
import numpy as np from numpy.testing import assert_array_equal import pytest from scipy.sparse import csr_matrix, csc_matrix from scipy.sparse.csgraph import maximum_flow def test_raises_on_dense_input(): with pytest.raises(TypeError): graph = np.array([[0, 1], [0, 0]]) maximum_flow(graph, 0, 1)...
12,722
set up class
# # -*- coding: utf-8 -*- # import logging import os import platform import sys import unittest from importlib.abc import MetaPathFinder import cpuinfo import tensorflow as tf class ForbiddenModules(MetaPathFinder): def __init__(self, modules): super().__init__() self.modules = modules def ...
12,723
test bitlist to string
#!/usr/bin/python import os import tempfile import unittest import sys from avocado.utils import process # simple magic for using scripts within a source tree basedir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) if os.path.isdir(os.path.join(basedir, 'virttest')): sys.path.append(basedir) from...
12,724
check resolution
# RPi Meteor Station # Copyright (C) 2016 Dario Zubovic, Denis Vida # # 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. ...
12,725
sample update knowledge sources
# coding=utf-8 # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ """ FILE: sample_update_knowledge_sources.py DESCRIPTION: This sample demonstrates how to update Qna project knowledge sources. USAGE: python s...
12,726
is running
""" Display songs currently playing in DeaDBeeF. Configuration parameters: cache_timeout: refresh interval for this module (default 5) format: display format for this module (default '[{artist} - ][{title}]') sleep_timeout: when deadbeef is not running, this interval will be used to allow faster re...
12,727
test reactive draw
# -*- coding: utf-8 -*- """ Tests for PolygonVisual All images are of size (100,100) to keep a small file size """ import numpy as np from vispy.scene import visuals, transforms from vispy.testing import (requires_application, requires_scipy, TestingCanvas, run_tests_if_main) from vispy.te...
12,728
get test hda path
# Copyright (c) <2021> Side Effects Software 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: # # 1. Redistributions of source code must retain the above copyright notice, # this list ...
12,729
create initial template
# Example of video streaming simulation from trex.astf.api import * import argparse class Prof1(): def __init__(self): pass def __setup_ip_gen(self, client_ip_range, server_ip_range): ip_gen_c = ASTFIPGenDist(ip_range=client_ip_range, distribution="seq") ip_gen_s = ASTFIPGenDist(ip_r...
12,730
network
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** 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 fr...
12,731
native value
"""Support number entity for Xiaomi Miot.""" import logging from homeassistant.const import * # noqa: F401 from homeassistant.components.number import ( DOMAIN as ENTITY_DOMAIN, NumberEntity, RestoreNumber, ) from . import ( DOMAIN, CONF_MODEL, XIAOMI_CONFIG_SCHEMA as PLATFORM_SCHEMA, # noqa...
12,732
analyze dir
# This program 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. # # This program is distributed in the hope that it will be usefu...
12,733
log validation results
""" MNIST example with training and validation monitoring using Tensorboard on TPU Requirements: - PyTorch >= 1.5 - PyTorch XLA >= 1.5 - Tensorboard: `pip install tensorflow` (or just install tensorboard without the rest of tensorflow) Usage: Start tensorboard: ```bash tensorboard --logdir=/t...
12,734
biot panel fast
"""Methods for UVLM solution S. Maraniello, 1 Jun 2018 """ import numpy as np import sharpy.aero.utils.uvlmlib as uvlmlib import sharpy.utils.algebra as algebra from sharpy.utils.constants import cfact_biot # local mapping segment/vertices of a panel svec = [0, 1, 2, 3] # seg. number avec = [0, 1, 2, 3] # 1st verte...
12,735
test type equality
import numpy as np import pytest import pytensor from pytensor.tensor.type import TensorType from pytensor.typed_list.basic import TypedListVariable from pytensor.typed_list.type import TypedListType from tests.tensor.utils import random_ranged class TestTypedListType: def test_wrong_input_on_creation(self): ...
12,736
test confusion matrix with unequal samples
import numpy as np import pytest import sklearn from autogluon.core.metrics import confusion_matrix, log_loss, quadratic_kappa, roc_auc from autogluon.core.metrics.softclass_metrics import soft_log_loss def test_confusion_matrix_with_valid_inputs_without_labels_and_weights(): # Given input_solution = [2, 0, ...
12,737
test fetch service data retention only returns
import uuid from datetime import datetime import pytest from sqlalchemy.exc import IntegrityError from app.dao.service_data_retention_dao import ( fetch_service_data_retention, fetch_service_data_retention_by_id, fetch_service_data_retention_by_notification_type, insert_service_data_retention, upd...
12,738
compose document
__all__ = ['Composer', 'ComposerError'] from .error import MarkedYAMLError from .events import * from .nodes import * class ComposerError(MarkedYAMLError): pass class Composer: def __init__(self): self.anchors = {} def check_node(self): # Drop the STREAM-START event. if self.ch...
12,739
draw trap
# Copyright 2020-2023 Capypara and the SkyTemple Contributors # # This file is part of SkyTemple. # # SkyTemple 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 y...
12,740
test captured
from contextlib import redirect_stderr, redirect_stdout from io import StringIO from pybind11_tests import iostream as m def METHOD_NAME(capsys): msg = "I've been redirected to Python, I hope!" m.captured_output(msg) stdout, stderr = capsys.readouterr() assert stdout == msg assert stderr == "" ...
12,741
write file spdx
# Copyright (c) 2020, 2021 The Linux Foundation # # SPDX-License-Identifier: Apache-2.0 from datetime import datetime from west import log from zspdx.util import getHashes # Output tag-value SPDX 2.2 content for the given Relationship object. # Arguments: # 1) f: file handle for SPDX document # 2) rln: Relation...
12,742
update
import time from struct import pack from network.packet.PacketWriter import PacketWriter from network.packet.METHOD_NAME.UpdateMask import UpdateMask from utils.Logger import Logger from utils.constants.OpCodes import OpCode from utils.constants.UpdateFields import EncapsulationType, ObjectFields FIELDS_ENCAPSULATION...
12,743
test args to payload
# Licensed under a 3-clause BSD style license - see LICENSE.rst import os import re import numpy as np import pytest from astropy.coordinates import SkyCoord from astropy.table import Table import astropy.units as u from astroquery.utils.mocks import MockResponse from astroquery.ipac.irsa import Irsa, conf from astr...
12,744
field
""" window_hanning ============== Autogenerated DPF operator classes. """ from warnings import warn from ansys.dpf.core.dpf_operator import Operator from ansys.dpf.core.inputs import Input, _Inputs from ansys.dpf.core.outputs import Output, _Outputs from ansys.dpf.core.outputs import _modify_output_spec_with_one_type f...
12,745
fill language
from datetime import timedelta from typing import Dict, List from django.core.management.base import BaseCommand, CommandError from django.utils import timezone, translation from lxml import etree as ET from judge.models import Contest, ContestSubmission, Language from judge.models.submission import SUBMISSION_RESULT...
12,746
set rpc options
# Impacket - Collection of Python classes for working with network protocols. # # Copyright (C) 2023 Fortra. All rights reserved. # # This software is provided under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # Description: # Config utilit...
12,747
members
# --- BEGIN COPYRIGHT BLOCK --- # Copyright (C) 2023 Red Hat, Inc. # All rights reserved. # # License: GPL (version 3 or any later version). # See LICENSE for details. # --- END COPYRIGHT BLOCK --- from lib389.idm.group import UniqueGroup, UniqueGroups, MUST_ATTRIBUTES from lib389.cli_base import populate_attr_argumen...
12,748
test to gps
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2014-2020) # # This file is part of GWpy. # # GWpy 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)...
12,749
get related files
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/pylint-dev/pylint/blob/main/LICENSE # Copyright (c) https://github.com/pylint-dev/pylint/blob/main/CONTRIBUTORS.txt """Utility functions for configuration testing.""" from __future__ import annotations ...
12,750
test set modes
from unittest import TestCase from shapely.ops import substring from copy import copy, deepcopy import os from shutil import copytree, rmtree import uuid from random import randint, random from tempfile import gettempdir from aequilibrae.project import Project from ...data import siouxfalls_project class TestLink(Te...
12,751
hard swish jit bwd
""" Activations (memory-efficient w/ custom autograd) A collection of activations fn and modules with a common interface so that they can easily be swapped. All have an `inplace` arg even if not used. These activations are not compatible with jit scripting or ONNX export of the model, please use either the JIT or bas...
12,752
build align cmdline
#!/usr/bin/env python # Copyright 2004-2005 by Michael Hoffman. All rights reserved. # This file is part of the Biopython distribution and governed by your # choice of the "Biopython License Agreement" or the "BSD 3-Clause License". # Please see the LICENSE file that should have been included as part of this # package....
12,753
load
from typing import List, Iterable from requests import Response import json from TM1py.Exceptions.Exceptions import TM1pyRestException from TM1py.Services.ObjectService import ObjectService from TM1py.Services.RestService import RestService from TM1py.Utils import format_url from TM1py.Objects.Sandbox import Sandbox ...
12,754
process flat
#!/usr/bin/env python # coding: utf-8 import librosa import logging import numpy as np from scipy.spatial import distance from scipy import signal, ndimage import pylab as plt import msaf from msaf.algorithms.interface import SegmenterInterface def median_filter(X, M=8): """Median filter along the first axis of ...
12,755
test error in nested context
from __future__ import annotations from pathlib import Path import pytest from manim import MathTex, SingleStringMathTex, Tex, TexTemplate, config, tempconfig from manim.mobject.types.vectorized_mobject import VMobject from manim.utils.color import RED def test_MathTex(): MathTex("a^2 + b^2 = c^2") assert ...
12,756
on signal received
"""LiveCheck - Test runner.""" import asyncio import logging import traceback import typing from time import monotonic from typing import Any, Dict, Iterable, List, Mapping, Optional, Tuple from mode.utils.logging import CompositeLogger from mode.utils.times import humanize_seconds from mode.utils.typing import NoRetu...
12,757
get model
# 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...
12,758
generate spec by threshold
# MIT License # # Copyright (c) 2023 Advanced Micro Devices, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy...
12,759
gelu
# -------------------------------------------------------- # BEATs: Audio Pre-Training with Acoustic Tokenizers (https://arxiv.org/abs/2212.09058) # Github source: https://github.com/microsoft/unilm/tree/master/beats # Copyright (c) 2022 Microsoft # Licensed under The MIT License [see LICENSE for details] # Based on fa...
12,760
test finish job fact cache with bad
# -*- coding: utf-8 -*- import json import os import time import pytest from awx.main.models import ( Inventory, Host, ) from awx.main.tasks.facts import start_fact_cache, finish_fact_cache from django.utils.timezone import now from datetime import timedelta @pytest.fixture def ref_time(): return now(...
12,761
name
# 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...
12,762
scan files
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """ """ import os from os import path as op from ..file import get_dir, resolve from ..keyboard import Key from ..view import CallableView from .choice import SingleChoiceInputVie...
12,763
set component
class Graph: def __init__(self, num_of_nodes: int) -> None: """ Arguments: num_of_nodes - the number of nodes in the graph Attributes: m_num_of_nodes - the number of nodes in the graph. m_edges - the list of edges. m_component - the dictionary ...
12,764
get when exploration rated
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
12,765
test delete runner
# -*- coding: utf-8 -*- # Copyright (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr) # 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) import...
12,766
auto repr
import inspect from functools import partial from typing import ( Any, Callable, Iterable, List, Optional, Tuple, Type, TypeVar, Union, overload, ) T = TypeVar("T") Result = Iterable[Union[Any, Tuple[Any], Tuple[str, Any], Tuple[str, Any, Any]]] RichReprResult = Result class...
12,767
error format
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
12,768
wait for reboot up
import re import logging as log import aexpect from avocado.utils import process from avocado.utils import wait from virttest import libvirt_vm from virttest import virt_vm from virttest import virsh from virttest import remote from virttest import utils_conn from virttest import utils_libvirtd from virttest import u...
12,769
get full page screenshot as base64
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
12,770
cleanup
# -*- coding: utf-8 -*- # # This file is part of INSPIRE. # Copyright (C) 2014-2017 CERN. # # INSPIRE 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 ...
12,771
druid getdetail
from sqlalchemy import create_engine class basefunc: # druid @staticmethod def druid_getschema(uri, db): engine = create_engine(uri, echo=True) res = engine.execute('select SCHEMA_NAME from INFORMATION_SCHEMA.SCHEMATA ').fetchall() db_list = [] for row in res: f...
12,772
handle input
# Copyright 2017 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 agreed t...
12,773
test per location subscriber call durations column
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest from flowmachine.features.subscriber.subscriber_call_durations import * from flowmachine.utils import Sta...
12,774
method
# -------------------------------------------------------------------------------------------- # 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 # --------------------------------...
12,775
query trigger runs by workspace
# 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 ...
12,776
test exclude groups which does not exists
# -*- coding: utf-8 -*- from io import StringIO from django.core.management import call_command, CommandError from django.contrib.auth.models import User from django_extensions.management.commands.set_fake_emails import Command import pytest @pytest.fixture(scope='module') def django_db_setup(django_db_setup, djan...
12,777
write fuzzed payloads
# Copyright 2018- The Pixie 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 or agreed to in w...
12,778
test absent deleting existing
import pytest import salt.states.macdefaults as macdefaults from tests.support.mock import MagicMock, patch @pytest.fixture def configure_loader_modules(): return {macdefaults: {}} def test_write(): """ Test writing a default setting """ expected = { "changes": {"written": "com.apple.Cr...
12,779
get late issues
# -*- coding: utf-8 -*- # # RERO ILS # Copyright (C) 2022 RERO # # This program 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, version 3 of the License. # # This program is distributed in the hope that...
12,780
copy
"""This provides a native trajectory optimization framework to DART, transcribing DART trajectory problems into IPOPT for solutions.""" from __future__ import annotations import nimblephysics_libs._nimblephysics.trajectory import typing import nimblephysics_libs._nimblephysics.neural import nimblephysics_libs._nimbleph...
12,781
add step closure
import os import threading from queue import Empty as EmptyQueue, Queue from torch._lazy.device_context import get_device_context class ClosureHandler: def __init__(self): pass def run(self, closure): """Run closure function Args: closure: callable function to run ""...
12,782
set input divide by period
import logging import numpy from openfisca_core import periods log = logging.getLogger(__name__) def set_input_dispatch_by_period(holder, period, array): """ This function can be declared as a ``set_input`` attribute of a variable. In this case, the variable will accept inputs on larger periods that i...
12,783
test main
import pickle import pickletools from test import support from test.pickletester import AbstractPickleTests import unittest class OptimizedPickleTests(AbstractPickleTests): def dumps(self, arg, proto=None, **kwargs): return pickletools.optimize(pickle.dumps(arg, proto, **kwargs)) def loads(self, buf,...
12,784
setup single view dispatcher route
from __future__ import annotations import asyncio import json from asyncio import Queue as AsyncQueue from asyncio.futures import Future from typing import Any from urllib.parse import urljoin from tornado.httpserver import HTTPServer from tornado.httputil import HTTPServerRequest from tornado.log import enable_prett...
12,785
log track
# -*- coding: utf-8 -*- """ *==LICENSE==* CyanWorlds.com Engine - MMOG client, server and tools Copyright (C) 2011 Cyan Worlds, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3...
12,786
hdfs link
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
12,787
read
# -*- coding: utf-8 -*- import cherrypy import datetime import dateutil.parser import errno from functools import wraps import json import os import pytz import re import string import girder import girder.events try: from random import SystemRandom random = SystemRandom() random.random() # potentially r...
12,788
left assign
#!/usr/bin/env python2 """ typed_arith_parse.py: Parse shell-like and C-like arithmetic. """ from __future__ import print_function import sys from _devbuild.gen.typed_arith_asdl import ( arith_expr, arith_expr_t, ) from typing import Dict, List, Optional #from typing import cast from asdl.examples import tdop f...
12,789
get user value from auth
# Janssen Project software is available under the Apache License (2004). See http://www.apache.org/licenses/ for full text. # Copyright (c) 2020, Janssen Project # # Author: Yuriy Movchan # from io.jans.service.cdi.util import CdiUtil from io.jans.as.server.security import Identity from io.jans.jsf2.message import Fac...
12,790
op stats
# Copyright (c) Facebook, Inc. and its affiliates. import copy import io import logging import numpy as np from typing import List import onnx import onnx.optimizer import torch from caffe2.proto import caffe2_pb2 from caffe2.python import core from caffe2.python.onnx.backend import Caffe2Backend from tabulate import ...
12,791
test pyfai drawmask
#!/usr/bin/env python # coding: utf-8 # # Project: Azimuthal integration # https://github.com/silx-kit/pyFAI # # Copyright (C) 2015-2018 European Synchrotron Radiation Facility, Grenoble, France # # Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu) # # Permission is hereby granted, fr...
12,792
get default version from version def
"""Core utilities and constants.""" import inspect import os import re from typing import Optional, Tuple from ..cache.base import BaseCache from ..core.profile import Profile from ..messaging.agent_message import AgentMessage from ..utils.classloader import ClassLoader from .error import ProtocolMinorVersionNotSup...
12,793
model
# Copyright Contributors to the Pyro project. # SPDX-License-Identifier: Apache-2.0 import argparse import logging import numpy as np import torch import pyro import pyro.distributions as dist from pyro.contrib.examples.bart import load_bart_od from pyro.contrib.forecast import ForecastingModel, backtest from pyro.o...
12,794
test filter by product id
# -*- coding: utf-8 -*- # pylint: disable=attribute-defined-outside-init, invalid-name, avoid-list-comprehension from xmlrpc.client import Fault as XmlRPCFault from xmlrpc.client import ProtocolError from django.test import override_settings from tcms.management.models import Version from tcms.rpc.tests.utils import...
12,795
layout
from conan import ConanFile from conan.errors import ConanInvalidConfiguration from conan.tools.apple import is_apple_os from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rm, rmdir, save from conan.too...
12,796
get func to call
# 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 ...
12,797
resnest101
# Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved. import os.path as osp from typing import Any, Dict import cv2 import numpy as np import torch from PIL import Image from torchvision import transforms from modelscope.metainfo import Pipelines from modelscope.models.cv.animal_rec...
12,798
test load
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
12,799
uniform filter
"""Structural similarity index calculation in PyTorch, ported from Jax.""" import functools import functorch import torch import torch.nn.functional as F from torchvision.transforms.functional import pad as pad_fn from algorithmic_efficiency.pytorch_utils import pytorch_setup DEVICE = pytorch_setup()[2] def ssim(...