id
int64
0
300k
label
stringlengths
1
74
text
stringlengths
4k
8k
11,500
fix fileid
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. import contextlib try: from io import StringIO except ImportError: from StringIO import StringIO # 2.7 import os.path import sys @contextlib.contextmanager def noop_cm(): yield def group_attr_names(attrnames)...
11,501
run
"""Script to monitor sensor output.""" import asyncio import argparse import datetime from opentrons_hardware.drivers.can_bus import ( build, CanMessenger, WaitableCallback, ) from opentrons_hardware.firmware_bindings import constants from opentrons_hardware.firmware_bindings.messages import ( message_...
11,502
get origin params
import os import platform import shutil from argparse import Namespace from dataclasses import dataclass from logging import getLogger from typing import List from PyQt5.QtCore import QProcess, QProcessEnvironment from legendary.models.game import InstalledGame, LaunchParameters from rare.lgndr.core import LegendaryC...
11,503
boxes to text
# -*- coding: utf-8 -*- """Code Compilation Code compilation allows Mathics functions to be run faster. When LLVM and Python libraries are available, compilation \ produces LLVM code. """ import ctypes from types import FunctionType from mathics.builtin.box.compilation import CompiledCodeBox from mathics.core.atoms...
11,504
valid input
import os from qtpy import QtCore, QtWidgets, QtGui from openpype import style from openpype import resources from openpype.modules.shotgrid.lib import settings, credentials class CredentialsDialog(QtWidgets.QDialog): SIZE_W = 450 SIZE_H = 200 _module = None _is_logged = False url_label = None ...
11,505
discover
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import json import logging import traceback from datetime import datetime from typing import Any, Iterable, Iterator, Mapping, MutableMapping from urllib.parse import urlparse from airbyte_cdk import AirbyteLogger from airbyte_cdk.models import ( Airby...
11,506
test node param parameter
# -*- coding: utf-8 -*- # # test_random_parameter.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 L...
11,507
bounds check trim
""" Flowblade Movie Editor is a nonlinear video editor. Copyright 2012 Janne Liljeblad. This file is part of Flowblade Movie Editor <https://github.com/jliljebl/flowblade/>. Flowblade Movie Editor is free software: you can redistribute it and/or modify it under the terms of the GNU General Public ...
11,508
get spec name
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """This script generates abseil.podspec from all BUILD.bazel files. This is expected to run on abseil git repository with Bazel 1.0 on Linux. It recursively analyzes BUILD.bazel files using query command of Bazel to dump its build rules in XML format. From these rules, it...
11,509
update patch log
# Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors # License: MIT. See LICENSE """ Patch Handler. This file manages execution of manaully written patches. Patches are script that apply changes in database schema or data to accomodate for changes in the code. Ways to specify patches: 1. patches.txt ...
11,510
get
import json import re from urllib.parse import quote from urllib.parse import urlparse from svtplay_dl.error import ServiceError from svtplay_dl.fetcher.hls import hlsparse from svtplay_dl.service import Service class Eurosport(Service): supported_domains_re = [r"^([^.]+\.)*eurosportplayer.com"] def METHOD_...
11,511
test float comparisons
# ------------------------------------------------------------------------------------------------- # Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved. # https://nautechsystems.io # # Licensed under the GNU Lesser General Public License Version 3.0 (the "License"); # You may not use this file ex...
11,512
list
# 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...
11,513
解析docx
from toolbox import update_ui from toolbox import CatchException, report_execption, write_results_to_file from .crazy_utils import request_gpt_model_in_new_thread_with_ui_alive fast_debug = False def METHOD_NAME(file_manifest, project_folder, llm_kwargs, plugin_kwargs, chatbot, history, system_prompt): import tim...
11,514
make batches
#!/usr/bin/env python3 -u # 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. """ Translate raw text with a trained model. Batches data on-the-fly. """ from collections import namedtuple import ...
11,515
get handle
import iota_client from iota_client._node_core_api import NodeCoreAPI from iota_client._node_indexer_api import NodeIndexerAPI from iota_client._high_level_api import HighLevelAPI from iota_client._utils import Utils from json import dumps class IotaClient(NodeCoreAPI, NodeIndexerAPI, HighLevelAPI, Utils): def __i...
11,516
test panos zone user id include acl
import os import warnings from pathlib import Path from typing import List from parameterized import parameterized_class from checkov.common.graph.db_connectors.networkx.networkx_db_connector import NetworkxConnector from checkov.common.graph.db_connectors.igraph.igraph_db_connector import IgraphConnector from checko...
11,517
draw angle units buttons
# ##### BEGIN GPL LICENSE BLOCK ##### # # 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 distrib...
11,518
test get partition function classical
#!/usr/bin/env python3 ############################################################################### # # # RMG - Reaction Mechanism Generator # # ...
11,519
setup default logging
import unittest from unittest import mock from ZEO.runzeo import ZEOServer class TestStorageServer: def __init__(self, fail_create_server): self.called = [] if fail_create_server: raise RuntimeError() def close(self): self.called.append("close") class TestZEOServer(ZEO...
11,520
test ok to read workflow from cached
import json import os import tempfile from collections.abc import Generator import pytest from flask.app import Flask from spiffworkflow_backend.services.element_units_service import BpmnSpecDict from spiffworkflow_backend.services.element_units_service import ElementUnitsService from tests.spiffworkflow_backend.help...
11,521
update org mapping
import logging from mongoengine import DoesNotExist from kairon import Utility from kairon.exceptions import AppException from kairon.idp.data_objects import IdpConfig from kairon.idp.processor import IDPProcessor from kairon.shared.account.data_objects import Organization from kairon.shared.data.constant import Featu...
11,522
main
# pylint: disable=g-direct-third-party-import # Copyright 2015 The Bazel 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/LI...
11,523
can annotate
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2007 Glencoe Software, Inc. All rights reserved. # Use is subject to license terms supplied in LICENSE.txt # """ Used to be generated by blitz/templates/resources/combined.vm """ import omero.constants.permissions as ocp import Ice import IceImport IceImport.l...
11,524
parse args
#!/usr/bin/env python3 # SPDX-FileCopyrightText: Samsung Electronics Co., Ltd # # SPDX-License-Identifier: BSD-3-Clause """ Produce a binary Debian package from meson builddir This has only been tested using meson 0.61, requires the following files from the builddir: meson-info/intro-installed.json ...
11,525
info
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. "Bare-bones implementation of statsD's protocol, client-side" import logging import socket from re import sub from gunicorn.glogging import Logger # Instrumentation constants METRIC_VAR = "...
11,526
set sim station
from __future__ import absolute_import, division, print_function import NuRadioReco.framework.base_station import NuRadioReco.framework.sim_station import NuRadioReco.framework.channel from six import iteritems import pickle import logging import collections logger = logging.getLogger('Station') class Station(NuRadio...
11,527
delete
import random from sqlite3 import Connection from shapely.geometry import Point, MultiPolygon from .network.safe_class import SafeClass from .network.connector_creation import connector_creation class Zone(SafeClass): """Single zone object that can be queried and manipulated in memory""" def __init__(self, d...
11,528
test rips from points
""" This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. Author(s): Vincent Rouvreau Copyright (C) 2016 Inria Modification(s): - YYYY/MM Author: Description of t...
11,529
check bloom
import pytest import torch import colossalai from colossalai.logging import disable_existing_loggers from colossalai.shardformer.layer.utils import Randomizer from colossalai.tensor.d_tensor.api import clear_layout_converter from colossalai.testing import clear_cache_before_run, parameterize, rerun_if_address_is_in_us...
11,530
build dictionary
# 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 itertools import logging import os from collections import OrderedDict import numpy as np from fairseq import tokenizer, utils from fa...
11,531
l r names as l r
from __future__ import annotations from copy import deepcopy import sqlglot import sqlglot.expressions as exp from sqlglot.errors import ParseError from .default_from_jsonschema import default_value_from_schema def sqlglot_tree_signature(tree): """ A short string representation of a SQLglot tree. Allo...
11,532
test qt tree model insertion
import pytest from qtpy.QtCore import QModelIndex, Qt from napari._qt.containers import QtNodeTreeModel, QtNodeTreeView from napari._qt.containers._base_item_view import index_of from napari.utils.events._tests.test_evented_list import NESTED_POS_INDICES from napari.utils.tree import Group, Node @pytest.fixture def ...
11,533
test runner returns disabled
""" Tests for runner_returns """ import errno import os import socket import tempfile import pytest import salt.payload import salt.utils.args import salt.utils.files import salt.utils.jid import salt.utils.yaml from tests.support.case import ShellCase from tests.support.runtests import RUNTIME_VARS @pytest.mark.w...
11,534
set
################################################################################################### # # # This file is part of HPIPM. # # ...
11,535
get default channel slug or graphql error
from collections import defaultdict from django.core.exceptions import ValidationError from django.db.models import Exists, OuterRef, Q from django.utils.functional import SimpleLazyObject from graphql.error import GraphQLError from ...channel.exceptions import ChannelNotDefined, NoDefaultChannel from ...channel.mode...
11,536
teardown function
# -*- coding: UTF-8 -*- from mpi4py import MPI from sympy import pi, cos, sin, symbols from sympy.utilities.lambdify import implemented_function import pytest from sympde.calculus import grad, dot from sympde.calculus import laplace from sympde.topology import ScalarFunctionSpace from sympde.topology import element_o...
11,537
deferred config
""" Configuration module. Uses backend_config to load system configuration. """ import logging import os import sys from os.path import expandvars, expanduser from ..backend_api import load_config from ..backend_config import Config from ..backend_config.bucket_config import S3BucketConfigurations from .defs import *...
11,538
test path iteration
# -*- coding: utf-8 -*- ########################################################################### # Copyright (c), The AiiDA team. All rights reserved. # # This file is part of the AiiDA code. # # ...
11,539
get from type
from __future__ import annotations from typing import TYPE_CHECKING, List, Optional, Union, cast from typing_extensions import Protocol from strawberry.custom_scalar import ScalarDefinition from strawberry.directive import StrawberryDirective from strawberry.enum import EnumDefinition, EnumValue from strawberry.lazy_...
11,540
set speech options
# SPDX-License-Identifier: MIT # Copyright (c) 2018-2021 The Pybricks Authors from typing import Iterable, Union, Optional from ..media.ev3dev import SoundFile class Speaker: """Plays beeps and sounds using a speaker.""" def beep(self, frequency: int = 500, duration: int = 100) -> None: """beep(fre...
11,541
xforms manifest
# coding: utf-8 import os.path from io import StringIO, BytesIO from urllib.parse import urljoin import requests from django.contrib.auth import authenticate from django.core.files.storage import get_storage_class from django.core.files.uploadedfile import UploadedFile from django.urls import reverse from django.test ...
11,542
filter aliases
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
11,543
get offset
# -*- coding: utf-8 -*- """ Convenience class for iterating over miniSEED records in a file. Version 2017.114 """ import ctypes as C # NOQA from obspy import UTCDateTime from obspy.io.mseed.headers import (HPTMODULUS, MS_NOERROR, MS_ENDOFFILE, MSFileParam, MSRecord, clibmseed) c...
11,544
test specific function space invalid
# ----------------------------------------------------------------------------- # BSD 3-Clause License # # Copyright (c) 2021-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 fol...
11,545
test long plus
# A lot of failures in these tests on Mac OS X. # Byte order related? import unittest from ctypes import * from ctypes.test import need_symbol import _ctypes_test class CFunctions(unittest.TestCase): _dll = CDLL(_ctypes_test.__file__) def S(self): return c_longlong.in_dll(self._dll, "last_tf_arg_s")...
11,546
contains math interactions
# Copyright 2022 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 required by applicable ...
11,547
random
# Copyright (c) Microsoft Corporation. # SPDX-License-Identifier: Apache-2.0 # DeepSpeed Team import torch from .abstract_accelerator import DeepSpeedAccelerator # During setup stage torch may not be installed, pass on no torch will # allow op builder related API to be executed. try: import torch.mps except Imp...
11,548
test cursor with empty list
import json from typing import Optional import pytest from requests import Response from fides.api.schemas.saas.shared_schemas import HTTPMethod, SaaSRequestParams from fides.api.schemas.saas.strategy_configuration import CursorPaginationConfiguration from fides.api.service.pagination.pagination_strategy_cursor impor...
11,549
ptf collect
import pipes import traceback import logging import allure import json from datetime import datetime logger = logging.getLogger(__name__) def METHOD_NAME(host, log_file): pos = log_file.rfind('.') filename_prefix = log_file[0:pos] if pos > -1 else log_file pos = filename_prefix.rfind('/') + 1 rename...
11,550
test run fdr ranking
from itertools import product from unittest.mock import patch import pytest import numpy as np import pandas as pd from pandas.util.testing import assert_frame_equal from sm.engine.annotation.fdr import FDR, run_fdr_ranking from sm.engine.formula_parser import format_modifiers FDR_CONFIG = {'decoy_sample_size': 2} ...
11,551
make ssd vgg layer
# Copyright (c) 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 in writ...
11,552
set mock time
#!/usr/bin/env python3 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # Base class for RPC testing # Add python-bitcoinrpc to module search path: import os import sys import shut...
11,553
post factory
import contextlib import os import random import string from datetime import datetime from unittest.mock import patch import freezegun import pytest import sqlalchemy as sa from szurubooru import config, db, model, rest def get_unique_name(): alphabet = string.ascii_letters + string.digits return "".join(ra...
11,554
test parse common manifests
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import sys import unittest from ..load import load_all_manifests, patch_loader from ..manifest import ManifestParser class ManifestTest(...
11,555
makefile name
# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) import inspect import os.path from spack.package import * class Wannier90(MakefilePackage): """Wannier90 calculates...
11,556
get archive version
# 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...
11,557
gen f
import time from threading import Thread import pytest import env # noqa: F401 from pybind11_tests import callbacks as m def test_callbacks(): from functools import partial def func1(): return "func1" def func2(a, b, c, d): return "func2", a, b, c, d def func3(a): return ...
11,558
report context sensitivity
import re import threading from typing import Any from antlr4 import CommonTokenStream, InputStream, ParserRuleContext from antlr4.error.ErrorListener import ErrorListener from .errors import GrammarParseError # Import from visitor in order to check the presence of generated grammar files # files in a single place. ...
11,559
test simple
from django.test import SimpleTestCase from lxml import html from . import fragment_tree_to_str, fragments_to_tree, get_cleaner, markdown MATHML_N = """\ <math xmlns="http://www.w3.org/1998/Math/MathML"> <semantics> <mi>N</mi> <annotation encoding="application/x-tex">N</annotation> </semantics> </math> """ MATHML_CH...
11,560
test bad file
# Copyright (C) 2004-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...
11,561
check system limits
import sys from collections.abc import Callable, Generator, Iterable, Mapping, MutableMapping, MutableSequence from multiprocessing.connection import Connection from multiprocessing.context import BaseContext, Process from multiprocessing.queues import Queue, SimpleQueue from threading import Lock, Semaphore, Thread fr...
11,562
test get data
# (C) Copyright 2005-2021 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...
11,563
test function with kwargs starargs
# 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...
11,564
main
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import annotations import json import re import sys from dataclasses import asdict, dataclass from itertools import chain from typing import Iterator # # Note: This file ...
11,565
notify snatch
import html import os import warnings from sickchill import settings from sickchill.oldbeard import common # noinspection PyUnresolvedReferences with warnings.catch_warnings(): warnings.simplefilter("ignore") try: # noinspection PyUnresolvedReferences from pgi.repository import Notify exce...
11,566
test euclidean distance
import pytest from copy import deepcopy import numpy as np import os import pandas as pd from simba.mixins.feature_extraction_mixin import FeatureExtractionMixin import simba from simba.utils.enums import Paths from scipy.signal import savgol_filter def METHOD_NAME(): x1, x2 = np.full((10, 1), 1), np.full((10, 1)...
11,567
assert missing claim
import logging import pytest from h_matchers import Any class TestBadPayloads: """ The first few tests will be those that are in one or another way known to be invalid for 1.3 Core Launches. http://www.imsproject.org/spec/lti/v1p3/cert/#known-bad-payloads """ def test_no_kid_sent_in_jwt_header(...
11,568
tear down module
# -*- coding: utf-8 -*- import os import requests from .. import base from girder import config from girder.api import access from girder.api.describe import Description, describeRoute from girder.api.rest import Resource from girder.exceptions import GirderException, RestException from girder.models.setting import Se...
11,569
get queries log
import functools import logging import threading import time from collections import deque from resource import getrusage, RUSAGE_SELF from django.conf import settings from django.db.backends.utils import CursorWrapper from .collector import statsd PROCESSING_TIME_METRIC_PREFIX = getattr( settings, 'PROCESSING_T...
11,570
test
import timeit from functools import partial import numpy as np import pandas as pd import torch from functorch.compile import pointwise_operator WRITE_CSV = False CUDA = False SIZES = [1, 512, 8192] NUMBER = [100, 10, 1, 1] REPEAT = 20 @pointwise_operator def nnc_add(a, b): return a + b @pointwise_operator de...
11,571
close
import logging import time from typing import Dict, Iterable, List, Optional, Union from datahub.configuration.common import ConfigModel, DynamicTypedConfig from datahub.emitter.mcp import MetadataChangeProposalWrapper from datahub.ingestion.api.common import PipelineContext, RecordEnvelope from datahub.ingestion.api....
11,572
serialize
from __future__ import annotations import logging import typing as t from globus_compute_sdk.METHOD_NAME.base import ( DeserializationError, SerializationError, SerializationStrategy, ) from globus_compute_sdk.METHOD_NAME.concretes import ( DEFAULT_STRATEGY_CODE, DEFAULT_STRATEGY_DATA, SELECTA...
11,573
effect
# Authors: see git history # # Copyright (c) 2022 Authors # Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. import os import subprocess import sys from inkex import Boolean from ..elements import Clone, FillStitch, Polyline, SatinColumn, Stroke from ..utils import get_bundled_dir ...
11,574
as retriever
"""Tree-based index.""" from enum import Enum from typing import Any, Dict, Optional, Sequence, Union # from llama_index.data_structs.data_structs import IndexGraph from llama_index.data_structs.data_structs import IndexGraph from llama_index.indices.base import BaseIndex from llama_index.indices.base_retriever impor...
11,575
create all
""" Wrapper around tests """ import pathlib from django.contrib.auth import get_user_model from django.core.files import File from django.core.files.images import ImageFile from django.utils import timezone from . import models User = get_user_model() ADMIN_PASSWORD = '123456' CLAIMED_A_PASSWORD = '123456' CLAIMED_...
11,576
fit
"""Base classes for the decode module.""" import logging from abc import abstractmethod from nimare.base import NiMAREBase LGR = logging.getLogger(__name__) class Decoder(NiMAREBase): """Base class for decoders in :mod:`~nimare.decode`. .. versionchanged:: 0.0.12 Moved from ``nimare.base`` to ``ni...
11,577
store func
############################################################################## # # Copyright (c) 2008,2019 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THI...
11,578
test corruption binary masks
# Copyright (c) 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 in writ...
11,579
test reporting
import shutil from datetime import datetime from pathlib import Path import pytest from click.testing import CliRunner from maggma.builders import CopyBuilder from maggma.cli import run from maggma.stores import MemoryStore, MongoStore from monty.serialization import dumpfn @pytest.fixture() def mongostore(): st...
11,580
test version paths with latest commcare version
from testil import eq import commcare_translations def test_version_paths_language_only(): eq( commcare_translations.get_translation_file_paths('en'), ['../messages_en-1.txt'] ) def test_version_paths_with_two_versions(): eq( commcare_translations.get_translation_file_paths('en'...
11,581
test file providers
from __future__ import annotations import os from pathlib import Path from textwrap import dedent from typing import TYPE_CHECKING, Iterator import pytest from commitizen.config.base_config import BaseConfig from commitizen.exceptions import VersionProviderUnknown from commitizen.providers import ( CargoProvider...
11,582
test from tags wrong length
# coding=utf-8 # Copyright 2021-present, the Recognai S.L. 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 ...
11,583
get cpu specific options
#=============================================================================== # Copyright 2020 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.o...
11,584
test uint8
import numpy as np import pyqtgraph as pg from pyqtgraph.Qt import QtGui def check_format(shape, dtype, levels, lut, expected_format): data = np.zeros(shape, dtype=dtype) item = pg.ImageItem(axisOrder='row-major') item.setImage(data, autoLevels=False, lut=lut, levels=levels) item.render() assert ...
11,585
get all users
""" (c) Copyright Ascensio System SIA 2023 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...
11,586
finalize block construction
# ___________________________________________________________________________ # # 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 ...
11,587
test file
#!/usr/bin/python # Test tool to disassemble MC files. By Nguyen Anh Quynh, 2017 import array, os.path, sys from capstone import * # convert all hex numbers to decimal numbers in a text def normalize_hex(a): while(True): i = a.find('0x') if i == -1: # no more hex number break h...
11,588
ordered iter
# ___________________________________________________________________________ # # 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 ...
11,589
test get dmd diff codes match
import pytest from codelists.views.version_diff import summarise def test_get(client, version_with_no_searches, version_with_some_searches): rsp = client.get(version_with_no_searches.get_diff_url(version_with_some_searches)) assert rsp.status_code == 200 rsp = client.get(version_with_some_searches.get_d...
11,590
update order
import datetime from sysexecution.orders.named_order_objects import missing_order from sysexecution.order_stacks.order_stack import orderStackData from sysexecution.orders.broker_orders import brokerOrder from sysexecution.tick_data import tickerObject class brokerOrderStackData(orderStackData): def _name(self)...
11,591
add del fdb
""" This module defines a class useful to work with "bridge" tool. Copyright 2015 Mellanox Technologies. All rights reserved. Licensed under the GNU General Public License, version 2 as published by the Free Software Foundation; see COPYING for details. """ __author__ = """ jiri@mellanox.com (Jiri Pirko) """ from ln...
11,592
forward
import dgl import dgl.function as fn import torch.nn as nn from modules.initializers import GlorotOrthogonal from modules.residual_layer import ResidualLayer class InteractionPPBlock(nn.Module): def __init__( self, emb_size, int_emb_size, basis_emb_size, num_radial, ...
11,593
delete database
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE.txt in the project root for # license information. # ------------------------------------------------------------------------- import azur...
11,594
inotify thread
import threading import archr from PySide6.QtCore import Qt from PySide6.QtWidgets import QHBoxLayout, QMainWindow, QMessageBox, QPushButton, QVBoxLayout from qtterm import TerminalWidget from angrmanagement.plugins import BasePlugin from angrmanagement.ui.views import BaseView from angrmanagement.ui.views.interactio...
11,595
main
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2018, Sebastian Schenzel <sebastian.schenzel@mailbox.org> # 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, div...
11,596
build embedding
# 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 typing import Dict, List, Optional, Tuple import torch import torch.nn as nn from fairseq import utils from fairseq.dataclass.utils impo...
11,597
rotate image
#!python #!/usr/bin/env python -tt # encoding: utf-8 # # Created by Holger Rapp on 2009-03-11. # HolgerRapp@gmx.net # import pycuda.driver as cuda import pycuda.compiler import pycuda.autoinit import numpy from math import pi,cos,sin _rotation_kernel_source = """ texture<float, 2> tex; __global__ void copy_texture_...
11,598
parse args
# Copyright (c) OpenMMLab. All rights reserved. import argparse import math import os import os.path as osp import mmcv import mmengine from mmocr.utils import dump_ocr_data def collect_files(img_dir, gt_dir): """Collect all images and their corresponding groundtruth files. Args: img_dir (str): The...
11,599
outputs
# SPDX-License-Identifier: Apache-2.0 # automatically generated by the FlatBuffers compiler, do not modify # namespace: tflite import flatbuffers from flatbuffers.compat import import_numpy np = import_numpy() class SubGraph(object): __slots__ = ['_tab'] @classmethod def GetRootAs(cls, buf, offset=0): ...