id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
16,900 | configure ed m4 hep | """Class for output file configuration"""
import logging
from DDSim.Helper.ConfigHelper import ConfigHelper
logger = logging.getLogger(__name__)
#: True if DD4hep was built with LCIO
DD4HEP_USE_LCIO = "@DD4HEP_USE_LCIO@" != "OFF"
#: True if DD4hep was built with EDM4hep
DD4HEP_USE_EDM4HEP = "@DD4HEP_USE_EDM4HEP@" !=... |
16,901 | merge yamls | import functools
import glob
from typing import Any, Dict, List, Mapping, Sequence, Type
import yaml
import dagster._check as check
from .merger import deep_merge_dicts
YAML_TIMESTAMP_TAG = "tag:yaml.org,2002:timestamp"
YAML_STR_TAG = "tag:yaml.org,2002:str"
class _CanRemoveImplicitResolver:
# Adds a "remove_... |
16,902 | add error listener | #
# Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
# Use of this file is governed by the BSD 3-clause license that
# can be found in the LICENSE.txt file in the project root.
#
from __builtin__ import unicode
from antlr4.Token import Token
from antlr4.error.ErrorListener import ProxyErrorListener, Cons... |
16,903 | prepare request | # 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 ... |
16,904 | get private link services for m365 security | # 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... |
16,905 | test cuda variables darwin | import pytest
from pytorch_pkg_helpers.cuda import get_cuda_arch_list, get_cuda_variables
from pytorch_pkg_helpers.utils import transform_cuversion
@pytest.mark.parametrize("package_type", ["conda", "wheel"])
def METHOD_NAME(package_type):
assert get_cuda_variables(package_type, "darwin", "cpu") == [
"ex... |
16,906 | step time indexed variables | # ___________________________________________________________________________
#
# 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 ... |
16,907 | include file | # Copyright 2010 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... |
16,908 | sqlite case sensitive like | # -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# ... |
16,909 | create path mappings | # Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
import shutil
import subprocess
import pytest
from pex.pep_440 import Version
from pex.pep_503 import ProjectName
from pex.resolve.locked_resolve import LockedRequirement
from ... |
16,910 | sentry wrapped callback | """
Instrumentation for Django 3.0
Since this file contains `async def` it is conditionally imported in
`sentry_sdk.integrations.django` (depending on the existence of
`django.core.handlers.asgi`.
"""
import asyncio
from sentry_sdk import Hub, _functools
from sentry_sdk._types import TYPE_CHECKING
from sentry_sdk.co... |
16,911 | get submodule dirs | # internal use only for CI
# some CI related util functions
#
# SPDX-FileCopyrightText: 2020-2023 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
#
import contextlib
import logging
import os
import subprocess
import sys
from typing import Any, List, Optional, Set, Union
IDF_PATH = os.path.abs... |
16,912 | test no fetch missing tiles | # This file is part of the MapProxy project.
# Copyright (C) 2012 Omniscale <http://omniscale.de>
#
# 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... |
16,913 | real extract | import json
from .common import InfoExtractor
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
mimetype2ext,
try_get,
urljoin,
)
class YandexDiskIE(InfoExtractor):
_VALID_URL = r'''(?x)https?://
(?P<domain>
yadi\.sk|
disk\.yandex\.
... |
16,914 | test dims | import os.path
import numpy as np
import pytest
from podpac.core.data.dataset_source import Dataset
class TestDataset(object):
"""test xarray dataset source"""
source = os.path.join(os.path.dirname(__file__), "assets/dataset.nc")
lat = [0, 1, 2]
lon = [10, 20, 30, 40]
time = np.array(["2018-01-... |
16,915 | test split backend metadata to separate files | import glob
import os
import mongomock
import pytest
from saml2.config import Config
from saml2.mdstore import MetaDataFile
from saml2.sigver import security_context
from satosa.scripts.satosa_saml_metadata import create_and_write_saml_metadata
@pytest.fixture
def oidc_frontend_config(signing_key_path):
data = ... |
16,916 | main | #!/usr/bin/env python
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
16,917 | list effective virtual network by network group | # 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... |
16,918 | test is epsilon nash no indptr | """
Tests for mclennan_tourky.py
"""
import numpy as np
from numpy.testing import assert_array_equal, assert_raises, assert_
from quantecon.game_theory import Player, NormalFormGame, mclennan_tourky
from quantecon.game_theory.mclennan_tourky import (
_best_response_selection, _flatten_action_profile, _is_epsilon_na... |
16,919 | test device selector update view check connected | # -*- coding: utf-8 -*-
"""
Tests for custom widgets made for Mu.
"""
from unittest import mock
import pytest
import mu.interface.main
import mu.interface.themes
import mu.interface.editor
@pytest.fixture
def microbit():
"""
Fixture for easy setup of microbit device in tests
"""
microbit = mu.logic.D... |
16,920 | get default index | from typing import Dict, List, Optional
import torch
import torch.nn as nn
from torchtext.utils import _log_class_usage
class Vocab(nn.Module):
__jit_unused_properties__ = ["is_jitable"]
r"""Creates a vocab object which maps tokens to indices.
Args:
vocab (torch.classes.torchtext.Vocab or torcht... |
16,921 | assert nested dict contains | from django.test import SimpleTestCase, TestCase
from parameterized import parameterized
from pyparsing import ParseException
from elasticsearch_dsl import Q
from elasticsearch_dsl.query import SimpleQueryString as S, Bool as B
from kitsune.search.parser import Parser
class ElasticQueryContainsMixin(object):
def... |
16,922 | test line identify | import numpy as np
from numpy.testing import assert_allclose
import pytest
import astropy.units as u
from astropy.table import QTable
from specutils import Spectrum1D
from jdaviz.core.linelists import get_available_linelists
def test_line_lists(specviz_helper):
spec = Spectrum1D(flux=np.random.rand(100)*u.Jy,
... |
16,923 | get | # Copyright (c) 2021, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import re
import frappe
from frappe.app import make_form_dict
from frappe.desk.search import get_names_for_mentions, search_link, search_widget
from frappe.tests.utils import FrappeTestCase
from frappe.utils import set_re... |
16,924 | make release tree | #!/usr/bin/env python3
# Setup script for PyPI; use CMakeFile.txt to build extension modules
import contextlib
import os
import re
import shutil
import string
import subprocess
import sys
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Dict, Iterator, List, Union
import setuptools... |
16,925 | set target and gap | import typing as T
from cumulusci.core import exceptions as exc
class RunUntilBase:
# subclasses need to fill in these two fields
sobject_name: str = None
target: int = None
gap: int = None
def METHOD_NAME(
self, sobject_name: T.Optional[str], num_as_str: T.Union[str, int]
):
... |
16,926 | peakmem load composite | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2021 Satpy developers
#
# This file is part of satpy.
#
# satpy 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... |
16,927 | test future interface bad host | # pylint: skip-file
from __future__ import absolute_import, division, print_function
import errno
import os
import signal
import socket
from subprocess import Popen
import sys
import time
from salt.ext.tornado.netutil import BlockingResolver, ThreadedResolver, is_valid_ip, bind_sockets
from salt.ext.tornado.stack_con... |
16,928 | get lti roles | """
Configurations to render Course Live Tab
"""
from django.contrib.auth.base_user import AbstractBaseUser
from django.utils.translation import gettext_lazy
from lti_consumer.models import LtiConfiguration
from opaque_keys.edx.keys import CourseKey
from common.djangoapps.student.roles import CourseInstructorRole, Cou... |
16,929 | get cache policy output | # 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... |
16,930 | parse example proto | #
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 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 app... |
16,931 | get router configuration | # 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... |
16,932 | extract chapter name | from dev_tools.utils import LuaLoader
from module.base.utils import location2node
from module.logger import logger # Change folder automatically
from module.os.map_data import DIC_OS_MAP
class OSChapter:
def __init__(self):
self.chapter = {}
data = LOADER.load('sharecfg/world_chapter_random.lua')... |
16,933 | split submission | #!/usr/bin/env python3
# Contest Management System - http://cms-dev.github.io/
# Copyright © 2013 Luca Wehrstedt <luca.wehrstedt@gmail.com>
#
# 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 Foundati... |
16,934 | cast time | #!/usr/bin/env python3
import os
import re
import yaml
import shutil
from typing import Sequence, Iterable, Union, Mapping
import numpy as np
import xarray as xr
import tempfile
import logging
import click
from toolz import groupby
from itertools import chain
from .gsutil import authenticate, upload_dir, download_direc... |
16,935 | specific potential | #-------------------------------------------------------------------------------
# PointPotential base class
#-------------------------------------------------------------------------------
from PYB11Generator import *
from GenericBodyForce import *
from RestartMethods import *
@PYB11template("Dimension")
class PointP... |
16,936 | main | #!/usr/bin/env python
# Copyright 2023 Google LLC
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import codecs
import math
import os
import re
import sys
import yaml
sys.path.insert(0, os.path.dirname(os.path.abspath(... |
16,937 | get website room | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# License: MIT. See LICENSE
from contextlib import suppress
import redis
import frappe
from frappe.utils.data import cstr
def publish_progress(percent, title=None, doctype=None, docname=None, description=None):
publish_realtime(
"progress",
... |
16,938 | get service record by id | from tapiriik.services import *
from .service_record import ServiceRecord
from tapiriik.database import db, cachedb
from bson.objectid import ObjectId
# Really don't know why I didn't make most of this part of the ServiceBase.
class Service:
# These options are used as the back for all service record's configurat... |
16,939 | version 1 | # SPDX-License-Identifier: Apache-2.0
""" tf2onnx mapping functions for onnx ml domain. """
import logging
import numpy as np
from onnx import TensorProto
from onnx import numpy_helper
from tf2onnx import constants
from tf2onnx.handler import tf_op
from tf2onnx import utils
logger = logging.getLogger(__name__)
# py... |
16,940 | tip rack def | """ProtocolEngine shared test fixtures."""
from __future__ import annotations
import pytest
from typing import TYPE_CHECKING
from decoy import Decoy
from opentrons_shared_data import load_shared_data
from opentrons_shared_data.deck import load as load_deck
from opentrons_shared_data.deck.dev_types import DeckDefiniti... |
16,941 | invert | # Copyright (c) 2021 - 2023, Ilan Schnell; All Rights Reserved
#
# This stub, as well as util.pyi, are tested with Python 3.9 and mypy 0.950
from collections.abc import Iterable, Iterator, Sequence
from unittest.runner import TextTestResult
from typing import Any, BinaryIO, Dict, Union, overload
CodeDict = Dict[Any... |
16,942 | get by type | import logging
from typing import Optional
import requests
from fastapi import HTTPException, status
import schemas
from chalicelib.utils import pg_client, helper
from chalicelib.utils.TimeUTC import TimeUTC
def get_by_id(webhook_id):
with pg_client.PostgresClient() as cur:
cur.execute(
cur.... |
16,943 | accept state visitor | import logging
import os
import time
from random import random
from localstack import config
from localstack.aws.accounts import get_aws_account_id
from localstack.aws.api import RequestContext
from localstack.aws.api.kinesis import (
ConsumerARN,
Data,
HashKey,
KinesisApi,
PartitionKey,
Provis... |
16,944 | parse args | #!/usr/bin/env python
# -
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (c) 2020 Alexander V. Chernikov
#
# 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... |
16,945 | build for most tests | #!/usr/bin/env python3
import argparse
import json
import os
import subprocess
import sys
from typing import NoReturn
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
os.chdir(os.path.join(os.path.dirname(__file__), "../web"))
from version import ZULIP_VERSION
def build_for_prod_... |
16,946 | magma type | import abc
from magma.debug import debug_wire, debug_unwire
class MagmaProtocolMeta(type):
@abc.abstractmethod
def _to_magma_(cls):
# To retrieve underlying magma type.
raise NotImplementedError()
@abc.abstractmethod
def _qualify_magma_(cls, direction: 'Direction'):
# To qual... |
16,947 | visit value | # This code is part of Qiskit.
#
# (C) Copyright IBM 2023.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
16,948 | run | from __future__ import absolute_import, division, print_function
from iotbx.option_parser import option_parser
from scitbx.array_family import flex
import sys
from libtbx.utils import Sorry
from mmtbx import scaling
import math
from iotbx import data_plots
from six.moves import range
def plotit(fobs,
sigma... |
16,949 | add distributed load | # bluemira is an integrated inter-disciplinary design tool for future fusion
# reactors. It incorporates several modules, some of which rely on other
# codes, to carry out a range of typical conceptual fusion reactor design
# activities.
#
# Copyright (C) 2021-2023 M. Coleman, J. Cook, F. Franza, I.A. Maione, S. McInto... |
16,950 | find encoder | """
The MIT License (MIT)
Copyright (c) 2023 Arduino SA
Copyright (c) 2018 KPN (Jan Bogaerts)
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... |
16,951 | test usage | import unittest
from numba import njit
from numba.tests.support import TestCase, override_config
from numba.misc import llvm_pass_timings as lpt
timings_raw1 = """
===-------------------------------------------------------------------------===
... Pass execution timing report ...
===-----------... |
16,952 | test basic | # Owner(s): ["module: cuda graphs"]
import functools
import unittest
import torch
import torch._dynamo
import torch._dynamo.config
import torch._dynamo.test_case
import torch._dynamo.testing
from torch._dynamo.testing import same
from torch.testing._internal.common_utils import skipIfRocm, TEST_CUDA_GRAPH
def comp... |
16,953 | test distribution | # Copyright (c) 2017-2019 Uber Technologies, Inc.
# SPDX-License-Identifier: Apache-2.0
import pytest
import torch
from scipy.stats import ks_2samp
from torch.autograd import grad
import pyro
import pyro.distributions as dist
from pyro import poutine
from pyro.distributions.torch_distribution import MaskedDistributio... |
16,954 | etag | # 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... |
16,955 | parse | # coding=utf-8
"""Provider code for HeBits."""
from __future__ import unicode_literals
import logging
import re
from medusa import tv
from medusa.bs4_parser import BS4Parser
from medusa.helper.common import (
convert_size,
try_int,
)
from medusa.logger.adapters.style import BraceAdapter
from medusa.provider... |
16,956 | profile fragments | """
Profiles are a type of entity set that expresses the notion that several entities
(often from different collections) refer to the same real-world thing.
A special case exists where an entity is positively associated with a profle in
its own collection: this then becomes its "primary" profile. This means that an
en... |
16,957 | get optimizer variables | """Saver for eager mode TensorFlow."""
# 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/LIC... |
16,958 | service setup | import re
import tarfile
from contextlib import contextmanager
from dataclasses import dataclass
from io import BytesIO
from queue import Queue
import click
import pytest
from pytest_httpserver.pytest_plugin import PluginHTTPServer
from schemathesis.service import FileReportHandler, ServiceClient, ServiceReportHandle... |
16,959 | svc | from unittest.mock import patch, sentinel
import pytest
from h_matchers import Any
from h.models import Subscriptions
from h.services import SubscriptionService
from h.services.subscription import InvalidUnsubscribeToken, service_factory
class TestSubscriptionService:
def test_init(self, derive_key, SignedSeria... |
16,960 | out line received | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... |
16,961 | test read property | # Copyright (C) 2015 Peter Sooky <xsooky00@stud.fit.vutbr.cz>
#
# 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.
#
# Thi... |
16,962 | build platform | #!/usr/bin/env python3
#
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# 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... |
16,963 | 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... |
16,964 | ok press | #################################################################
# AlignTool.py
# Written by Yi-Hong Lin, yihhongl@andrew.cmu.edu, 2004
#################################################################
from direct.tkwidgets.AppShell import *
from direct.showbase.TkGlobal import *
class AlignTool(AppShell):
#####... |
16,965 | test total time | import torch
import torch._dynamo
import torch._dynamo.config
import torch._inductor.config as config
import triton
from benchmark_helper import time_with_torch_timer
# The flag below controls whether to allow TF32 on matmul. This flag defaults to True.
torch.backends.cuda.matmul.allow_tf32 = True
# The flag below co... |
16,966 | test importer access | # Owner(s): ["oncall: package/deploy"]
from io import BytesIO
from sys import version_info
from textwrap import dedent
from unittest import skipIf
from torch.package import PackageExporter, PackageImporter
from torch.testing._internal.common_utils import run_tests
try:
from .common import PackageTestCase
except ... |
16,967 | post operations | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
16,968 | test empty | from collections import OrderedDict
from copy import deepcopy
import attr
import pytest
from labgrid import Target, target_factory
from labgrid.driver import Driver
from labgrid.resource import Resource
from labgrid.exceptions import InvalidConfigError, RegistrationError
from labgrid.resource import SerialPort
from l... |
16,969 | inverse | # This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
16,970 | filter election | import sqlalchemy as sa
from flask_apispec import doc
from webservices import args
from webservices import docs
from webservices import utils
from webservices import schemas
from sqlalchemy.orm import aliased, contains_eager
from webservices.common import models
from webservices.common import views
from webservices.co... |
16,971 | test unknown model | """
dj-stripe Settings Tests.
"""
from unittest.mock import patch
import stripe
from django.core.exceptions import ImproperlyConfigured
from django.db.models.base import ModelBase
from django.test import TestCase
from django.test.utils import override_settings
from djstripe import settings
class TestSubscriberModel... |
16,972 | verifynd | from lpython import i32, f64, f32
from numpy import empty, sinh, cosh, reshape, int32, float32, float64, sin
def verify1d(array: f32[:], result: f32[:], size: i32):
i: i32
eps: f32 = f32(1e-6)
for i in range(size):
assert abs(sinh(sinh(array[i])) - result[i]) <= eps
def METHOD_NAME(array: f64[:, ... |
16,973 | binary | """:mod:`wand.compat` --- Compatibility layer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides several subtle things to support
multiple Python versions (2.7, 3.3+) and VM implementations
(CPython, PyPy).
"""
import collections
try:
import collections.abc
except ImportError:
pass
import con... |
16,974 | compute min return path | __author__ = ["chrisholder", "TonyBagnall"]
from typing import List, Tuple
import numpy as np
from sktime.utils.numba.njit import njit
@njit(cache=True)
def METHOD_NAME(
cost_matrix: np.ndarray, bounding_matrix: np.ndarray
) -> List[Tuple]:
"""Compute the minimum cost path through the cost matrix.
The... |
16,975 | cmp | import os
import re
import time
import uuid
import base64
import random
import string
import typing
import typing as t
import platform
from pathlib import Path
from datetime import datetime
from functools import partial, cmp_to_key
from contextlib import contextmanager
import yaml
from starwhale.consts import (
F... |
16,976 | main | #!/usr/bin/env python3
"""Set up a fake device."""
import argparse
import asyncio
from ipaddress import IPv4Address
import logging
import os
import sys
from zeroconf import Zeroconf
from pyatv.const import Protocol
from pyatv.core import mdns
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)) + "/..") #... |
16,977 | nh | """
Peewee integration with APSW, "another python sqlite wrapper".
Project page: https://rogerbinns.github.io/apsw/
APSW is a really neat library that provides a thin wrapper on top of SQLite's
C interface.
Here are just a few reasons to use APSW, taken from the documentation:
* APSW gives all functionality of SQLi... |
16,978 | set leap seconds enabled | # Sandbox for exploring the Windows "waitable timer" API.
# Cf https://github.com/python-trio/trio/issues/173
#
# Observations:
# - if you set a timer in the far future, then block in
# WaitForMultipleObjects, then set the computer's clock forward by a few
# years (past the target sleep time), then the timer immedi... |
16,979 | test setup bdist install2 | from subprocess import check_call
import os
import re
import shutil
import sys
import sysconfig
import unittest
cwd = os.path.dirname(__file__)
def _get_implementation():
if sys.implementation.name == 'pypy':
return 'pypy'
return 'python'
python_version = "{}{}.{}".format(_get_implementation(), sys.v... |
16,980 | is valid ipv4 private | """
This is a template for creating custom ColumnMapExpectations.
For detailed instructions on how to use it, please see:
https://docs.greatexpectations.io/docs/guides/expectations/creating_custom_expectations/how_to_create_custom_column_map_expectations
"""
import ipaddress
from typing import Optional
from great_... |
16,981 | load model weight | # Copyright 2021-2022 The Alibaba Fundamental Vision Team Authors. All rights reserved.
import cv2
import numpy as np
import torch
from modelscope.metainfo import Models
from modelscope.models.base import TorchModel
from modelscope.models.builder import MODELS
from modelscope.utils.constant import ModelFile, Tasks
fr... |
16,982 | get login absolute url | from typing import Any, Dict, List, Optional
from urllib.parse import urljoin
from django.conf import settings
from django.urls import reverse
from rest_framework import serializers
from baserow.api.utils import ExceptionMappingType
from baserow.core.auth_provider.auth_provider_types import AuthProviderType
from bas... |
16,983 | up | """Migration for a given Submitty course database."""
def METHOD_NAME(config, database, semester, course):
"""
Run up migration.
:param config: Object holding configuration details about Submitty
:type config: migrator.config.Config
:param database: Object for interacting with given database for ... |
16,984 | test deepcopy | # Copyright (C) 2022 Open Source Robotics 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
# Unless required by applicable law or ... |
16,985 | test train test simple mix with categorical | # ----------------------------------------------------------------------------
# Copyright (C) 2021-2023 Deepchecks (https://www.deepchecks.com)
#
# This file is part of Deepchecks.
# Deepchecks is distributed under the terms of the GNU Affero General
# Public License (version 3 or later).
# You should have received a ... |
16,986 | get webui config | """
Supports saving and restoring webui and extensions from a known working set of commits
"""
import os
import json
import time
import tqdm
from datetime import datetime
import git
from modules import shared, extensions, errors
from modules.paths_internal import script_path, config_states_dir
all_config_states = {... |
16,987 | should cache | from . import compat
import functools
import itertools
import torch
def is_cuda_enabled():
return torch.version.cuda is not None
def get_cuda_version():
return tuple(int(x) for x in torch.version.cuda.split('.'))
def is_fp_tensor(x):
if is_nested(x):
# Fast-fail version of all(is_fp_tensor)
... |
16,988 | create geom | # Copyright (c) 2023 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration. All Other
# 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 c... |
16,989 | preprocess | #!/usr/bin/env python3
# Copyright (C) 2022 Sophgo Technologies Inc. All rights reserved.
#
# TPU-MLIR is licensed under the 2-Clause BSD License except for the
# third-party components.
#
# ==============================================================================
import numpy as np
import argparse
import cv2
imp... |
16,990 | convert metadata | #! /usr/bin/env python3
import argparse
import xml.etree.ElementTree as et
import copy
import tempfile
import re
import os
import sys
import datetime
import base64
import hashlib
# the DXL namespace used
ns = {'dxl': 'http://greenplum.com/dxl/2010/12/'}
# GPDBScalarOp tags that this program knows how to fix (Mdid is... |
16,991 | bind component | from collections.abc import Iterable
from typing import (
Any,
Optional,
)
from reconcile.gql_definitions.fragments.vault_secret import VaultSecret
from reconcile.gql_definitions.statuspage.statuspages import (
AppV1,
ManualStatusProviderConfigV1,
ManualStatusProviderV1,
StatusPageComponentV1,
... |
16,992 | test python org | import unittest, StringIO, robotparser
from test import test_support
class RobotTestCase(unittest.TestCase):
def __init__(self, index, parser, url, good, agent):
unittest.TestCase.__init__(self)
if good:
self.str = "RobotTest(%d, good, %s)" % (index, url)
else:
self.... |
16,993 | check balance | # -*- coding: utf-8 -*-
"""
Created on Sat Nov 2 13:30:33 2013
@author: pietro
"""
from __future__ import absolute_import, division, print_function, unicode_literals
from gettext import lgettext as _
import numpy as np
from grass.script.core import overwrite
from grass.pygrass.vector import VectorTopo, Vector
from ... |
16,994 | 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
# --------------------------------... |
16,995 | header 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
# --------------------------------... |
16,996 | add keys2 into | from typing import *
# extmod/modtrezorcrypto/modtrezorcrypto-monero.h
class Point:
"""
EC point on ED25519
"""
def __init__(self, x: Point | bytes | None = None):
"""
Constructor
"""
# extmod/modtrezorcrypto/modtrezorcrypto-monero.h
class Scalar:
"""
EC scalar on SC2... |
16,997 | test get key | import datetime
from unittest.mock import Mock, patch
import pytest
import faust
from faust.events import Event
from faust.tables.wrappers import WindowSet, WindowWrapper
from faust.types import Message
class TableKey(faust.Record):
value: str
class TableValue(faust.Record):
id: str
num: int
KEY1 = ... |
16,998 | compile | """
Implementation of compiled C callbacks (@cfunc).
"""
import ctypes
from functools import cached_property
from numba.core import compiler, registry
from numba.core.caching import NullCache, FunctionCache
from numba.core.dispatcher import _FunctionCompiler
from numba.core.typing import signature
from numba.core.ty... |
16,999 | grid shape | """
Domain class definition.
"""
import logging
import numpy as np
from collections import OrderedDict
from ..tools.array import prod
from ..tools.cache import CachedMethod, CachedClass, CachedAttribute
from ..tools.general import unify_attributes, unify, OrderedSet
from .coords import Coordinate, CartesianCoordinate... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.