id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
12,400 | iq to bytes | from collections import OrderedDict
from multiprocessing import Array
from multiprocessing.connection import Connection
import numpy as np
import pyaudio
from urh.dev.native.Device import Device
from urh.util.Logger import logger
class SoundCard(Device):
DEVICE_LIB = pyaudio
ASYNCHRONOUS = False
DEVICE_... |
12,401 | draw particles | #!/usr/bin/python3
'''!
@Author: wpx
@File Name: miaoting.py
@Mail: wpx15673207315@gmail.com
@Created Time: 2023年08月21日 星期一 09时25分56秒
@bref
@ref
'''
import numpy as np
import matplotlib.pyplot as plt
G = np.array([0, 12000 * -9.8])
REST_DENS = 1000. #流体的静态密度
GAS_CONST = 2000. #K:为与流体相关的常数
H = ... |
12,402 | remote cmd | # filename: Keithley_2000.py
# version 0.1 written by JB,JNV, HR@KIT 2017-
# QKIT driver for a Keithley Multimeter 2000
# 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 ... |
12,403 | browse for file | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
try:
basestring
except NameError:
basestring = str
import os
import sys
import ast
from compas_rhino.forms import TextForm
from compas_rhino.forms import ImageForm
import System
import rhinoscriptsy... |
12,404 | from config | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... |
12,405 | get name | # -*- coding: utf-8 -*-
#
# Copyright (c) 2009- Spyder Project Contributors
#
# Distributed under the terms of the MIT License
# (see spyder/__init__.py for details)
"""
Switcher Plugin.
"""
# Standard library imports
import sys
# Third-party imports
from qtpy.QtCore import Signal
# Local imports
from spyder.api.tr... |
12,406 | test update es user with groups | import uuid
from unittest.mock import patch
from django.test import SimpleTestCase, TestCase
from corehq.apps.change_feed import data_sources, topics
from corehq.apps.change_feed.document_types import change_meta_from_doc
from corehq.apps.change_feed.producer import producer
from corehq.apps.change_feed.topics import... |
12,407 | get bool | """Darwin/macOS implementation of AbstractConfig."""
import pathlib
import sys
from typing import Any, Dict, List, Union
from Foundation import ( # type: ignore
NSApplicationSupportDirectory, NSBundle, NSDocumentDirectory, NSSearchPathForDirectoriesInDomains, NSUserDefaults,
NSUserDomainMask
)
from config im... |
12,408 | construct yaml binary | from collections.abc import Callable, Hashable
from datetime import date
from re import Pattern
from typing import Any, ClassVar, TypeVar
from typing_extensions import TypeAlias
from yaml.error import MarkedYAMLError
from yaml.nodes import MappingNode, Node, ScalarNode, SequenceNode
from .cyaml import _CLoader
from .... |
12,409 | suggested duration | #
# Potassium current (IK) toy model based on the model by Hodgkin & Huxley (HH).
#
# This file is part of PINTS (https://github.com/pints-team/pints/) which is
# released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
#
import numpy as np
import pints
fr... |
12,410 | function | # Copyright 2022 NREL
# 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
# distri... |
12,411 | assert service runs db row | # pylint: disable=not-context-manager
# pylint: disable=redefined-outer-name
# pylint: disable=unused-argument
# pylint: disable=unused-variable
from collections.abc import AsyncIterable, Callable
from datetime import datetime, timezone
from typing import Any
import httpx
import pytest
import sqlalchemy as sa
from as... |
12,412 | list | r"""
List of coset representatives for `\Gamma_1(N)` in `\SL_2(\ZZ)`
"""
# ****************************************************************************
# Sage: Open Source Mathematical Software
#
# Copyright (C) 2005 William Stein <wstein@gmail.com>
#
# Distributed under the terms of the GNU General Publi... |
12,413 | fns | """
This is the a dummy proxy-minion designed for testing the proxy minion subsystem.
"""
import copy
import logging
import os
import pprint
from contextlib import contextmanager
import salt.utils.files
import salt.utils.msgpack
from salt.exceptions import CommandExecutionError, MinionError
# This must be present or... |
12,414 | test plugs | ##########################################################################
#
# Copyright (c) 2013, Image Engine Design 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:
#
# * Redistrib... |
12,415 | table field to avro field | #
# 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 us... |
12,416 | transcribe backend | import json
from moto.core.responses import BaseResponse
from moto.utilities.aws_headers import amzn_request_id
from .models import transcribe_backends, TranscribeBackend
class TranscribeResponse(BaseResponse):
def __init__(self) -> None:
super().__init__(service_name="transcribe")
@property
def... |
12,417 | animate | #!/usr/bin/env python
"""
Test multi
"""
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import pygimli as pg
from pygimli.solver import parseArgToArray
from pygimli.physics.seismics import ricker, solvePressureWave
import pygimli.meshtools as mt
def createCac... |
12,418 | read dp reg | # Ref: https://static.docs.arm.com/ihi0031/c/IHI0031C_debug_interface_as.pdf
# Document Number: IHI0031C
# Accession: G00027
import logging
import argparse
from ....support.aobject import *
from ....arch.jtag import *
from ....arch.arm.jtag import *
from ....arch.arm.dap.dp import *
from ...interface.jtag_probe impor... |
12,419 | components | # 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__ ... |
12,420 | get id template for | # -*- coding: utf-8 -*-
#
# This file is part of SENAITE.CORE.
#
# SENAITE.CORE 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, bu... |
12,421 | reverse | # Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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
... |
12,422 | send json | from __future__ import annotations
import asyncio
from abc import ABC, abstractmethod
from contextlib import suppress
from typing import TYPE_CHECKING, Any, AsyncGenerator, Dict, Optional, cast
from graphql import ExecutionResult as GraphQLExecutionResult
from graphql import GraphQLError
from strawberry.subscription... |
12,423 | test complete links | # encoding: utf-8
# Copyright (c) 2001-2022, Hove and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Hove (www.hove.com).
# Help us simplify mobility and open p... |
12,424 | get num fan drawers | """ This module provides interface to interact with the chassis of the DUT
via platform API remotely """
import json
import logging
import re
logger = logging.getLogger(__name__)
INBAND_PORT_REGEX = (r"(Ethernet-IB)(\d+)$")
def chassis_api(conn, name, args=None):
if args is None:
args = []
conn... |
12,425 | test segmentize | import platform
import weakref
import numpy as np
import pytest
import shapely
from shapely import (
GeometryCollection,
LinearRing,
LineString,
MultiLineString,
MultiPoint,
MultiPolygon,
Point,
Polygon,
)
from shapely.errors import ShapelyDeprecationWarning
from shapely.testing import... |
12,426 | test context manager does not suppress exception | # -*- coding: utf-8 -*-
"""
Tests for pika.adapters.blocking_connection.BlockingChannel
"""
from collections import deque
import unittest
from unittest import mock
from pika.adapters import blocking_connection
from pika import channel
BLOCKING_CHANNEL = 'pika.adapters.blocking_connection.BlockingChannel'
BLOCKING_CO... |
12,427 | get trace parent | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""Fake implementation of AbstractSpan for tests."""
from contextlib import contextmanager
from azure.core.tracing import HttpSpanMixin, SpanKind
from typing import Unio... |
12,428 | test commit name for latest version | from django.test import TestCase
from django.test.utils import override_settings
from django_dynamic_fixture import get
from readthedocs.builds.constants import BRANCH, EXTERNAL, LATEST, TAG
from readthedocs.builds.models import Version
from readthedocs.projects.models import Project
class VersionMixin:
fixtures... |
12,429 | test individual spike trains true by default | # -*- coding: utf-8 -*-
#
# test_sinusoidal_poisson_generator.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 versio... |
12,430 | get asic id for logical port | import sys
import click
from . import cli as clicommon
from sonic_py_common import multi_asic, device_info
platform_sfputil = None
platform_chassis = None
platform_sfp_base = None
platform_porttab_mapping_read = False
RJ45_PORT_TYPE = 'RJ45'
def load_platform_sfputil():
global platform_sfputil
try:
... |
12,431 | get trusted id provider | # 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__ =... |
12,432 | test standard bool coder | #
# 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 us... |
12,433 | run | """
:author: Golita Yue <gyue@redhat.com>
:author: Amos Kong <akong@redhat.com>
"""
import time
import re
import os
from virttest import data_dir
from virttest import error_context
from virttest import utils_misc
from virttest import utils_test
from provider import win_driver_utils
@error_context.context_aware
def M... |
12,434 | test full ignored scope | # 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... |
12,435 | set up | # Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Tests for comment views."""
from django.urls import reverse
from weblate.trans.models import Comment
from weblate.trans.tests.test_views import FixtureTestCase
class CommentViewTest(FixtureTestCase):
def METHOD_NAM... |
12,436 | hash 256 | import os
import time
import tempfile
import threading
import urllib.parse
import pycurl
from hashlib import sha256
from io import BytesIO
from tenacity import retry, wait_random_exponential, stop_after_attempt
from openpilot.common.file_helpers import mkdirs_exists_ok, atomic_write_in_dir
# Cache chunk size
K = 1000
... |
12,437 | search sim top n | #
# Copyright (C) from 2009 to Present EPAM Systems.
#
# This file is part of Indigo toolkit.
#
# 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
#
... |
12,438 | test batch raw | import os
import pytest
import salt.utils.files
import salt.utils.platform
from tests.support.case import ModuleCase
@pytest.mark.windows_whitelisted
class StdTest(ModuleCase):
"""
Test standard client calls
"""
def setUp(self):
self.TIMEOUT = 600 if salt.utils.platform.is_windows() else 10... |
12,439 | close event | from qtpy import QtCore, QtGui, QtWidgets
from openpype import resources, style
class WidgetUserIdle(QtWidgets.QWidget):
SIZE_W = 300
SIZE_H = 160
def __init__(self, module):
super(WidgetUserIdle, self).__init__()
self.setWindowTitle("OpenPype - Stop timers")
icon = QtGui.QIcon(... |
12,440 | test circular references force order | from pathlib import Path
from io import StringIO
import pytest
from snowfakery.cci_mapping_files.declaration_parser import (
SObjectRuleDeclaration,
SObjectRuleDeclarationFile,
unify,
)
from snowfakery.cli import generate_cli
import yaml
declarations = [
SObjectRuleDeclaration(sf_object="foo", priorit... |
12,441 | test negative | import random
import time
import networkx as nx
from networkx.algorithms.isomorphism.tree_isomorphism import (
rooted_tree_isomorphism,
tree_isomorphism,
)
from networkx.classes.function import is_directed
# have this work for graph
# given two trees (either the directed or undirected)
# transform t2 accordi... |
12,442 | automation runbook update | # --------------------------------------------------------------------------
# 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 cause incor... |
12,443 | test run | """Tests for distutils.command.build_clib."""
import unittest
import os
import sys
from test.test_support import run_unittest
from distutils.command.build_clib import build_clib
from distutils.errors import DistutilsSetupError
from distutils.tests import support
from distutils.spawn import find_executable
class Buil... |
12,444 | check virtual site exclusion policy | """
Helper functions for exporting virutal sites to OpenMM.
"""
from typing import Union
import numpy
from openff.units import Quantity, unit
from openff.units.openmm import to_openmm
from openff.utilities.utilities import has_package
from openff.interchange import Interchange
from openff.interchange.components._part... |
12,445 | test enroll no customer token | import requests
import pytest
from benefits.enrollment.api import ApiError, Client, CustomerResponse, GroupResponse
REQUESTS_ERRORS = [requests.ConnectionError, requests.Timeout, requests.TooManyRedirects, requests.HTTPError]
@pytest.fixture
def api_client(model_TransitAgency):
return Client(model_TransitAgen... |
12,446 | test no memory | """Test the interactive interpreter."""
import sys
import os
import unittest
import subprocess
from textwrap import dedent
from test.support import cpython_only, SuppressCrashReport
from test.support.script_helper import kill_python
def spawn_repl(*args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, **kw):
""... |
12,447 | deconstruct | import ipaddress
import re
from django.conf import settings
from django.core import exceptions
from django.core.validators import RegexValidator, URLValidator
from django.db import models
from django.forms import fields
from django.utils.translation import gettext_lazy as _
from captcha.fields import ReCaptchaField a... |
12,448 | test registered | from __future__ import annotations
import asyncio
import os
import random
import warnings
import pytest
import dask
from distributed import Client, Scheduler, Worker
from distributed.comm import connect, listen, ws
from distributed.comm.core import FatalCommClosedError
from distributed.comm.registry import backends... |
12,449 | test save errors unable to write file | """Tests for certbot.plugins.storage.PluginStorage"""
import json
import sys
from typing import Iterable
from typing import List
from typing import Optional
import unittest
from unittest import mock
import pytest
from certbot import errors
from certbot.compat import filesystem
from certbot.compat import os
from certb... |
12,450 | val processor | import logging
import warnings
from typing import Callable, Dict, List, Optional, Union
import numpy as np
import PIL
from PIL import ImageFile
from torch import nn
from ..constants import COLUMN, IMAGE, IMAGE_META, IMAGE_VALID_NUM, PROMPT, TEXT
from .collator import ListCollator, PadCollator
from .utils import is_ro... |
12,451 | pickle obj | # coding: utf-8
import pickle
from functools import lru_cache
import cloudpickle
import joblib
import numpy as np
import sklearn.datasets
from sklearn.utils import check_random_state
import lightgbm as lgb
SERIALIZERS = ["pickle", "joblib", "cloudpickle"]
@lru_cache(maxsize=None)
def load_breast_cancer(**kwargs):
... |
12,452 | init | """
Arista pyeapi
=============
.. versionadded:: 2019.2.0
Proxy module for managing Arista switches via the eAPI using the
`pyeapi <http://pyeapi.readthedocs.io/en/master/index.html>`_ library.
:codeauthor: Mircea Ulinic <ping@mirceaulinic.net>
:maturity: new
:depends: pyeapi
:platform: unix
.. note::
... |
12,453 | main | #!/usr/bin/env python3
import os
import sys
from functools import partial
from argparse import Namespace
import multiprocessing
from typing import Union
from datetime import datetime
from ..logger import Logger
from .commons import utils
from .commons.tap_mysql import FastSyncTapMySql
from .commons.target_postgres imp... |
12,454 | query | #!/usr/bin/env python
# coding=utf-8
import config
import requests
import json
errcodelist = {
'0': 'Exec success',
'-1': 'Internal error',
'-2': 'Server init fail',
'-3': 'Server start fail',
'-4': 'Service is stop',
'-5': 'BadRequest: Invalid request',
'-6': 'Task already exist',
'-7'... |
12,455 | query parameters | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
12,456 | refresh from db | # SPDX-License-Identifier: MPL-2.0
# Copyright (C) 2021 - 2022 Gemeente Amsterdam, Vereniging van Nederlandse Gemeenten
"""
QuestionGraph service contains functionality that deals with QuestionGraph
structure (reachable questions and the like).
"""
import networkx
from signals.apps.questionnaires.app_settings import M... |
12,457 | on information | # Copyright 2004-2009 Joe Wreschnig, Michael Urman, Steven Robertson
# 2011-2017 Nick Boultbee
#
# 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
# (... |
12,458 | with numba compat strictness | # 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,459 | test encode | # Copyright (c) OpenMMLab. All rights reserved.
import os.path as osp
from unittest import TestCase
import numpy as np
from mmengine.fileio import load
from mmpose.codecs import VideoPoseLifting
from mmpose.registry import KEYPOINT_CODECS
class TestVideoPoseLifting(TestCase):
def get_camera_param(self, imgname... |
12,460 | has pyftpdlib | # Copyright (C) 2005-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... |
12,461 | python to sender callback | # Copyright 2016 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 wri... |
12,462 | return error function count | # You can find documentation about adding new checker here:
# http://pylint.pycqa.org/en/latest/how_tos/custom_checkers.html#write-a-checker
"""
#### How to add a new check?
1. Chose the lowest support level that the checker should check.
2. Add a new checker in the `<support>_level_checker.py` file.
1. Add a new ... |
12,463 | apigw http endpoint | from uuid import uuid4
import pytest
from requests import Request
from aws_lambda_powertools.shared.cookies import Cookie
from tests.e2e.utils import data_fetcher
from tests.e2e.utils.auth import build_iam_auth
@pytest.fixture
def alb_basic_listener_endpoint(infrastructure: dict) -> str:
dns_name = infrastructu... |
12,464 | normalize table path | from typing import Union
from ..utils import match_regexps
from ..abcs.database_types import (
Timestamp,
TimestampTZ,
DbPath,
ColType,
Float,
Decimal,
Integer,
TemporalType,
Native_UUID,
Text,
FractionalType,
Boolean,
AbstractTable,
)
from ..abcs.mixins import (
... |
12,465 | down | # SPDX-License-Identifier: Apache-2.0
# Copyright 2022 The HuggingFace Authors.
import contextlib
import logging
from libcommon.simple_cache import CachedResponseDocument
from mongoengine.connection import get_db
from pymongo.errors import InvalidName
from mongodb_migration.check import check_documents
from mongodb_... |
12,466 | resolve processing issue | from hashlib import sha1
from django.db import models
from django.db.models.aggregates import Count
from django.utils import timezone
from sentry.backup.scopes import RelocationScope
from sentry.db.models import (
BaseManager,
FlexibleForeignKey,
GzippedDictField,
Model,
region_silo_only_model,
... |
12,467 | test 3d | # Copyright (c) MONAI Consortium
# 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, so... |
12,468 | schema | from starlette.applications import Starlette
from starlette.endpoints import HTTPEndpoint
from starlette.routing import Host, Mount, Route, Router, WebSocketRoute
from starlette.schemas import SchemaGenerator
schemas = SchemaGenerator(
{"openapi": "3.0.0", "info": {"title": "Example API", "version": "1.0"}}
)
de... |
12,469 | test phase active project private | import pytest
import rules
from adhocracy4.projects.enums import Access
from adhocracy4.test.helpers import freeze_phase
from adhocracy4.test.helpers import freeze_post_phase
from adhocracy4.test.helpers import freeze_pre_phase
from adhocracy4.test.helpers import setup_phase
from adhocracy4.test.helpers import setup_u... |
12,470 | find message | from dataclasses import dataclass
from dataclasses import field
from typing import Dict
from typing import Iterator
from typing import List
from typing import Optional
from typing import TypeVar
from xsdata.codegen.models import get_name
from xsdata.exceptions import DefinitionsValueError
from xsdata.formats.dataclass... |
12,471 | analogue require dut and harness | # Copyright (c) 2020-2022, XMOS Ltd, All rights reserved
from pathlib import Path
import pytest
import time
import json
import platform
from usb_audio_test_utils import (
check_analyzer_output,
get_xtag_dut_and_harness,
AudioAnalyzerHarness,
XrunDut,
XsigInput,
XsigOutput,
)
from conftest impor... |
12,472 | gen in for | """
Test that no StopIteration is raised inside a generator
"""
# pylint: disable=missing-docstring,invalid-name,import-error, try-except-raise, wrong-import-position
# pylint: disable=not-callable,raise-missing-from,broad-exception-raised
import asyncio
class RebornStopIteration(StopIteration):
"""
A class in... |
12,473 | test no ending newline | """ Tests for the linecache module """
import linecache
import unittest
import os.path
import tempfile
import tokenize
from test import support
FILENAME = linecache.__file__
NONEXISTENT_FILENAME = FILENAME + '.missing'
INVALID_NAME = '!@$)(!@#_1'
EMPTY = ''
TEST_PATH = os.path.dirname(__file__)
MODULES = "linecache ... |
12,474 | unpackage can msg | #!/usr/bin/env python3
import random
import unittest
from panda import Panda, DLC_TO_LEN, USBPACKET_MAX_SIZE, pack_can_buffer, unpack_can_buffer
from panda.tests.libpanda import libpanda_py
lpp = libpanda_py.libpanda
CHUNK_SIZE = USBPACKET_MAX_SIZE
TX_QUEUES = (lpp.tx1_q, lpp.tx2_q, lpp.tx3_q, lpp.txgmlan_q)
def M... |
12,475 | test format 14 | import io
import os
import re
from fontTools import ttLib
from fontTools.fontBuilder import FontBuilder
import unittest
from fontTools.ttLib.tables._c_m_a_p import CmapSubtable, table__c_m_a_p
CURR_DIR = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
DATA_DIR = os.path.join(CURR_DIR, "data")
CMAP_FORMAT_... |
12,476 | test deprecate fn | import inspect
import sys
import pytest
from numpy.core import arange
from numpy.testing import assert_, assert_equal, assert_raises_regex
from numpy.lib import deprecate, deprecate_with_doc
import numpy.lib.utils as utils
from io import StringIO
@pytest.mark.skipif(sys.flags.optimize == 2, reason="Python running -... |
12,477 | display text impl | # This PCell instantiates two ebeam_dc_halfring_straight and adds a heater layer
# Mustafa Hammood, 2023
from . import *
from pya import *
class ebeam_ring_heater(pya.PCellDeclarationHelper):
"""
The PCell uses two ebeam_dc_halfring_straight PCells and adds a heater.
"""
def __init__(self):
# Important: ... |
12,478 | from data | # -*- coding: utf-8 -*-
"""
Created on Wed Feb 17 15:35:23 2021
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
from scipy import stats
from statsmodels.tools.decorators import cache_readonly
from statsmodels.distributions.tools import (
_Grid, cdf2prob_grid, prob2cdf_grid,
_eval_bernst... |
12,479 | arn | # 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,480 | print encapsulated | # -*- coding: utf-8 -*-
#
# latex_expression_printer.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 th... |
12,481 | get reopt response | # *********************************************************************************
# REopt, Copyright (c) 2019-2020, Alliance for Sustainable Energy, LLC.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions a... |
12,482 | test skip | # 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.
from tests import TestCase
import os
from senf import fsnative
from ... |
12,483 | parse args | #!/usr/bin/env python3
# -*- coding: utf-8; py-indent-offset: 4 -*-
#
# Author: Linuxfabrik GmbH, Zurich, Switzerland
# Contact: info (at) linuxfabrik (dot) ch
# https://www.linuxfabrik.ch/
# License: The Unlicense, see LICENSE file.
# https://github.com/Linuxfabrik/monitoring-plugins/blob/main/CONTRIBUTING.... |
12,484 | cell | import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from randomNAS_files.genotypes import STEPS
from randomNAS_files.utils import LockedDropout, embedded_dropout, mask2d
from torch.autograd import Variable
INITRANGE = 0.04
class DARTSCell(nn.Module):
def __init__(self, ninp, nhid, dro... |
12,485 | predict | # Mikel Broström 🔥 Yolo Tracking 🧾 AGPL-3.0 license
import numpy as np
from ..kalman_filter import KalmanFilter
from ..kalman_filter import multi_predict as kf_multi_predict
class ByteTrackKalmanFilterAdapter(KalmanFilter):
ndim = 4
def __init__(self, dt=1):
super().__init__(dim_x=2 * self.ndim, ... |
12,486 | dtanh dx | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import torch
import torch.nn as nn
from .. import constraints
from ..torch_transform import TransformModule
from ..util import copy_docs_from
from .householder import Householder
@copy_docs_from(TransformModule)
class Sylvester(... |
12,487 | test multi dimension case | import numpy
import unittest
import cupy
from cupy import testing
class TestMayShareMemory(unittest.TestCase):
@testing.numpy_cupy_equal()
def test_different_arrays(self, xp):
a = xp.array([1, 2, 3])
b = xp.array([1, 2, 3])
assert xp.may_share_memory(a, b) is False
@testing.nump... |
12,488 | get | # -*- coding: utf-8 -*-
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... |
12,489 | oned full toggled btn changed | # -*- coding: utf-8 -*-
# Dioptas - GUI program for fast processing of 2D X-ray diffraction data
# Principal author: Clemens Prescher (clemens.prescher@gmail.com)
# Copyright (C) 2014-2019 GSECARS, University of Chicago, USA
# Copyright (C) 2015-2018 Institute for Geology and Mineralogy, University of Cologne, Germany
... |
12,490 | on 200 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
12,491 | graphql query | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2019-present MagicStack Inc. and the EdgeDB 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... |
12,492 | wrap view | from builtins import object
from functools import update_wrapper
from django.urls import re_path
from .decorators import cradminview, has_access_to_cradmin_instance
#: The name of the app index view (the landing page for the app).
#: We do not enforce this, but we assume that each app has a
#: view with this name.
I... |
12,493 | main | # 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,494 | clustering per degree | from networkit import *
import numpy as np
import operator
import warnings
from .support import MissingDependencyError
try:
import matplotlib.pyplot as plt
except ImportError:
have_plt = False
else:
have_plt = True
try:
import pandas
except ImportError:
have_pandas = False
else:
have_pandas = True
try:
import se... |
12,495 | has features | from __future__ import annotations
import contextlib
import re
from abc import ABC
from typing import Tuple, Union
# TODO Is this base class (still) useful?
class Capabilities(ABC):
"""Represents capabilities of a connection / back end."""
def __init__(self, data):
pass
def version(self):
... |
12,496 | download anime list | from __future__ import absolute_import, unicode_literals
import os
from os import makedirs, path
import xml.etree.cElementTree as etree
import xml.etree.ElementTree as ET
from datetime import datetime, timedelta
import tempfile
import getpass
from appdirs import user_cache_dir
from simpleanidb.helper import download_f... |
12,497 | do command | # Copyright 2017 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 accompa... |
12,498 | mount data disks | import logging
from virttest import qemu_storage
from virttest import data_dir
from virttest import utils_disk
from virttest.qemu_capabilities import Flags
from provider import backup_utils
from provider.virt_storage.storage_admin import sp_admin
LOG_JOB = logging.getLogger('avocado.test')
class BlockDevSnapshotT... |
12,499 | update ui | # -*- coding: utf-8 -*-
"""
Description:
define the object to initialize the plot option subwindow
Author: YingzhiGou
Date: 20/06/2017
"""
from qtpy import QtCore
from qtpy.QtWidgets import QWidget, QMessageBox
from mtpy.gui.SmartMT.gui.busy_indicators import BusyOverlay
from mtpy.gui.SmartMT.ui_a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.