id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
13,600 | in cooldown | """ReduceLROnPlateau (with Warm up) learning rate scheduler module."""
from typing import Union
import torch
from torch import inf
from typeguard import check_argument_types
from espnet2.schedulers.abs_scheduler import (
AbsBatchStepScheduler,
AbsValEpochStepScheduler,
)
class WarmupReduceLROnPlateau(AbsBat... |
13,601 | get resource manager | import logging
import multiprocessing
import os
import shutil
import subprocess
from typing import Union
from autogluon.common.utils.try_import import try_import_ray
from .distribute_utils import DistributedContext
from .lite import disable_if_lite_mode
from .utils import bytes_to_mega_bytes
class ResourceManager:
... |
13,602 | process | __all__ = [
"SupportsMerge",
"MergeMixin",
"MatchMixin",
"Pin",
"PinDefault",
"PinDefaultFactory",
"Container",
"ContainerProxy",
"Drop",
]
from dataclasses import dataclass
from typing import (
Any,
Callable,
Dict,
Generic,
Iterator,
Mapping,
MutableMap... |
13,603 | run | import logging
from functools import partial
from pprint import pformat
from typing import Any, Dict, Sequence, Tuple
# common imports
from common.event_queue import IAgentEventPublisher
from common.types import AgentID, Event
from common.utils.code_utils import del_key
# dependencies to get rid of or internalize
fro... |
13,604 | test metadata | # (C) Copyright 2005-2021 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
13,605 | equals 2 | """
Tests for the `TypeChecker`-based type interface.
The actual correctness of the type checking is handled in
`test_jsonschema_test_suite`; these tests check that TypeChecker
functions correctly at a more granular level.
"""
from collections import namedtuple
from unittest import TestCase
from asdf._jsonschema impo... |
13,606 | temp root | # (c) 2012-2018, Ansible by Red Hat
#
# This file is part of Ansible Galaxy
#
# Ansible Galaxy is free software: you can redistribute it and/or modify
# it under the terms of the Apache License as published by
# the Apache Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
... |
13,607 | build schema 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
# --------------------------------... |
13,608 | test mrp rotation | # ISC License
#
# Copyright (c) 2016, Autonomous Vehicle Systems Lab, University of Colorado at Boulder
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies... |
13,609 | set widget value | #
# ParamSet.py -- Groups of widgets holding parameters
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
from ginga.misc import Callback, Bunch
from ginga.gw import Widgets
class Param(Bunch.Bunch):
pass
class ParamSet(Callback.Callbacks):
def _... |
13,610 | test update sigmas | from lenstronomy.Workflow.multi_band_manager import MultiBandUpdateManager
from lenstronomy.Workflow.update_manager import UpdateManager
import pytest
class TestUpdateManager(object):
def setup_method(self):
kwargs_model = {
"lens_model_list": ["SHEAR", "SHEAR"],
"source_light_mode... |
13,611 | get tag rule 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 . im... |
13,612 | test optimize dataset unchunk coords true in | import os
import os.path
import unittest
from typing import Set, Union, Sequence
from xcube.constants import FORMAT_NAME_ZARR
from xcube.core.chunk import chunk_dataset
from xcube.core.dsio import rimraf
from xcube.core.new import new_cube
from xcube.core.optimize import optimize_dataset
TEST_CUBE = chunk_dataset(new... |
13,613 | image batch | # MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2023
#
# 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
# r... |
13,614 | get variables | # Copyright 2018 DeepMind Technologies Limited. 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 ... |
13,615 | regenerate css | import hashlib
import logging
import django_libsass
import sass
from django.conf import settings
from django.contrib.staticfiles import finders
from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.templatetags.static import static
from pretalx.celery_app imp... |
13,616 | test parse ps columns partial | from datetime import timedelta
import click
import pytest
from neuro_cli.parse_utils import (
PS_COLUMNS_MAP,
SORT_KEY_FUNCS,
JobColumnInfo,
get_default_ps_columns,
get_default_top_columns,
parse_memory,
parse_ps_columns,
parse_sort_keys,
parse_timedelta,
parse_top_columns,
)
... |
13,617 | rhocore | import mpi
from Spheral3d import *
from MultiScaleMedialGenerator import *
from SpheralTestUtilities import *
from VoronoiDistributeNodes import distributeNodes3d as distributeNodes
from siloPointmeshDump import *
commandLine(ncore = 10000,
rhocore0 = 10.0,
rhomantle0 = 1.0,
... |
13,618 | forwards dist | from typing import Sequence
from snuba.clickhouse.columns import Array, Column, String, UInt
from snuba.clusters.storage_sets import StorageSetKey
from snuba.migrations import migration, operations
from snuba.migrations.columns import MigrationModifiers as Modifiers
class Migration(migration.ClickhouseNodeMigrationL... |
13,619 | fund script | import json
import logging
import typing as tp
from cardano_clusterlib import clusterlib
from cardano_node_tests.tests import plutus_common
from cardano_node_tests.utils import dbsync_utils
from cardano_node_tests.utils import tx_view
from cardano_node_tests.utils.versions import VERSIONS
LOGGER = logging.getLogger(... |
13,620 | test uri stat cluster only | from yarl import URL
from neuro_sdk import FileStatusType
from neuro_sdk._storage import _file_status_from_api_ls, _file_status_from_api_stat
def test_from_api() -> None:
stat = _file_status_from_api_ls(
URL("storage://default/user/foo"),
{
"path": "name",
"type": "FILE",
... |
13,621 | triv sigma | """robust_mimo.py
Demonstrate mixed-sensitivity H-infinity design for a MIMO plant.
Based on Example 3.8 from Multivariable Feedback Control, Skogestad and Postlethwaite, 1st Edition.
"""
import os
import numpy as np
import matplotlib.pyplot as plt
from control import tf, ss, mixsyn, step_response
def weighting(... |
13,622 | test compare | # Test mock_tk.Text class against tkinter.Text class by running same tests with both.
import unittest
from test.test_support import requires
from _tkinter import TclError
class TextTest(object):
hw = 'hello\nworld' # usual initial insert after initialization
hwn = hw+'\n' # \n present at initialization, be... |
13,623 | test valid if2 | # 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... |
13,624 | homo1 d model source | import numpy as np
import discretize
from ....utils import mkvc
from .solutions_1d import get1DEfields
def METHOD_NAME(mesh, freq, sigma_1d):
"""
Function that calculates and return background fields
:param discretize.base.BaseMesh mesh: Holds information on the discretization
:param float freq: The... |
13,625 | port to eeprom mapping | import os.path
import sys
sys.path.append('/usr/share/sonic/platform/plugins')
import pddfparse
import json
try:
import time
from ctypes import create_string_buffer
from sonic_sfp.sfputilbase import SfpUtilBase
except ImportError as e:
raise ImportError(str(e) + "- required module not found")
class S... |
13,626 | convert degree | import os
import sys
import getopt
def rtcheck(seconds):
try:
seconds = int(seconds)
return seconds
except ValueError:
return -1
def usageinfo(check, run, exitmsg):
print("Usage information:\n")
print("-h / --help\t\tDisplay this usage info.")
print(
"-s / --secon... |
13,627 | name | from __future__ import annotations
import json
class BaseMission:
"""
The base for all missions used in mil_missions. Lots of this class
is just documentation for the various functions that real missions
can overload. Individual ROS robotics platforms should extend this
base class to provide inte... |
13,628 | calc coverage | # 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 ... |
13,629 | test restore uses correct node count | """Tests for google3.third_party.py.perfkitbenchmarker.providers.gcp.gcp_spanner."""
import inspect
import unittest
from absl import flags
from absl.testing import flagsaver
from absl.testing import parameterized
import mock
from perfkitbenchmarker import relational_db
from perfkitbenchmarker import vm_util
from perf... |
13,630 | generate boundary condition ops | import warnings
import numpy
import cupy
def _is_integer_output(output, input):
if output is None:
return input.dtype.kind in 'iu'
elif isinstance(output, cupy.ndarray):
return output.dtype.kind in 'iu'
return cupy.dtype(output).kind in 'iu'
def _check_cval(mode, cval, integer_output):... |
13,631 | app with task context | # pylint: disable=redefined-outer-name
"""
Showcases/tests an example of long running tasks.
How these tests works:
- setup a AIOHTTP server and launch it in the background.
- client directly makes requests to the FastAPI background client.
"""
import asyncio
from functools import wraps
from typing import Awaitabl... |
13,632 | get slot dict | """
Metrics for the slot filling SLU task
Authors:
* Yung-Sung Chuang 2021
* Heng-Jui Chang 2022
"""
import re
from typing import Dict, List, Tuple
from .common import cer, wer
__all__ = ["slot_type_f1", "slot_value_cer", "slot_value_wer", "slot_edit_f1"]
def clean(ref: str) -> str:
ref = re.sub(r"B\-(\S+... |
13,633 | flush plain | #!/usr/bin/env python
# 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. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use... |
13,634 | to unicode | import sys
import operator
import functools
try:
import builtins
except ImportError:
import __builtin__ as builtins
PY2 = sys.version_info[0] == 2
_identity = lambda x: x
if PY2:
unichr = unichr
text_type = unicode
string_types = (str, unicode)
integer_types = (int, long)
int_to_byte = c... |
13,635 | group | from dataikuapi.dss.app import DSSApp
from dataikuapi.dss.dataset import DSSDataset
from dataikuapi.dss.wiki import DSSWikiArticle
class DSSWorkspace:
"""
A handle to interact with a workspace on the DSS instance.
Do not create this class directly, instead use :meth:`dataikuapi.DSSClient.get_workspace`
... |
13,636 | dummy deprecated custom message | import unittest
import warnings
import pytest
from huggingface_hub.utils._deprecation import (
_deprecate_arguments,
_deprecate_method,
_deprecate_positional_args,
)
class TestDeprecationUtils(unittest.TestCase):
def test_deprecate_positional_args(self):
"""Test warnings are triggered when u... |
13,637 | json converter | """ Util & common files for tests
"""
from typing import IO, Any, Callable, Optional, Tuple
from dateutil import parser
import os
import datetime
import json
import importlib
import jsonpickle
from app.db.models.common import TZTimeStamp
def get_complete_filename(module_path: str, filename: str):
""" Get the full... |
13,638 | output | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
13,639 | validate gb nhs | """
Clean and validate a DataFrame column containing
United Kingdom National Health Service patient identifier (NHSs).
"""
# pylint: disable=too-many-lines, too-many-arguments, too-many-branches
from typing import Any, Union
from operator import itemgetter
import dask.dataframe as dd
import numpy as np
import pandas a... |
13,640 | error window | #
# Copyright (c) 2017, Massachusetts Institute of Technology All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list o... |
13,641 | init metrics | # Copyright 2018 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... |
13,642 | list top level domain agreements 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 . im... |
13,643 | render bounds | """ Notebook display helper methods (mapping related).
"""
# pylint:disable=import-outside-toplevel
import math
def dss_to_geojson(dss, bbox=False, simplify=True, tolerance=0.001):
from datacube.testutils.geom import epsg4326
from datacube.utils.geometry import bbox_union
geoms = [ds.extent.to_crs(epsg4... |
13,644 | entry points | # This file is part of rinohtype, the Python document preparation system.
#
# Copyright (c) Brecht Machiels.
#
# Use of this source code is subject to the terms of the GNU Affero General
# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.
import string
import sys
from subprocess import Popen, P... |
13,645 | test initialize parameters ebc | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from typing import cast, List, Optional, Union
import torch
from hypoth... |
13,646 | next range | from django.db import models
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
from django.contrib.contenttypes.fields import GenericRelation
from tendenci.apps.perms.object_perms import ObjectPermission
from tendenci.apps.perms.models import TendenciBaseModel
from tendenci.apps.pa... |
13,647 | configure loader modules | """
:codeauthor: Jayesh Kariya <jayeshk@saltstack.com>
"""
import pytest
import salt.modules.chef
import salt.states.chef as chef
from tests.support.mock import MagicMock, create_autospec, patch
@pytest.fixture
def METHOD_NAME():
return {chef: {"__salt__": {}}}
@pytest.fixture(
params=[
("chef... |
13,648 | perform | from colorama import Fore
from osc import oscerr
from osc import conf
from osclib.supersede_command import SupersedeCommand
from osclib.request_finder import RequestFinder
from osclib.request_splitter import RequestSplitter
class AdiCommand:
def __init__(self, api):
self.api = api
self.config = ... |
13,649 | test dynamic list element from pipeline param | # Copyright 2022 The Kubeflow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
13,650 | force gpu sync | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
13,651 | test mode basic | import copy
import pytest
from pytensor.compile.function import function
from pytensor.compile.mode import (
AddFeatureOptimizer,
Mode,
get_default_mode,
get_target_language,
)
from pytensor.configdefaults import config
from pytensor.graph.features import NoOutputFromInplace
from pytensor.graph.rewrit... |
13,652 | get s3 params | import csv
import io
import json
import logging
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Tuple
from minio import Minio
if TYPE_CHECKING:
import _csv
import chardet
from splitgraph.core.output import ResettableStream
try:
from multicorn.utils import log_to_postgres
except ImportError:
... |
13,653 | tear down | import os
import json
from django.urls import reverse
from seaserv import seafile_api, ccnet_api
from seahub.test_utils import BaseTestCase
from seahub.group.utils import is_group_admin
from tests.common.utils import randstring
try:
from seahub.settings import LOCAL_PRO_DEV_ENV
except ImportError:
LOCAL_PRO... |
13,654 | lsf wrapper file | # coding: utf-8
"""
LSF remote workflow implementation. See https://www.ibm.com/support/knowledgecenter/en/SSETD4_9.1.3.
"""
__all__ = ["LSFWorkflow"]
import os
from abc import abstractmethod
from collections import OrderedDict
import luigi
import six
from law.workflow.remote import BaseRemoteWorkflow, BaseRemote... |
13,655 | get win32 unicode argv | # -*- coding: utf-8 -*-
# Copyright 2015 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
import os
import sys
import signal
import locale
import contextlib
import ... |
13,656 | get moved files | import os
import itertools
import re
import logging
import subprocess
import typing
Line = typing.NamedTuple(
"Line",
[("sourcefile", str), ("number", int), ("text", str), ("added", bool)],
)
FileLines = typing.NamedTuple(
"FileLines",
[("filename", str), ("lines", typing.Sequence[typing.Tuple[int, in... |
13,657 | kill | from __future__ import print_function
from builtins import str
from builtins import range
import errno
import os
import os.path
import signal
import subprocess
import time
from play.utils import *
if os.name == 'nt':
import win32pdh, win32pdhutil
COMMANDS = ['start', 'stop', 'restart', 'pid', 'out']
HELP = {
... |
13,658 | plot defaults | # 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... |
13,659 | begin args | #!/usr/bin/env python2.4
import sys, os
from cStringIO import StringIO
import re
from Plex import *
from Plex.Traditional import re as Re
class MyScanner(Scanner):
def __init__(self, info, name='<default>'):
Scanner.__init__(self, self.lexicon, info, name)
def begin(self, state_name):
# if se... |
13,660 | read | ################################################################################
# THIS FILE IS 100% GENERATED BY ZPROJECT; DO NOT EDIT EXCEPT EXPERIMENTALLY #
# Read the zproject/README.md for information about making permanent changes. #
#############################################################################... |
13,661 | 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
__all__ ... |
13,662 | build paths get empty request | # pylint: disable=too-many-lines
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRe... |
13,663 | strip suffix | import datetime
from typing import Any, Dict, Optional
from django.core.management.base import BaseCommand
from django.utils.timezone import make_aware, utc
from project.util.mailing_address import US_STATE_CHOICES
from onboarding.models import OnboardingInfo, BOROUGH_CHOICES
STRIP_SUFFIXES = [
", United States ... |
13,664 | write to file | # Copyright (C) 2017, 2018, 2019 Cumulus Networks, Inc. all rights reserved
#
# 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; version 2.
#
# This program is distributed in the hope that it will ... |
13,665 | set allowed companies | # Copyright 2021 Simone Rubino - Agile Business Group
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests import Form, tagged
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
@tagged("post_install", "-at_install")
class TestWithholdingTaxPayment(AccountTestI... |
13,666 | test if diff1 | from parameterized import parameterized
from tests.Highlighter import HighlightTester
class HighlighterTestIfBlock(HighlightTester):
@parameterized.expand([
("level8"),
("level9"),
("level10"),
("level11"),
("level12"),
("level13"),
("level14"),
("... |
13,667 | test03 | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
13,668 | register namespace | import abc
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
from typing import Tuple
from typing import Type
from xsdata.exceptions import XmlHandlerError
from xsdata.formats.bindings import AbstractParser
from xsdata.formats.dataclass.parsers.config import ParserConfi... |
13,669 | global matches | """Word completion for GNU readline.
The completer completes keywords, built-ins and globals in a selectable
namespace (which defaults to __main__); when completing NAME.NAME..., it
evaluates (!) the expression up to the last dot and completes its attributes.
It's very cool to do "import sys" type "sys.", hit the com... |
13,670 | red | #!/usr/bin/env python3
import argparse
import os
import subprocess
import sys
import urllib
from collections import namedtuple
from fnmatch import fnmatch
import requests
try:
import semver
except ImportError:
print("Missing required library: semver.")
exit(1)
REDASH_HOME = os.environ.get("REDASH_HOME", ... |
13,671 | const create | #
# Copyright 2021 FMSoft (<https://www.fmsoft.cn>)
# Copyright 2018-2020 Alexander Borisov
#
# 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
#
#... |
13,672 | remove quotes | # actions.py
from .exceptions import ParseException
from .util import col, replaced_by_pep8
class OnlyOnce:
"""
Wrapper for parse actions, to ensure they are only called once.
"""
def __init__(self, method_call):
from .core import _trim_arity
self.callable = _trim_arity(method_call)... |
13,673 | test sender closes all threads | import sys
import threading
import unittest
import mitogen.core
import testlib
def yield_stuff_then_die(sender):
for x in range(5):
sender.send(x)
sender.close()
return 10
class ConstructorTest(testlib.RouterMixin, testlib.TestCase):
def test_handle(self):
recv = mitogen.core.Receiv... |
13,674 | get loader | # Copyright (c) Facebook, Inc. and its affiliates.
import logging
import warnings
from typing import Dict, List, Optional
import pytorch_lightning as pl
from mmf.common.sample import SampleList
from mmf.common.test_reporter import TestReporter
from mmf.datasets.iteration_strategies import IterationStrategy
from mmf.da... |
13,675 | drop duplicates | #
# @BEGIN LICENSE
#
# Psi4: an open-source quantum chemistry software package
#
# Copyright (c) 2007-2023 The Psi4 Developers.
#
# The copyrights for code used from other parties are included in
# the corresponding files.
#
# This file is part of Psi4.
#
# Psi4 is free software; you can redistribute it and/or modify
#... |
13,676 | get yaml dumper | import datetime
import json
import re
import typing
from datetime import timedelta
from decimal import Decimal
import babelfish
import yaml
from yaml.composer import Composer
from yaml.constructor import SafeConstructor
from yaml.parser import Parser
from yaml.reader import Reader
from yaml.resolver import Resolver as... |
13,677 | test lender owes borrower | # These tests are auto-generated with test data from:
# https://github.com/exercism/problem-specifications/tree/main/exercises/rest-api/canonical-data.json
# File last updated on 2023-07-19
import json
import unittest
from rest_api import (
RestAPI,
)
class RestApiTest(unittest.TestCase):
def test_no_users(... |
13,678 | fill paragraphs | """Text formatting utilities."""
from __future__ import annotations
import io
import re
from functools import partial
from pprint import pformat
from re import Match
from textwrap import fill
from typing import Any, Callable, Pattern
__all__ = (
'abbr', 'abbrtask', 'dedent', 'dedent_initial',
'ensure_newlines... |
13,679 | get filler item name | import settings
import typing
from typing import Dict
from BaseClasses import Item, Location, MultiWorld, Tutorial, ItemClassification
from .Items import ItemData, FF1Items, FF1_STARTER_ITEMS, FF1_PROGRESSION_LIST, FF1_BRIDGE
from .Locations import EventId, FF1Locations, generate_rule, CHAOS_TERMINATED_EVENT
from .Opt... |
13,680 | walk stage bindings | """Blueprint exporter"""
from typing import Iterable
from uuid import UUID
from django.apps import apps
from django.contrib.auth import get_user_model
from django.db.models import Model, Q, QuerySet
from django.utils.timezone import now
from django.utils.translation import gettext as _
from guardian.shortcuts import g... |
13,681 | get json schema | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import base64
import logging
from abc import ABC
from typing import Any, Iterable, List, Mapping, Optional, Tuple
import requests
from airbyte_cdk.models.airbyte_protocol import SyncMode
from airbyte_cdk.sources import AbstractSource
from airbyte_cdk.sourc... |
13,682 | test filter for deadtime evlist | import pytest
import numpy as np
from astropy.modeling import models
from ..filters import Window1D, Optimal1D, filter_for_deadtime
from stingray.events import EventList
class TestFilters(object):
@classmethod
def setup_class(self):
self.x = np.linspace(0, 10, 100)
self.amplitude_0 = 5.0
... |
13,683 | avatar crop tmp | import json
from django.core.exceptions import ValidationError
from django.utils.translation import pgettext
from rest_framework import status
from rest_framework.response import Response
from ... import avatars
from ....conf import settings
from ....core.decorators import require_dict_data
from ....core.utils import... |
13,684 | test open api base path | import pytest
import schemathesis
from schemathesis.exceptions import InvalidSchema, SchemaLoadingError
from schemathesis.specs.openapi.parameters import OpenAPI20Body
from schemathesis.specs.openapi.schemas import InliningResolver
from schemathesis.utils import Err, Ok
@pytest.mark.parametrize("base_path", ("/v1", ... |
13,685 | test declare does nothing | import asyncio
from unittest.mock import Mock
import pytest
from mode import label
from mode.utils.aiter import aiter, anext
from mode.utils.queues import FlowControlQueue
import faust
from faust.types import TP, StreamT
from .helpers import channel_empty, message, times_out
class Point(faust.Record):
x: int
... |
13,686 | precision recall curve compute fn | from typing import Any, Callable, cast, Tuple, Union
import torch
import ignite.distributed as idist
from ignite.exceptions import NotComputableError
from ignite.metrics import EpochMetric
def METHOD_NAME(y_preds: torch.Tensor, y_targets: torch.Tensor) -> Tuple[Any, Any, Any]:
try:
from sklearn.metrics ... |
13,687 | sliced agg | from __future__ import annotations
import operator
from typing import TYPE_CHECKING, Any, Callable, Union
import dask.dataframe as dd
import ibis
from ibis.backends.pandas.aggcontext import (
AggregationContext,
compute_window_spec,
construct_time_context_aware_series,
get_time_col,
window_agg_ud... |
13,688 | main | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017-2020 The Project X-Ray Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
import sys
import json
import re
d... |
13,689 | skip | #!/usr/bin/env python3
"""
This example demonstrates how to use SIMSOPT to compute Poincare plots.
This example also illustrates how the coil shapes resulting from a
simsopt stage-2 optimization can be loaded in to another script for
analysis. The coil shape data used in this script,
``inputs/biot_savart_opt.json``,... |
13,690 | test bug790 | import pytest
from shutil import copy2, copytree
import os
from booleanOperations.booleanGlyph import BooleanGlyph
from defcon import Glyph
from afdko.checkoutlinesufo import remove_tiny_sub_paths
from afdko.fdkutils import (
get_temp_file_path,
get_temp_dir_path,
get_font_format,
)
from test_utils impor... |
13,691 | snr | """
Metrics to measure adversarial perturbations
"""
import functools
import numpy as np
from armory.logs import log
from armory.metrics.common import MetricNameSpace, as_batch, set_namespace
element = MetricNameSpace()
batch = MetricNameSpace()
def batchwise(metric, name=None):
"""
Register a batch metri... |
13,692 | create blocking obj | import multiprocessing
from slips import Main
from modules.update_manager.update_manager import UpdateManager
from modules.leak_detector.leak_detector import LeakDetector
from slips_files.core.database.database_manager import DBManager
from slips_files.core.profilerProcess import ProfilerProcess
from modules.threat_in... |
13,693 | on response | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... |
13,694 | incr | import base64
import struct
from enum import IntEnum
from sqlalchemy import BINARY, Column, Date, Index, PrimaryKeyConstraint, String
from sqlalchemy.dialects.mysql import BIGINT as BigInteger, INTEGER as Integer
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.types import TypeDecorator
from ichn... |
13,695 | release | from ..core.base import ErsiliaBase
from ..app.app import AppBase, StreamlitApp
import subprocess
import os
import shutil
import streamlit
class DeployBase(ErsiliaBase):
def __init__(self, config_json=None, credentials_json=None):
ErsiliaBase.__init__(
self, config_json=config_json, credential... |
13,696 | remove snapshots | import logging as log
import re
from avocado.utils import process
from avocado.core import exceptions
from virttest import virt_vm
from virttest import virsh
# Using as lower capital is not the best way to do, but this is just a
# workaround to avoid changing the entire file.
logging = log.getLogger('avocado.' + __... |
13,697 | not enough data warning | __author__ = "Simon Nilsson"
import logging
from simba.utils.enums import TagNames
from simba.utils.printing import log_event, stdout_warning
def log_warning(func):
def wrapper(**kwargs):
log_event(
logger_name=f'{kwargs["source"]}.{func.__name__}',
log_type=TagNames.WARNING.valu... |
13,698 | tenant 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... |
13,699 | set audit metadata | from flask_restplus import Resource, marshal
from flask import request, current_app
from werkzeug.exceptions import BadRequest, NotFound, InternalServerError
from marshmallow.exceptions import MarshmallowError
from datetime import datetime, timezone
from app.extensions import api, jwt, db
from app.api.mines.response_m... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.