id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
12,200 | filters | """
WARNING: AUTOGENERATED CODE
This code was generated by a tool.
Autogenerated on: 2023-09-01
Manual changes to this file may cause unexpected behavior in your application.
Manual changes to this file will be overwritten if the code is regenerated.
"""
from pyopencga.rest_clients._parent_rest_c... |
12,201 | render check result | from typing import AsyncIterator, AsyncGenerator, Optional, List, Union
from aiostream import stream
from aiostream.core import Stream
from networkx import DiGraph
from rich._emoji_codes import EMOJI
from resotocore.model.resolve_in_graph import NodePath
from resotocore.report import BenchmarkResult, CheckCollectionR... |
12,202 | configure | """
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... |
12,203 | decrypt number | #!/usr/bin/env python3
# Contest Management System - http://cms-dev.github.io/
# Copyright © 2010-2012 Giovanni Mascellani <mascellani@poisson.phc.unipi.it>
# Copyright © 2010-2018 Stefano Maggiolo <s.maggiolo@gmail.com>
# Copyright © 2010-2012 Matteo Boscariol <boscarim@hotmail.com>
# Copyright © 2012 Luca Wehrstedt ... |
12,204 | test append | #
# Copyright (c) 2020, Neptune Labs Sp. z o.o.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
12,205 | test create datastore only view | # encoding: utf-8
import pytest
import ckan.model as model
import ckan.plugins as p
import ckan.lib.helpers as h
import ckanext.reclineview.plugin as plugin
import ckan.lib.create_test_data as create_test_data
from ckan.tests import helpers, factories
@pytest.mark.usefixtures("with_plugins")
class BaseTestReclineV... |
12,206 | work | # Copyright (c) "Neo4j"
# Neo4j Sweden AB [https://neo4j.com]
#
# This file is part of Neo4j.
#
# 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... |
12,207 | validate fs | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... |
12,208 | test keyword ifelse | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import dace
import numpy as np
N = dace.symbol('N')
@dace.program
def keyword_false(A: dace.float32[N], B: dace.float32[N], C: dace.bool):
if C is False:
B[:] = A[:]
def test_keyword_false():
N.set(128)
A = np.random.ra... |
12,209 | get data | from test.test_support import run_unittest, is_jython
import unittest
import sys
import imp
import pkgutil
import os
import os.path
import tempfile
import shutil
import zipfile
class PkgutilTests(unittest.TestCase):
def setUp(self):
self.dirname = tempfile.mkdtemp()
self.addCleanup(shutil.rmtree... |
12,210 | test number in filter | # Copyright 2020 Planet Labs, Inc.
# Copyright 2022 Planet Labs PBC.
#
# 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 a... |
12,211 | get biome notes | import os
import struct
import blackboxprotobuf
from datetime import datetime
from time import mktime
from io import StringIO
from io import BytesIO
from pathlib import Path
from scripts.artifact_report import ArtifactHtmlReport
from scripts.ilapfuncs import logfunc, tsv, timeline, is_platform_windows, open_sqlite_db_r... |
12,212 | build input model | import logging
from qcengine.exceptions import UnknownError
import sys
import traceback
from io import StringIO
from typing import Any, Dict, Union
import numpy as np
from qcelemental.models import OptimizationInput, OptimizationResult, FailedOperation
from qcelemental.util import which_import
import qcengine
from .... |
12,213 | has scripts | """distutils.command.build
Implements the Distutils 'build' command."""
import sys, os
from distutils.core import Command
from distutils.errors import DistutilsOptionError
from distutils.util import get_platform
def show_compilers():
from distutils.ccompiler import show_compilers
show_compilers()
class bu... |
12,214 | validate memory | from datasette import hookimpl
import click
import json
import os
import re
from subprocess import check_call, check_output
from .common import (
add_common_publish_arguments_and_options,
fail_if_publish_binary_not_installed,
)
from ..utils import temporary_docker_directory
@hookimpl
def publish_subcommand(p... |
12,215 | enabled | # aliases.py
# Resolving aliases in CLI arguments.
#
# Copyright (C) 2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This ... |
12,216 | to one hot | import math
import numpy as np
import torch
import torch.nn.functional as F
from torch.distributions.normal import Normal
def gaussian_loss(y_hat, y, log_std_min=-7.0):
assert y_hat.dim() == 3
assert y_hat.size(2) == 2
mean = y_hat[:, :, :1]
log_std = torch.clamp(y_hat[:, :, 1:], min=log_std_min)
... |
12,217 | test default hash | from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from poetry.core.utils.helpers import parse_requires
from poetry.utils.helpers import get_file_hash
if TYPE_CHECKING:
from tests.types import FixtureDirGetter
def test_parse_requires() -> None:
requires = """\
jsonschema>=... |
12,218 | test fiducial roudtrip | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import warnings
from contextlib import nullcontext
import erfa
import numpy as np
import pytest
from numpy import testing as npt
from astropy import units as u
from astropy.coordinates import EarthLocation, SkyCoord
from astropy.coordinates.angle_utilit... |
12,219 | execute | #!/usr/bin/env python
# -*- 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-... |
12,220 | gen rand | #!/usr/bin/env python3
# Test initial conditions
from boututils.run_wrapper import build_and_log, shell, launch_safe
from boutdata.collect import collect
import configparser
import itertools
from scipy.special import erf
import numpy as np
import os
# requires not make
# requires scipy
# cores: 4
#################... |
12,221 | has bool dtype | """
Expressions
-----------
Offer fast expression evaluation through numexpr
"""
import warnings
import numpy as np
from pandas.core.dtypes.generic import ABCDataFrame
import pandas.core.common as com
from pandas.core.computation.check import _NUMEXPR_INSTALLED
from pandas.core.config import get_option
if _NUMEX... |
12,222 | test invalid | '''
copyright: Copyright (C) 2015-2022, Wazuh Inc.
Created by Wazuh, Inc. <info@wazuh.com>.
This program is free software; you can redistribute it and/or modify it under the terms of GPLv2
type: integration
brief: The Wazuh 'gcp-pubsub' module uses it to fetch different kinds of events
... |
12,223 | test dfs3 read time | import pytest
import numpy as np
import mikeio
from mikeio.spatial import GeometryUndefined
from mikeio.spatial import Grid2D, Grid3D
def test_dfs3_repr():
dfs = mikeio.open("tests/testdata/test_dfs3.dfs3")
assert "<mikeio.Dfs3>" in repr(dfs)
assert "geometry: Grid3D" in repr(dfs)
def test_dfs3_project... |
12,224 | update adapters | """
A simple wrapper for bleak
Handles reconnection
"""
import asyncio
import bluetooth_adapters
from bleak import BleakClient, BleakScanner
from bleak.backends.device import BLEDevice
from bleak.exc import BleakError
from .. import fhem
class BluetoothLE:
# keep connected (get manuf uuid every x seconds)
#... |
12,225 | test report crux max date | # Copyright 2015 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 or a... |
12,226 | url 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,227 | meshed region get has skin region | #-------------------------------------------------------------------------------
# MeshedRegion
#-------------------------------------------------------------------------------
class MeshedRegionAbstractAPI:
@staticmethod
def init_meshed_region_environment(object):
pass
@staticmethod
def finish_meshed_region_en... |
12,228 | generate | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.files import apply_conandata_patches, export_conandata_patches, get, copy, rmdir
from conan.tools.build import check_min_cppstd, valid_min_cppstd
from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout
f... |
12,229 | window | from __future__ import annotations
from toga.constants import Direction
from .base import Widget
class SplitContainer(Widget):
HORIZONTAL = Direction.HORIZONTAL
VERTICAL = Direction.VERTICAL
def __init__(
self,
id=None,
style=None,
direction: Direction = Direction.VERTIC... |
12,230 | post index access | from typing import Optional
from slither.core import expressions
from slither.core.expressions.expression import Expression
from slither.visitors.expression.expression import ExpressionVisitor
def get(expression: Expression) -> str:
val = expression.context["ExpressionPrinter"]
# we delete the item to reduce... |
12,231 | measure candidates | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
12,232 | test readonly | # pylint: disable=no-self-use
import sys
import typing
from collections import OrderedDict
import pytest
from PartSegCore.algorithm_describe_base import Register
from PartSegCore.class_generator import BaseSerializableClass, base_serialize_register
pytestmark = [
pytest.mark.skipif(sys.version_info >= (3, 10), ... |
12,233 | test establish sse c copy sources given | ######################################################################
#
# File: test/unit/v1/test_copy_manager.py
#
# Copyright 2021 Backblaze Inc. All Rights Reserved.
#
# License https://www.backblaze.com/using_b2_code.html
#
######################################################################
from __future__ impo... |
12,234 | test infeasible2 | # ___________________________________________________________________________
#
# 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 ... |
12,235 | fake load dataset | import tempfile
from unittest.mock import patch
import pytest
from cleanlab.datalab.internal.data import Data, DataFormatError, DatasetLoadError
from datasets import Dataset, ClassLabel
import numpy as np
import hypothesis.strategies as st
from hypothesis import given, assume, settings, HealthCheck
NUM_COLS = 2
@st... |
12,236 | test add umcast storm yang empty entry | import os
import traceback
import mock
import jsonpatch
from click.testing import CliRunner
from mock import patch
from jsonpatch import JsonPatchConflict
import config.main as config
import show.main as show
from utilities_common.db import Db
import config.validated_config_db_connector as validated_config_db_connect... |
12,237 | snapshot | """
Jira Ticket Number(s): DEV-8828
Created new fields on Transaction Normalized and Awards for both the value of each transaction's
"indirect_federal_sharing" amount and the sum of all amounts under an award, respectively.
Expected CLI:
$ python3 usaspending_api/database_scripts/job_archive/backfill_fab... |
12,238 | fs root | import logging
import os
import six
from contextlib import contextmanager
from insights.util import streams, subproc
log = logging.getLogger(__name__)
GLOBAL_PRODUCTS = []
PRODUCT_NAMES = []
DEFAULT_VERSION = ["-1", "-1"]
FSRoots = []
def METHOD_NAME(thing):
FSRoots.append(thing)
return thing
def product(... |
12,239 | code operator lambda | from talon import Context, Module, actions, settings
ctx = Context()
mod = Module()
ctx.matches = r"""
tag: user.scala
"""
# Scala Common Types
scala_common_types = {
"boolean": "Boolean",
"int": "Int",
"float": "Float",
"byte": "Byte",
"double": "Double",
"short": "Short",
"long": "Long",... |
12,240 | list rm | #
# Copyright 2019-2022 GoPro Inc.
#
# 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... |
12,241 | create insight context | import uuid
from django.conf import settings
from django.db import models
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from adhocracy4.models import base
from adhocracy4.projects.models import Project
from . import emails
class Invite(base.TimeStampedModel):
creator = ... |
12,242 | run | import sys
import textwrap
from optparse import Values
from typing import List
from pip._internal.cli.base_command import Command
from pip._internal.cli.status_codes import SUCCESS
from pip._internal.utils.misc import get_prog
BASE_COMPLETION = """
# pip {shell} completion start{script}# pip {shell} completion end
""... |
12,243 | make base cmd | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
12,244 | fetch biz inst topo | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... |
12,245 | assert bitmap range | # Copyright iris-grib contributors
#
# This file is part of iris-grib and is released under the LGPL license.
# See COPYING and COPYING.LESSER in the root of the repository for full
# licensing details.
"""
Unit tests for :func:`iris_grib._save_rules.data_section`.
"""
# import iris_grib.tests first so that some thin... |
12,246 | parse json response | #!/usr/bin/env python
# datetime: 2021/10/22 下午2:29
# desc: data rule, response field rule, sql field rule
import jq
import re2 as re
from celery.apps.worker import logger
from dongtai_common.models.sensitive_info import IastSensitiveInfoRule
from dongtai_common.utils import const
from dongtai_engine.plugins.strategy_... |
12,247 | testnotcleaning | """
Created on 20 Jan 2016
@author: rob
"""
import unittest
import numpy as np
from systems.tests.testdata import (
get_test_object_futures_with_rules_and_capping_estimate,
)
from systems.basesystem import System
class Test(unittest.TestCase):
def setUp(self):
(
accounts,
fc... |
12,248 | test onmodify builtin accept | #!/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... |
12,249 | set up | # 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... |
12,250 | prepare colors | """Overrides graphics of groups instances on selected views or
active view in such way that all instances of the same group type
are marked with the same color. You can select multiple views before
running the tool to colorize the group types in all of them at once
Note:
Groups with only 1 instance on views will be co... |
12,251 | test basic | import logging
import time
from datetime import datetime
from boto.sdb.db.model import Model
from boto.sdb.db.property import StringProperty, IntegerProperty, BooleanProperty
from boto.sdb.db.property import DateTimeProperty, FloatProperty, ReferenceProperty
from boto.sdb.db.property import PasswordProperty, ListPrope... |
12,252 | get outer loops | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
12,253 | test state custom name | from uuid import UUID, uuid4
import pendulum
import pydantic
import pytest
from prefect.deprecated.data_documents import DataDocument
from prefect.server.schemas.states import (
AwaitingRetry,
Completed,
Failed,
Late,
Pending,
Retrying,
Running,
Scheduled,
State,
StateDetails,
... |
12,254 | keys | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import shlex
import sys
from typing import Optional
class Env(object):
def __init__(self, src=None) -> None:
self._d... |
12,255 | set up | # Copyright 2012-2020 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 ac... |
12,256 | graphql transport | # Copyright 2020-2022 Capypara and the SkyTemple Contributors
#
# This file is part of SkyTemple.
#
# SkyTemple is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at y... |
12,257 | to str | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.28
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... |
12,258 | test post process install requests bootstrap | from mock import (
patch, call
)
from pytest import raises
import mock
from kiwi.package_manager.microdnf import PackageManagerMicroDnf
from kiwi.exceptions import KiwiRequestError
class TestPackageManagerMicroDnf:
def setup(self):
repository = mock.Mock()
repository.root_dir = '/root-dir'
... |
12,259 | test identity on each two qubits | # Copyright 2018 The Cirq 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
12,260 | test re len | import unittest
import os, glob
from test_all import db, test_support, get_new_environment_path, \
get_new_database_path
#----------------------------------------------------------------------
class DB(unittest.TestCase):
def setUp(self):
self.path = get_new_database_path()
self.db = db.D... |
12,261 | 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 . imp... |
12,262 | get key | """
A binding maps a key press on to an action.
See [bindings](/guide/input#bindings) in the guide for details.
"""
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING, Iterable
import rich.repr
from .keys import _character_to_key
if TYPE_CHECKING:
from typi... |
12,263 | append sample entry | import os
import re
import random
from spytest import env
from spytest.ordyaml import OrderedYaml
import utilities.common as utils
config = None
levels = ['emerg', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug', 'none']
sample_syslogs = []
def add_sample_syslog(msg):
sample_syslogs.append(msg)
... |
12,264 | test factory has buildin constructors active by | # -*- coding: utf-8 -*-
"""
Testing factory responsible for returning "requested" connection
"""
__author__ = 'Grzegorz Latuszek, Michal Ernst'
__copyright__ = 'Copyright (C) 2018, Nokia'
__email__ = 'grzegorz.latuszek@nokia.com, michal.ernst@nokia.com'
import pytest
import mock
def test_missing_constructor_raises_... |
12,265 | get cpk scope info | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: ... |
12,266 | unconfigure non fcoe | #!/usr/bin/python3
# SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
from __future__ import absolute_import
"""
FCoE hook:
if fcoe = true custom networks was specified enable FCoE for specified NIC
syntax:
fcoe = true|false
"""
import os
import shlex
import traceback
import... |
12,267 | get attr handler | import uuid
from dataclasses import asdict
from typing import List
import torch
import torch.fx
from torch.fx import GraphModule
from torch.fx.node import Node
from colossalai.auto_parallel.meta_profiler import ShardMetaInfo
from colossalai.auto_parallel.passes.constants import OUTPUT_SAVED_MOD, OUTPUT_SAVED_OPS
from... |
12,268 | test compute norm s o3 x | import pytest
import numpy as np
from paz.backend.groups import homogenous_quaternion_to_rotation_matrix
from paz.backend.groups import quaternion_to_rotation_matrix
from paz.backend.groups import rotation_vector_to_rotation_matrix
from paz.backend.groups import to_affine_matrix
from paz.backend.groups import build_ro... |
12,269 | test diff different | import os
import tempfile
from copy import deepcopy
from shutil import rmtree
from time import time
from unittest.mock import Mock
import numpy as np
import pandas as pd
import pytest
from suzieq.db.parquet.parquetdb import SqParquetDB
from suzieq.poller.worker.services.service import Service
from suzieq.shared.schem... |
12,270 | one to many | from collections.abc import Callable, Sequence
from typing import Any, Literal
from django.db.models.base import Model
from django.db.models.fields import AutoField, Field, _AllLimitChoicesTo, _ChoicesList, _LimitChoicesTo
from django.db.models.fields.related import ForeignKey, ForeignObject, ManyToManyField, OneToOne... |
12,271 | can start playing with no latency | import abc
from dataclasses import dataclass
from datetime import timedelta
from enum import Enum
from typing import Callable, Dict, Optional, Set, Tuple, Type, Union
from ..adapters.api_objects import Song
@dataclass
class PlayerEvent:
"""
Represents an event triggered by the player. This is a way to signal... |
12,272 | get server key | # 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,273 | test factory registration | ##########################################################################
#
# Copyright (c) 2011, John Haddon. All rights reserved.
# Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided ... |
12,274 | make previous matcher | # 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 use ... |
12,275 | id | # 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,276 | test cmd quoted | from shlex import quote
import pytest
from conftest import assert_bash_exec, assert_complete, bash_env_saved
def join(words):
"""Return a shell-escaped string from *words*."""
return " ".join(quote(word) for word in words)
@pytest.mark.bashcomp(
cmd=None,
ignore_env=r"^[+-]COMPREPLY=",
)
class Tes... |
12,277 | total time | from functools import total_ordering
from django.utils.translation import gettext as _
from oioioi.contests.scores import ScoreValue
def format_time(seconds):
minutes = seconds // 60
return '%d:%02d' % (minutes // 60, minutes % 60)
@total_ordering
class BinaryScore(ScoreValue):
"""Score representing b... |
12,278 | test pcp enabled | import datetime
import pytest
from mock.mock import patch
from insights.combiners.ps import Ps
from insights.combiners.services import Services
from insights.core import dr
from insights.core.exceptions import SkipComponent
from insights.parsers.ps import PsAuxcww
from insights.parsers.ros_config import RosConfig
fro... |
12,279 | submit order command | # -------------------------------------------------------------------------------------------------
# Copyright (C) 2015-2023 Nautech Systems Pty Ltd. All rights reserved.
# https://nautechsystems.io
#
# Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
# You may not use this file ex... |
12,280 | finish tree | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Base class for fixers (optional, but recommended)."""
# Python imports
import itertools
# Local imports
from .patcomp import PatternCompiler
from . import pygram
from .fixer_util import does_tree_import
class Base... |
12,281 | load data | # Copyright 2020 Adap GmbH. 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 or ag... |
12,282 | check grant type | from datetime import timedelta, datetime
from uuid import uuid4
from authlib.oauth2.rfc6749 import ClientMixin, scope_to_list, list_to_scope, TokenMixin
from authlib.oidc.core import AuthorizationCodeMixin
from django.conf import settings
from django.db import models
from slugify import slugify
from users.models.user... |
12,283 | save frozen graph | # 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... |
12,284 | test save read simple ndarray | from datetime import datetime as dt, timedelta as dtd
import bson
import numpy as np
import pytest
from mock import patch
from pymongo.server_type import SERVER_TYPE
from arctic._config import FwPointersCfg, FW_POINTERS_REFS_KEY
from arctic._util import mongo_count
from arctic.store._ndarray_store import NdarrayStore... |
12,285 | test get file url | import pytest
from unittest.mock import patch
from pubnub.pubnub_asyncio import PubNubAsyncio
from tests.integrational.vcr_helper import pn_vcr
from tests.helper import pnconf_file_copy
from pubnub.endpoints.file_operations.publish_file_message import PublishFileMessage
from pubnub.models.consumer.file import (
PN... |
12,286 | binge watch | import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
def clean_data(user_name: str, data_frame: object) -> object:
'''
user_name: user name whose data you want to visualize
data_frame: data in the form panda dataframe
Extra columns are removed and the time is converte... |
12,287 | energy | # Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... |
12,288 | get puzzle and solution for coin | from __future__ import annotations
import logging
from typing import Dict, List, Optional
from chia_rs import (
AGG_SIG_ARGS,
ALLOW_BACKREFS,
ENABLE_ASSERT_BEFORE,
ENABLE_BLS_OPS,
ENABLE_BLS_OPS_OUTSIDE_GUARD,
ENABLE_FIXED_DIV,
ENABLE_SECP_OPS,
ENABLE_SOFTFORK_CONDITION,
LIMIT_ANNO... |
12,289 | get addons | """Core classes and interfaces.
This defines a couple of standard feed types and scopes. Currently
feed types are strings and scopes are integers, but you should use the
symbolic names wherever possible (everywhere except for adding a new
feed type) since this might change in the future. Scopes are integers,
but do no... |
12,290 | read rockblock |
import sys
import numpy as np
import scipy.io as sio
import matplotlib.pyplot as plt
from .triangle_mesh import TriangleMesh
class FABFileReader:
def __init__(self, fname):
try:
with open(fname, 'r') as f:
self.lines = f.read().split('\n')
except EnvironmentError:
... |
12,291 | audio melspec | import json
import librosa
import numpy as np
import requests
SAMPLING_RATE = 16000
INPUT_LENGTH = 9.01
# URL for the web service
SCORING_URI_DNSMOS = "https://dnsmos.azurewebsites.net/score"
SCORING_URI_DNSMOS_P835 = "https://dnsmos.azurewebsites.net/v1/dnsmosp835/score"
class DNSMOS_web:
# ported from
# h... |
12,292 | apply | """
Contains a Celery base task.
"""
from celery import Task
from kombu.serialization import dumps as kombu_dumps, loads as kombu_loads
import markus
from ichnaea.cache import redis_pipeline
from ichnaea.conf import settings
from ichnaea.db import db_worker_session
METRICS = markus.get_metrics()
class BaseTask(Ta... |
12,293 | test extend dash | # Copyright (c) 2020 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the functionality o... |
12,294 | fileno | import socket
import warnings
class TransportSocket:
"""A socket-like wrapper for exposing real transport sockets.
These objects can be safely returned by APIs like
`transport.get_extra_info('socket')`. All potentially disruptive
operations (like "socket.close()") are banned.
"""
__slots__... |
12,295 | dump img |
# Copyright 2008-2022 Jaap Karssenberg <jaap.karssenberg@gmail.com>
'''This module handles parsing and dumping input in plain text'''
import re
import zim.parser
from zim.parser import fix_unicode_chars, Rule
from zim.formats import *
from zim.parsing import url_re
info = {
'name': 'plain',
'desc': 'Plain text... |
12,296 | forward | """Predictor for edges in homogeneous graphs."""
# pylint: disable= no-member, arguments-differ, invalid-name, W0235
import torch
import torch.nn as nn
import torch.nn.functional as F
class EdgePredictor(nn.Module):
r"""Predictor/score function for pairs of node representations
Given a pair of node represent... |
12,297 | generate col paths | import itertools
import logging
import re
import subprocess
from pathlib import Path
from typing import Union
from metagraph_workflows import workflow_configs, utils
from metagraph_workflows.workflow_configs import GNU_TIME_CMD, TMP_DIR, \
RULE_CONFIGS_KEY, SEQS_FILE_LIST_PATH, SEQS_DIR_PATH
logger = logging.getL... |
12,298 | create series name | """
Miscellaneous helper routines for the ABF/DAT to NWB v2 (aka X to NWB) conversion
functionality.
"""
import math
from pkg_resources import get_distribution, DistributionNotFound
import os
from subprocess import Popen, PIPE
import numpy as np
from pynwb.icephys import CurrentClampStimulusSeries, VoltageClampStimu... |
12,299 | test incoming heartbeat exceeded | # SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
from __future__ import absolute_import
from __future__ import division
import json
from stomp_test_utils import (
FakeAsyncDispatcher,
FakeConnection,
FakeFrameHandler,
FakeTimeGen
)
from yajsonrpc.stomp import (
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.