id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
11,900 | get workload instance output | # 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... |
11,901 | get user response | import json
import logging
import os
import sys
from django.conf import settings
from django.core.management.base import BaseCommand
from django.core.management.base import CommandError
from django.utils import six
from kolibri.core.auth.constants.facility_presets import presets
from kolibri.core.device.utils import ... |
11,902 | ctw | # -*- coding: utf-8 -*-
"""
Testing creation of Surveys using verbose methods
"""
from unittest import TestCase
from pyxform import Survey
from pyxform.builder import create_survey_element_from_dict
from tests.utils import prep_class_config
TESTING_BINDINGS = True
def METHOD_NAME(control):
"""
ctw stands fo... |
11,903 | test2log no line event | import unittest
from aminer.parsing.MatchContext import MatchContext
from aminer.parsing.FixedDataModelElement import FixedDataModelElement
from aminer.events.SyslogWriterEventHandler import SyslogWriterEventHandler
from time import time, sleep
from aminer.input.LogAtom import LogAtom
from aminer.parsing.ParserMatch im... |
11,904 | test group limited article without group returns | from urllib.parse import parse_qs
from django.conf import settings
from django.db.utils import IntegrityError
from django.template import Context
from django.test import TestCase, RequestFactory
from django.urls import reverse
from rest_framework import status
from wagtail.core.models import PageViewRestriction, Site
... |
11,905 | metadata key filter | from django.db.models import Q
from django.conf import settings
import karrio.server.filters as filters
import karrio.server.orders.serializers as serializers
import karrio.server.orders.models as models
import karrio.server.openapi as openapi
class OrderFilters(filters.FilterSet):
address = filters.CharFilter(
... |
11,906 | test cone shape | import pytest
# Skip these tests if we can't import bullet.
bullet = pytest.importorskip("panda3d.bullet")
from panda3d import core
def reconstruct(object):
# Create a temporary buffer, which we first write the object into, and
# subsequently read it from again.
buffer = core.DatagramBuffer()
writer... |
11,907 | view list | from _typeshed import SupportsItems, SupportsKeysAndGetItem
from _typeshed.wsgi import WSGIEnvironment
from cgi import FieldStorage
from collections.abc import Collection, Iterable, Iterator, MutableMapping
from typing import Any, TypeVar, overload
from typing_extensions import Literal, Self
_T = TypeVar("_T")
_KT = T... |
11,908 | energy | # Copyright 2021 The NetKet 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,909 | delete | # -*- coding: utf-8 -*-
#
# jQuery File Upload Plugin GAE Python Example
# https://github.com/blueimp/jQuery-File-Upload
#
# Copyright 2011, Sebastian Tschan
# https://blueimp.net
#
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT
#
from google.appengine.api import memcache, images
import jso... |
11,910 | match mapping | import re
from num2words import num2words
punctuation = r'[\s,.?!/)\'\]>]'
alphabet_map = {
"A": " Ei ",
"B": " Bee ",
"C": " See ",
"D": " Dee ",
"E": " Eee ",
"F": " Eff ",
"G": " Jee ",
"H": " Eich ",
"I": " Eye ",
"J": " Jay ",
"K": " Kay ",
"L": " El ",
"M": " ... |
11,911 | output var | # 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
... |
11,912 | test argumentcheck | import unittest
import sys
from test import test_support
class G:
'Sequence using __getitem__'
def __init__(self, seqn):
self.seqn = seqn
def __getitem__(self, i):
return self.seqn[i]
class I:
'Sequence using iterator protocol'
def __init__(self, seqn):
self.seqn = seqn
... |
11,913 | get id from name | from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Callable, Optional
import pytest
import ue.hierarchy
from ark.discovery import initialise_hierarchy
from ark.types import DCSC_CLS
from automate.ark import ArkSteamManager
from config import HIERARCHY_FILENAME, ConfigFile, get_global_... |
11,914 | get else clause | # -*- coding: utf-8 -*-
#
# ast_if_stmt.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 License, or... |
11,915 | test 02 snapshots are sorted | from doajtest.helpers import DoajTestCase
from esprit import raw, snapshot
from doajtest.fixtures.snapshots import SNAPSHOTS_LIST
from copy import deepcopy
from datetime import datetime, timedelta
import responses
from freezegun import freeze_time
from portality.lib import dates
class TestSnapshotClient(DoajTestCase... |
11,916 | location | # 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,917 | 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... |
11,918 | test espt search doesnt crash when no | import pytest
from CreeDictionary.API.search.core import SearchRun
from CreeDictionary.API.search.espt import EsptSearch, PhraseAnalyzedQuery
from CreeDictionary.API.search.types import Result
from morphodict.lexicon.models import Wordform
@pytest.mark.parametrize(
("query", "has_tags", "tags", "filtered_query")... |
11,919 | save | import re
from datetime import datetime
from django import forms
from django.conf import settings
from django.contrib.auth.models import Group, User
from django.core.cache import cache
from django.utils.translation import gettext_lazy as _lazy
from django.utils.translation import gettext as _
from kitsune.users.model... |
11,920 | test path valid token | import eventlet
eventlet.monkey_patch()
import unittest
import json
import base64
from auth import server
import xmlrunner
import psycopg2
import psycopg2.extensions
from pyinfraboxutils.ibopa import opa_push_all
from pyinfraboxutils.db import DB, connect_db
from pyinfraboxutils.token import encode_project_token
co... |
11,921 | release worker | # -*- coding: utf-8 -*-
# Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... |
11,922 | test invalid filename raises | import pytest
from pip._vendor.packaging.tags import Tag
from pip._internal.exceptions import InvalidWheelFilename
from pip._internal.models.wheel import Wheel
from pip._internal.utils import compatibility_tags
class TestWheelFile:
def test_std_wheel_pattern(self) -> None:
w = Wheel("simple-1.1.1-py2-non... |
11,923 | has key | # This module exports classes for the various canvas item types
# NOTE: This module was an experiment and is now obsolete.
# It's best to use the Tkinter.Canvas class directly.
from warnings import warnpy3k
warnpy3k("the Canvas module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
from Tkinter import Ca... |
11,924 | names 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,925 | f best | #
# Seperable natural evolution strategy optimizer: SNES
#
# 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.
#
# Some code in this file was adapted from Myokit (see http://m... |
11,926 | populate subtask names | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... |
11,927 | find measurable specify shapes | # Copyright 2023 The PyMC Developers
#
# 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 ag... |
11,928 | func decl iter | #! /usr/bin/env python3
"""Generate coroutine wrappers for block subsystem.
The program parses one or several concatenated c files from stdin,
searches for functions with the 'generated_co_wrapper' specifier
and generates corresponding wrappers on stdout.
Usage: block-coroutine-wrapper.py generated-file.c FILE.[ch]..... |
11,929 | notify account activated | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 ... |
11,930 | ex symmetric | from satplacer.global_router import Tech, Grid, ex_write_globalrouting_json
def ex_river_routing( max_capacity=1, different_net_max_capacity=1):
halfn = 10
n = 2*halfn
g = Grid( n, n)
for q in range(0,halfn):
g.addTerminal( 'a%d' % q, 0, q)
g.addTerminal( 'a%d' % q, n-1, q+halfn)
... |
11,931 | path | # Copyright (c) 2020 the original author or 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
11,932 | o m2ideal raw | from Singular import *
from interpreter import *
from objects import *
from util import create_ring
import cd.polyd, cd.primdec, cd.list1
from cd.polyd import DMPsym, SDMPsym, termsym, lpsym,dpsym,poly_ring_dsym, DMPLsym, implementation, groebnerdsym
from cd.fieldname1 import Qsym as Rationals
singular=SingularGlobalsP... |
11,933 | cmssw version to int | __author__ = 'Giacomo Govi'
import subprocess
import json
import os
import re
def check_cmssw_version( cmssw_version ):
if cmssw_version.find('CMSSW_')==-1:
raise Exception("CMSSW version '%s' has not been found in the expected format" %cmssw_version)
ver = cmssw_version
p = re.compile('(CMSSW_.... |
11,934 | create wrapper | ##
# Copyright 2020-2023 Forschungszentrum Juelich GmbH
#
# This file is triple-licensed under GPLv2 (see below), MIT, and
# BSD three-clause licenses.
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.... |
11,935 | check registered widget | """Functionality implementing the plasma class factory."""
# SunPy is released under a BSD-style open source license:
# Copyright (c) 2013-2018 The SunPy developers
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following co... |
11,936 | test serialization semihard | # Copyright 2019 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,937 | test can find path to cousin | # These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/pov/canonical-data.json
# File last updated on 2023-07-19
import unittest
from pov import (
Tree,
)
class PovTest(unittest.TestCase):
def test_results_in_the_same_tree_if_the_input_... |
11,938 | get cmdline | # -*- coding: utf-8 -*-
import os
import time
import logging
import nodes
import ConfigParser
import subprocess
import shlex
import re
import copy
import environment
import database
import server
import signal
from threading import Timer
# Windows does not have the pwd and grp module and does not need it since only U... |
11,939 | tmp t | from __future__ import annotations
from datetime import date
from operator import methodcaller
import pandas as pd
import pandas.testing as tm
import pytest
import sqlalchemy as sa
from pytest import param
from sqlalchemy.dialects import mysql
import ibis
import ibis.expr.datatypes as dt
from ibis.util import gen_na... |
11,940 | ease out in expo | #!/usr/bin/python3
"""
made with the file cjs/tweener/equations.js
Original copyright notice of the source file:
Copyright 2008 litl, LLC.
Equations
Main equations for the Tweener class
@author Zeh Fernando, Nate Chatellier
@version 1.0.2
Disclaimer for Rob... |
11,941 | degree on basis | r"""
Formal modules generated by polyhedra
"""
from sage.combinat.free_module import CombinatorialFreeModule
from sage.categories.graded_modules_with_basis import GradedModulesWithBasis
class FormalPolyhedraModule(CombinatorialFreeModule):
r"""
Class for formal modules generated by polyhedra.
It is forma... |
11,942 | configure args | # 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)
from spack.package import *
class Xpmem(AutotoolsPackage):
"""XPMEM is a Linux kernel module that enables a process ... |
11,943 | get company url | from django.conf import settings
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.core.mail import EmailMessage
from django.urls import reverse
from django.db import models
from django.db.models.signals import post_save
from django.dispatch import receiver
from... |
11,944 | test axis tuple | # Copyright 2021-2022 NVIDIA 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 ... |
11,945 | deco factory | # 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 distributed in the hope that it will be useful,
# bu... |
11,946 | as ctypes | #!/usr/bin/env python
"""
"""
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
from ctypes import *
class SDL_array:
def __init__(self, ptr, count, ctype):
"""Construct an array at memory location `ptr` with `count` elements
of type `ctype`.
:Parameters:
`ptr` : ct... |
11,947 | get events | """
Sync QMP Wrapper
This class pretends to be qemu.qmp.QEMUMonitorProtocol.
"""
import asyncio
from typing import (
Any,
Awaitable,
Dict,
List,
Optional,
TypeVar,
Union,
)
import qemu.qmp
from .error import QMPError
from .protocol import Runstate, SocketAddrT
from .qmp_client import QMP... |
11,948 | test efficient sets of samples with chained | # This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Copyright the Hypothesis Authors.
# Individual contributors are listed in AUTHORS.rst and the git log.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the... |
11,949 | stats | """
.. module: lemur.endpoints.service
:platform: Unix
:synopsis: This module contains all of the services level functions used to
administer endpoints in Lemur
:copyright: (c) 2018 by Netflix Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Kevin Glisson ... |
11,950 | set executables | from collections.abc import Callable
from typing import Any, ClassVar
from typing_extensions import TypeAlias
_Macro: TypeAlias = tuple[str] | tuple[str, str | None]
def gen_lib_options(
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
) -> list[str]: ...
def gen... |
11,951 | test contact visualizer | from pydrake.multibody.meshcat import (
ContactVisualizer_,
ContactVisualizerParams,
JointSliders,
_HydroelasticContactVisualizer,
_PointContactVisualizer,
)
import copy
import unittest
import numpy as np
from pydrake.common import (
FindResourceOrThrow,
)
from pydrake.common.test_utilities i... |
11,952 | has interface | class Interface:
def __str__(self):
a = ['ifconfig %s:'%self.name]
a += [' link_encap = ' + str(self.link_encap)]
a += [' scope = ' + str(self.scope)]
a += [' bcast = ' + str(self.bcast)]
a += [' mtu = ' + str(self.mtu)]
a += [' ipaddr = ' + str(self.ipaddr)]
... |
11,953 | on server init complete | # -*- coding: utf-8 -*-
""" *==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3... |
11,954 | test inference stream apis | import json
import os
from ast import literal_eval
import inference_pb2
import management_pb2
import test_gRPC_utils
import test_utils
inference_data_json = "../postman/inference_data.json"
inference_stream_data_json = "../postman/inference_stream_data.json"
def setup_module(module):
test_utils.torchserve_clean... |
11,955 | can remove org | # !/usr/bin/env python
# encoding: utf-8
"""
SEED Platform (TM), Copyright (c) Alliance for Sustainable Energy, LLC, and other contributors.
See also https://github.com/seed-platform/seed/main/LICENSE.md
"""
import json
from functools import wraps
from inspect import signature
from django.conf import settings
from dja... |
11,956 | toggle triangulation | # Copyright © 2012-2023 Forschungszentrum Jülich GmbH
# SPDX-License-Identifier: LGPL-3.0-or-later
import math
from pathlib import Path
from jupedsim_visualizer.geometry import Geometry
from jupedsim_visualizer.replay_widget import ReplayWidget
from jupedsim_visualizer.trajectory import Trajectory
from jupedsim_visual... |
11,957 | stub only | from conans import CMake, ConanFile, tools
from conans.errors import ConanInvalidConfiguration
import glob
import os
class GetDnsConan(ConanFile):
name = "getdns"
description = "A modern asynchronous DNS API"
topics = "conan", "getdns", "asynchronous", "event"
license = "BSD-3-Clause"
homepage = "... |
11,958 | test empty file | from pathlib import Path
from unittest.mock import mock_open, patch
import frappe
from frappe.modules import patch_handler
from frappe.tests.utils import FrappeTestCase
EMTPY_FILE = ""
EMTPY_SECTION = """
[pre_model_sync]
[post_model_sync]
"""
FILLED_SECTIONS = """
[pre_model_sync]
app.module.patch1
app.module.patch... |
11,959 | alias | # MIT License
#
# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, ... |
11,960 | test verify bbs proof vc mattr | from asynctest import TestCase
import pytest
from ...wallet.key_type import BLS12381G2
from ...wallet.util import b58_to_bytes
from ...wallet.in_memory import InMemoryWallet
from ...core.in_memory import InMemoryProfile
from ..ld_proofs import (
WalletKeyPair,
AssertionProofPurpose,
verify,
sign,
d... |
11,961 | summary | #!/usr/bin/env python3
import argparse
from botocore.exceptions import ClientError
import os
from pacu.core.lib import downloads_dir
from pacu import Main
module_info = {
# Name of the module (should be the same as the filename)
'name': 'lightsail__generate_ssh_keys',
# Name and any other notes about the... |
11,962 | test fitting all | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
Tests for the fitter module.
"""
import numpy as np
import pytest
from astropy.io import fits
from numpy.testing import assert_allclose
from photutils.datasets import get_path
from photutils.isophote.fitter import CentralEllipseFitter, EllipseFitter
... |
11,963 | create package set from installed | """Validation of dependencies of packages
"""
from collections import namedtuple
from pip._vendor.packaging.utils import canonicalize_name
from pip._internal.operations.prepare import make_abstract_dist
from pip._internal.utils.misc import get_installed_distributions
from pip._internal.utils.typing import MYPY_CHECK... |
11,964 | test help | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright 2006 - 2021, Tomas Babej, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated d... |
11,965 | plot param importances | from __future__ import annotations
from typing import Callable
import numpy as np
from optuna._experimental import experimental_func
from optuna.importance._base import BaseImportanceEvaluator
from optuna.logging import get_logger
from optuna.study import Study
from optuna.trial import FrozenTrial
from optuna.visual... |
11,966 | id | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . im... |
11,967 | install mocks | from unittest.mock import patch
import requests_mock
from furl import furl
from rest_framework import status
from rest_framework.reverse import reverse
from rest_framework.test import APITestCase
from zds_client.oas import schema_fetcher
from zgw_consumers.test import generate_oas_component
from zgw_consumers.test.sch... |
11,968 | test set and get with explicit auth | """
Tests for salt.utils.boto3mod
"""
import random
import string
import pytest
import salt.loader
import salt.utils.boto3mod as boto3mod
from salt.utils.versions import Version
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.mock import MagicMock, patch
from tests.support.unit import T... |
11,969 | add tags | from datetime import datetime
from typing import ClassVar, Dict, List, Optional, Type
from attrs import define, field
from resoto_plugin_aws.aws_client import AwsClient
from resoto_plugin_aws.resource.base import AwsApiSpec, AwsResource, GraphBuilder
from resoto_plugin_aws.resource.kms import AwsKmsKey
from resotolib... |
11,970 | test nested effects | from itertools import product
from string import ascii_lowercase
import numpy as np
import pandas as pd
import pytest
from linearmodels.panel.data import PanelData
from linearmodels.panel.model import PanelOLS
from linearmodels.tests.panel._utility import datatypes, generate_data
pytestmark = pytest.mark.filterwarni... |
11,971 | key | from datetime import datetime
import fcntl
from functools import wraps
import os
from osclib.cache_manager import CacheManager
import shelve
import pickle
# Where the cache files are stored
CACHEDIR = CacheManager.directory('memoize')
def memoize(ttl=None, session=False, add_invalidate=False):
"""Decorator funct... |
11,972 | get user by username | # 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 by applicable la... |
11,973 | all | import asyncio
import contextvars
import importlib
from contextvars import ContextVar
from copy import copy
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Type, Union
from tortoise.backends.base.config_generator import expand_db_url
from tortoise.exceptions import ConfigurationError
if TYPE_CHECKING:
... |
11,974 | make sdfg | # Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved.
import dace
import copy
import pytest
import numpy as np
from dace.libraries.sparse import CSRMV
from scipy.sparse import csr_matrix
N = dace.symbol("N")
M = dace.symbol("M")
NNZ = dace.symbol("NNZ")
def METHOD_NAME(alpha: float, beta: floa... |
11,975 | dump list | # Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
# or more contributor license agreements. Licensed under the Elastic License
# 2.0; you may not use this file except in compliance with the Elastic License
# 2.0.
"""Helper functions for managing rules in the repository."""
import copy
impo... |
11,976 | type | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . imp... |
11,977 | unit cell | from __future__ import absolute_import, division, print_function
import cctbx.array_family.flex as flex# import dependency
import sys
import boost_adaptbx.boost.python as bp
ext = bp.import_ext("iotbx_ccp4_map_ext")
from iotbx_ccp4_map_ext import *
import iotbx_ccp4_map_ext as ext
class utils : # These routines are ... |
11,978 | linear interpolate | import cv2
import numpy as np
from skimage import transform as tf
def METHOD_NAME(landmarks, start_idx, stop_idx):
start_landmarks = landmarks[start_idx]
stop_landmarks = landmarks[stop_idx]
delta = stop_landmarks - start_landmarks
for idx in range(1, stop_idx - start_idx):
landmarks[start_idx... |
11,979 | test confusion matrix with valid inputs with | import numpy as np
import pytest
import sklearn
from autogluon.core.metrics import confusion_matrix, log_loss, quadratic_kappa, roc_auc
from autogluon.core.metrics.softclass_metrics import soft_log_loss
def test_confusion_matrix_with_valid_inputs_without_labels_and_weights():
# Given
input_solution = [2, 0, ... |
11,980 | get class of elements | import numpy as np
from pyNastran.op2.op2 import read_op2
from pyNastran.bdf.utils import parse_patran_syntax_dict
#def test_nodal_avg_stress():
#op2 = None
#subcase = None
#eids = None
#get_nodal_avg_stress(op2, subcase, eids)
#get_centroid_stress(op2, subcase, eids)
def get_types_for_eids(bdf, e... |
11,981 | test generate file overwrite autoloader | import tempfile
from unittest import mock
from astro.constants import DatabricksLoadMode
from astro.databases.databricks.api_utils import generate_file
from astro.databases.databricks.load_file.load_file_job import _create_load_file_pyspark_file
from astro.databases.databricks.load_options import DeltaLoadOptions
from... |
11,982 | write format data request | #
# This file is part of the PyRDP project.
# Copyright (C) 2018-2021 GoSecure Inc.
# Licensed under the GPLv3 or later.
#
from io import BytesIO
from pyrdp.core import Uint16LE, Uint32LE, Uint64LE
from pyrdp.enum import ClipboardMessageFlags, ClipboardMessageType, ClipboardFormatName, ClipboardFormatNumber
from pyrd... |
11,983 | test get thumbor params | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import optparse
import sys
from io import StringIO
from unittest imp... |
11,984 | calculate out shape | """
Copyright (c) 2018-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 wri... |
11,985 | usage exit | from cStringIO import StringIO
import os
import sys
import unittest
import unittest.test
class Test_TestProgram(unittest.TestCase):
def test_discovery_from_dotted_path(self):
loader = unittest.TestLoader()
tests = [self]
expectedPath = os.path.abspath(os.path.dirname(unittest.test.__fil... |
11,986 | gather non trainable weights | # Copyright 2018 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,987 | set initial language tag | """
Defines asynchronous celery task for auto-tagging content
"""
from __future__ import annotations
import logging
from celery import shared_task
from celery_utils.logged_task import LoggedTask
from django.conf import settings
from django.contrib.auth import get_user_model
from opaque_keys.edx.keys import CourseKey,... |
11,988 | reply | """Create models with a set of default valid properties, to avoid
changes forcing an update of all test code.
"""
import os
import uuid
from datetime import datetime
from itertools import cycle
from typing import List
from sdclientapi import METHOD_NAME as SDKReply
from sdclientapi import Source as SDKSource
from sdcl... |
11,989 | copy and overwrite | # Copyright (c) 2021 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
#
# Unless required by appli... |
11,990 | format perc | # Copyright 2012 Christoph Reiter
#
# 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 gi.repository import Gst, Gtk,... |
11,991 | is atom log log convex | """
Copyright 2013 Steven Diamond
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... |
11,992 | masked select | # 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
#
# Unless required by appli... |
11,993 | measure categorical dataframe | import numpy as np
import typing as tp
import pandas as pd
from catboost import Pool
from timeit import default_timer
def get_raw_data(rows_count: int, columns_count: int) -> tp.Tuple[np.ndarray, np.ndarray, np.ndarray, np.ndarray]:
float64_data: np.ndarray = np.float64(np.random.rand(columns_count//4, rows_count... |
11,994 | row | from typing import List
from happybase import Connection
from feast.infra.key_encoding_utils import serialize_entity_key
from feast.protos.feast.types.EntityKey_pb2 import EntityKey
class HbaseConstants:
"""Constants to be used by the Hbase Online Store."""
DEFAULT_COLUMN_FAMILY = "default"
EVENT_TS = ... |
11,995 | forward | # Copyright (c) Alibaba, Inc. and its affiliates.
import os
import os.path as osp
import cv2
import numpy as np
import torch
from easydict import EasyDict as edict
from modelscope.metainfo import Models
from modelscope.models.base.base_torch_model import TorchModel
from modelscope.models.builder import MODELS
from mo... |
11,996 | read dir | #
# Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES.
# Apache-2.0
#
# 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 appl... |
11,997 | test parsing of parameter as default | from typing import Any, Dict, List, Optional
import pytest
from typing_extensions import Annotated
from litestar import Controller, Litestar, MediaType, get, post
from litestar.di import Provide
from litestar.exceptions import ImproperlyConfiguredException
from litestar.params import Body, Dependency, Parameter
from ... |
11,998 | validate max | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""
Time and datetime picker widgets
"""
from traitlets import Unicode, Bool, validate, TraitError
from .trait_types import datetime_serialization, Datetime, naive_serialization
from .valuewidget import ValueWidget
f... |
11,999 | print sl |
from torch.ao.pruning import BaseSparsifier
from functools import wraps
import warnings
import weakref
__all__ = ["BaseScheduler"]
class BaseScheduler:
def __init__(self, sparsifier, last_epoch=-1, verbose=False):
# Attach sparsifier
if not isinstance(sparsifier, BaseSparsifier):
r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.