id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
17,900 | syslog to paasta log | import argparse
import logging
import os
import signal
import socket
import socketserver
import sys
import syslogmp
from paasta_tools.firewall import services_running_here
from paasta_tools.utils import _log
from paasta_tools.utils import configure_log
from paasta_tools.utils import load_system_paasta_config
DEFAULT... |
17,901 | test builtin decimal arithmetic | # -------------------------------------------------------------------------------------------------
# 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... |
17,902 | teardown | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Purpose
Shows how to use the AWS SDK for Python (Boto3) with AWS Key Management Service (AWS KMS)
to manage key aliases.
"""
# snippet-start:[python.example_code.kms.Scenario_AliasManagement]
import logging... |
17,903 | test prevents running an unknown pipeline | # Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this f... |
17,904 | test suite | #!/usr/bin/env python
##############################################################################
#
# Copyright (C) Zenoss, Inc. 2018, all rights reserved.
#
# This content is made available according to terms specified in
# License.zenoss under the directory where your Zenoss product is installed.
#
##############... |
17,905 | get cache key | import ast
from plone.uuid.interfaces import IUUID
from castle.cms.utils import parse_query_from_data
from castle.cms.widgets import QueryFieldWidget
from plone.autoform import directives as form
from plone.schemaeditor.fields import FieldFactory
from plone.schemaeditor.fields import TextLineChoiceField
from plone.sch... |
17,906 | connect ec2containerservice | import logging
from _typeshed import Incomplete
from typing import Any
from .s3.connection import S3Connection
Version: Any
UserAgent: Any
config: Any
BUCKET_NAME_RE: Any
TOO_LONG_DNS_NAME_COMP: Any
GENERATION_RE: Any
VERSION_RE: Any
ENDPOINTS_PATH: Any
def init_logging(): ...
class NullHandler(logging.Handler):
... |
17,907 | del cache entry | """
Copyright 2012 Red Hat, Inc.
Licensed under the GNU General Public License, version 2 as
published by the Free Software Foundation; see COPYING for details.
"""
__author__ = """
rpazdera@redhat.com (Radek Pazdera)
"""
import logging
import os
import time
import shutil
import json
from lnst.Common.Utils import sh... |
17,908 | set up | ##-*****************************************************************************
##
## Copyright (c) 2009-2011,
## Sony Pictures Imageworks, Inc. and
## Industrial Light & Magic, a division of Lucasfilm Entertainment Company Ltd.
##
## All rights reserved.
##
## Redistribution and use in source and binary forms, with... |
17,909 | test create maintenance compatibility header | # Copyright (c) Ansible project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible_collections.community.gene... |
17,910 | select state | # Copyright (c) 2023 ASLP@NWPU (authors: He Wang, Fan Yu)
#
# 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... |
17,911 | normalize | # 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
... |
17,912 | get birthheight | #!/usr/bin/env python3
# Copyright (c) 2022 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test wallet import on pruned node."""
import os
from test_framework.util import assert_equal, assert_raise... |
17,913 | is reinjecting fixed route | # Copyright (c) 2017 The University of Manchester
#
# 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 ... |
17,914 | lint | #!/usr/bin/env python3
import argparse
import difflib
from fnmatch import fnmatch
import logging
import os
import re
import sys
from distutils.version import LooseVersion
import common
# The version we care about
program_name = 'clang-format'
class ClangFormatter:
# Blacklist certain files - tests, examples, e... |
17,915 | bytecode | import pytest
from eth_hash.auto import (
keccak,
)
from eth_utils import (
int_to_big_endian,
)
from eth.vm.interrupt import (
MissingAccountTrieNode,
MissingBytecode,
MissingStorageTrieNode,
)
@pytest.fixture
def address_with_balance():
return b"1" * 20
@pytest.fixture
def address_with_b... |
17,916 | rules of type | # SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
# @author Jan-Lukas Wynen
"""
Rules encode instructions for how to compute a coordinate in ``transform_coords``.
They provide a common interface for renaming and computing new coordinates.
"""
from __future__ imp... |
17,917 | test members | # tests for slice objects; in particular the indices method.
import unittest
import weakref
from cPickle import loads, dumps
from test import test_support
import sys
class SliceTest(unittest.TestCase):
def test_constructor(self):
self.assertRaises(TypeError, slice)
self.assertRaises(TypeError, ... |
17,918 | untar dir files | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Download and build the data if it does not exist.
import os
from tqdm import tqdm
import parlai.core.build_data as bu... |
17,919 | select event at time | from time import localtime, time, strftime
from enigma import eEPGCache, eListboxPythonMultiContent, gFont, eRect, eSize, RT_HALIGN_LEFT, RT_HALIGN_RIGHT, RT_HALIGN_CENTER, RT_VALIGN_CENTER, RT_VALIGN_TOP, RT_WRAP, BT_SCALE, BT_KEEP_ASPECT_RATIO, BT_ALIGN_CENTER
from skin import parameters, parseFont, applySkinFactor
... |
17,920 | test layer | # 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... |
17,921 | get geos area naming | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Satpy developers
#
# This file is part of satpy.
#
# satpy is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or... |
17,922 | connect to public did | from typing import Optional
from aries_cloudcontroller import InvitationRecord, OobRecord
from aries_cloudcontroller.model import InvitationCreateRequest
from fastapi import APIRouter, Depends, HTTPException
from app.dependencies.acapy_clients import client_from_auth
from app.dependencies.auth import AcaPyAuth, acapy... |
17,923 | calc per sample metrics | # Copyright (c) 2023 Intel Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writ... |
17,924 | test task logs | import functools
import re
from typing import Any, Callable, Dict, Iterable, Optional, Union
import _socket
import pytest
from determined.cli import command
from determined.common import api
from determined.common.api import authentication, bindings, certs
from tests import config as conf
from tests import experiment... |
17,925 | test end points | # Copyright 2016 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... |
17,926 | create module spec from saved model | # Copyright 2018 The TensorFlow Hub 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 app... |
17,927 | generate binary | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
from __future__ import unicode_literals
import filecmp
import hashlib
import os
import random
import struct
import sys
import tempfile
import time
import unitte... |
17,928 | fire | # -*- coding: utf-8; -*-
#
# (c) 2014 Mandriva, http://www.mandriva.com/
#
# This file is part of Pulse 2, http://pulse2.mandriva.org
#
# Pulse 2 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 ... |
17,929 | parse officers | import csv
from typing import Optional, Dict, Any, Generator
from zavod import Context
from zavod import helpers as h
Item = Dict[str, Any]
TYPES = {
"FOREIGN_ENTITY": "LegalEntity",
"LEGAL_ENTITY": "LegalEntity",
"NATURAL_PERSON": "Person",
"OWNER": "Ownership",
"CO_OWNER": "Ownership",
}
def ... |
17,930 | delete | from enigma import eLabel
from Components.GUIComponent import GUIComponent
from Components.VariableText import VariableText
from Tools.NumericalTextInput import NumericalTextInput
class Input(VariableText, GUIComponent, NumericalTextInput):
TEXT = 0
PIN = 1
NUMBER = 2
def __init__(self, text="", maxSize=False, ... |
17,931 | affine map | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Very simple transformation library that is needed for some examples."""
from __future__ import division
# Note: we use functions (e.g. sin) from math module because they're faster
import math
import numpy as np
def translate(offset, dtype=None):
"""Translate by ... |
17,932 | build list 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... |
17,933 | set up test data | import urllib.parse
from django.urls import reverse
from django.test import TestCase, override_settings
from zentral.contrib.inventory.models import BusinessUnit, MachineSnapshotCommit, MachineTag, Tag
from accounts.models import User
@override_settings(STATICFILES_STORAGE='django.contrib.staticfiles.storage.StaticFi... |
17,934 | dirname | """Pathname and path-related operations for the Macintosh."""
import os
import warnings
from stat import *
import genericpath
from genericpath import *
from genericpath import _unicode
__all__ = ["normcase","isabs","join","splitdrive","split","splitext",
"basename","dirname","commonprefix","getsize","getmt... |
17,935 | is tag | #!/usr/bin/env python
# Author: Georgios Bitzes <georgios.bitzes@cern.ch>
import os, subprocess, sys, inspect, argparse, re, shutil, errno
DRY_RUN = False
NO_CREATE_REPO = False
def sh(cmd):
# poor man's subprocess.check_output, not supported on SL6
process = subprocess.Popen(cmd, stdout=subprocess.PIPE, she... |
17,936 | get mac | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Samir Musali <samir.musali@logdna.com>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metacl... |
17,937 | test shadow warning | """
Copyright 2020 Inmanta
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 ... |
17,938 | gen batch | """ Base class """
import warnings
import numpy as np
from .decorators import deprecated
warnings.filterwarnings("always", category=RuntimeWarning, module=__name__)
class Baseset:
""" Base class """
def __init__(self, *args, **kwargs):
self._index = self.build_index(*args, **kwargs)
self.tra... |
17,939 | test bad cred type | # Copyright 2010-2023 The pygit2 contributors
#
# This file 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.
#
# In addition to the permissions in the GNU General Public License,
# the authors give ... |
17,940 | test point tuple | import pytest
from RPA.core import geometry
def test_str_to_point():
point = geometry.to_point("13,37")
assert isinstance(point, geometry.Point)
assert point.x == 13
assert point.y == 37
def test_tuple_to_point():
point = geometry.to_point((11, 233))
assert isinstance(point, geometry.Point)
... |
17,941 | test new when first protocol is fast | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021-present davfsa
#
# 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 t... |
17,942 | gen | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# 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
... |
17,943 | test generate source or destination | #
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
import pytest
from click.testing import CliRunner
from octavia_cli.apply.resources import NonExistingResourceError
from octavia_cli.generate import commands
@pytest.fixture
def context_object(mock_api_client, mock_telemetry_client):
return {"PROJECT_IS... |
17,944 | compute grid weighting | #-------------------------------------------------------------------------------
# pnorm
# A class to compute the "p norm" of a given vector of data. This is defined as
# ||x||_p = ( \sum_i |x_i|^p )^(1/p)
#
# The special case of p -> \infinity is given by
# ||x||_\infinity = max( |x_i| )
#
# Optionally we can u... |
17,945 | print summary | # SPDX-FileCopyrightText: Red Hat, Inc.
# SPDX-License-Identifier: GPL-2.0-or-later
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import textwrap
from vdsm.common.config import config
from vdsm.storage import lvmconf
from vdsm.storage imp... |
17,946 | test user cannot create topic | import pytest
from django.urls import reverse
from adhocracy4.test.helpers import assert_template_response
from adhocracy4.test.helpers import freeze_phase
from adhocracy4.test.helpers import freeze_pre_phase
from adhocracy4.test.helpers import redirect_target
from apps.topicprio import models
from apps.topicprio impo... |
17,947 | test truncate purified field | from unittest.mock import Mock
from django.conf import settings
from django.utils import translation
import pytest
from olympia.addons.models import Addon
from olympia.amo.tests import TestCase
from olympia.amo.utils import from_string
from olympia.translations.fields import save_signal
from olympia.translations.mod... |
17,948 | config | """
Configure Marathon apps via a salt proxy.
.. code-block:: yaml
my_app:
marathon_app.config:
- config:
cmd: "while [ true ] ; do echo 'Hello Marathon' ; sleep 5 ; done"
cpus: 0.1
mem: 10
instances: 3
.. versionadded:: 2015.8.2
"""
import copy
impo... |
17,949 | 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 . im... |
17,950 | add error | import unittest as python_unittest
from _pydev_runfiles import pydev_runfiles_xml_rpc
import time
from _pydevd_bundle import pydevd_io
import traceback
from _pydevd_bundle.pydevd_constants import * # @UnusedWildImport
from io import StringIO
#==========================================================================... |
17,951 | get base data directory | import os
import time
import logging
import Session
from mxcubecore import HardwareRepository as HWR
class SOLEILSession(Session.Session):
def __init__(self, *args, **kwargs):
Session.Session.__init__(self, *args, **kwargs)
self.username = ""
self.gid = ""
self.uid = ""
se... |
17,952 | test simple app store warning | from functools import partial
from unittest import mock
import pytest
from lightning.app import LightningApp, LightningFlow, LightningWork
from lightning.app.core.flow import _RootFlow
from lightning.app.frontend import StaticWebFrontend
from lightning.app.utilities.app_helpers import (
_is_headless,
_MagicMo... |
17,953 | test node working path | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 GNS3 Technologies 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 of the License, or
# (at your optio... |
17,954 | print spl basic | from sympy.core import Symbol
from sympy.core import S
from sympy.printing.precedence import precedence
from psydac.pyccel.codegen.printing.pycode import PythonCodePrinter as PyccelPythonCodePrinter
from sympde.topology.derivatives import _partial_derivatives
from sympde.topology import SymbolicExpr
#==... |
17,955 | test empty indices and params ok but | # 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... |
17,956 | test get behavior function | #!/usr/bin/env python
# coding=utf-8
"""Test iscript.script
"""
import os
import pytest
import iscript.script as script
from iscript.exceptions import IScriptError
# async_main {{{1
@pytest.mark.parametrize(
"behavior, supported_behaviors, expected_behavior, raises",
(
("mac_notarize_single_file", [... |
17,957 | get transaction node | # 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... |
17,958 | get all components | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 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... |
17,959 | find by ids | # 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... |
17,960 | prefix validation state | # 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... |
17,961 | deserialize args | """
Copyright 2018 Grid Singularity
This file is part of Grid Singularity Exchange.
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 of the License, or
(at your option) any later vers... |
17,962 | fetch http | #!/usr/bin/env python3
from __future__ import print_function
import argparse
import boto3
import botocore
import glob
import os
import requests
import yaml
import io
from shutil import copyfile
try:
from collections.abc import Mapping
except ImportError:
from collections import Mapping
def merge_dict(source, ... |
17,963 | test truncate inside preallocated area falloc | #!/usr/bin/env python3
#
# Test for preallocate filter
#
# Copyright (c) 2020 Virtuozzo International GmbH.
#
# 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
... |
17,964 | update | # Copyright 2021 Hathor Labs
#
# 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, s... |
17,965 | pre operations | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------... |
17,966 | depth correct | # -*- coding: utf-8 -*-
"""
Travel time calculations.
"""
from .helper_classes import TauModelError
from .seismic_phase import SeismicPhase
from .utils import parse_phase_list
from . import _DEFAULT_VALUES
class TauPTime(object):
"""
Calculate travel times for different branches using linear interpolation
... |
17,967 | get upgrade deadline delta setting | """
CourseEnrollment related signal handlers.
"""
import datetime
import logging
from django.db.models.signals import post_save
from django.dispatch import receiver
from edx_ace.utils import date
from common.djangoapps.course_modes.models import CourseMode
from lms.djangoapps.courseware.models import (
CourseDyn... |
17,968 | set up | # This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... |
17,969 | set up | import logging
import re
import os
import subprocess
import time
from avocado import skipUnless
from avocado_qemu import LinuxTest, BUILD_DIR
from avocado_qemu import has_cmds
from avocado_qemu import run_cmd
from avocado_qemu import wait_for_console_pattern
from avocado.utils import ssh
class VirtiofsSubmountsTest(... |
17,970 | calc probs | # type: ignore
import math
import random
from collections import Counter, defaultdict
class KneserNeyLM:
def __init__(self, highest_order, ngrams, start_pad_symbol='<s>',
end_pad_symbol='</s>'):
"""
Constructor for KneserNeyLM.
Params:
highest_order [int] The order... |
17,971 | get full path | """
Serializers for the ES's search result object.
.. note::
Some fields are re-named to make their meaning more clear.
They should be renamed in the ES index too.
"""
import re
from functools import namedtuple
from operator import attrgetter
from urllib.parse import urlparse
from rest_framework import seriali... |
17,972 | get target directory | import urllib.parse
from logging import getLogger
from tkinter import messagebox
from typing import Any, Dict, List, Optional
from thonny.languages import tr
from thonny.misc_utils import levenshtein_distance
from thonny.plugins.micropython import LocalMicroPythonProxy, MicroPythonProxy
from thonny.plugins.pip_gui imp... |
17,973 | extended result | """SQLAlchemy result store backend."""
import logging
from contextlib import contextmanager
from vine.utils import wraps
from celery import states
from celery.backends.base import BaseBackend
from celery.exceptions import ImproperlyConfigured
from celery.utils.time import maybe_timedelta
from .models import Task, Ta... |
17,974 | test profiles commit | import responses
from tests.ad.conftest import RE_BASE
@responses.activate
def test_profiles_list(api):
responses.add(responses.GET,
f'{RE_BASE}/profiles',
json=[{
'id': 1,
'name': 'profile name',
'deleted': Fal... |
17,975 | g | from browser import aio, timer
from tester import assert_raises
results = []
def report(*args):
for url, size in results:
if size is not None:
print(f"file at {url}: {size} bytes")
else:
print(f"file at {url}: not found")
class Done(Exception):
pass
class AIter:
... |
17,976 | log | # Copyright 2016-2018, Pulumi 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 t... |
17,977 | test default part size can be specified | # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... |
17,978 | set nonstandard attr | import sys
from _typeshed import StrPath
from collections.abc import Iterable, Iterator, Sequence
from http.client import HTTPResponse
from re import Pattern
from typing import ClassVar, TypeVar, overload
from urllib.request import Request
__all__ = [
"Cookie",
"CookieJar",
"CookiePolicy",
"DefaultCook... |
17,979 | test update cluster | # -*- 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... |
17,980 | untag resource | """Handles incoming comprehend requests, invokes methods, returns responses."""
import json
from moto.core.responses import BaseResponse
from .models import comprehend_backends, ComprehendBackend
class ComprehendResponse(BaseResponse):
"""Handler for Comprehend requests and responses."""
def __init__(self) ... |
17,981 | extract server arguments | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Christian Amsüss and the aiocoap contributors
#
# SPDX-License-Identifier: MIT
"""Common options of aiocoap command line utilities
Unlike those in :mod:`aiocoap.util.cli`, these are particular to aiocoap
functionality.
Typical use is like this::
>>> p = argparse.Arg... |
17,982 | get smf status | import time
from subprocess import *
import core.exceptions as ex
from drivers.resource.ip.host.sunos import IpHost
from drivers.resource.ip import COMMON_KEYWORDS, KW_IPNAME, KW_IPDEV, KW_NETMASK, KW_GATEWAY
from env import Env
from core.objects.svcdict import KEYS
from utilities.net.converters import to_cidr
from ... |
17,983 | is wav | # Copyright 2023 The Magenta 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 ... |
17,984 | repr array | """Redo the builtin repr() (representation) but with limits on most sizes."""
__all__ = ["Repr", "repr", "recursive_repr"]
import builtins
from itertools import islice
try:
from _thread import get_ident
except ImportError:
from _dummy_thread import get_ident
def recursive_repr(fillvalue='...'):
'Decorato... |
17,985 | from training step output | # Copyright The Lightning AI 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 law or agreed to in wri... |
17,986 | test simple 3d structure | # Copyright Iris contributors
#
# This file is part of Iris 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 the
:mod:`iris.fileformats._structured_array_identification.GroupStructure` class.
"""
# Import iris.tests... |
17,987 | set summary | """
Extension of XBlock Validation class to include information for presentation in Studio.
"""
from xblock.validation import Validation, ValidationMessage
class StudioValidationMessage(ValidationMessage):
"""
A message containing validation information about an xblock, extended to provide Studio-specific fie... |
17,988 | post clean | from django import forms
from django.core.exceptions import ValidationError
from django.contrib.flatpages.models import FlatPage
from django.contrib.flatpages.forms import FlatpageForm
from bytedeck_summernote.widgets import ByteDeckSummernoteAdvancedInplaceWidget
from .models import VideoResource, MenuItem
class F... |
17,989 | create from config | # from abc import abstractmethod
# import voluptuous as vol
# import numpy as np
# import requests
import logging
from enum import IntEnum
# from ledfx.config import save_config
from ledfx.events import Event
from ledfx.utils import BaseRegistry, RegistryLoader, async_fire_and_forget
# import asyncio
_LOGGER = loggi... |
17,990 | swish | import copy
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
"""
Much of this code is taken from HuggingFace's OpenAI LM Implementation here:
https://github.com/huggingface/pytorch-openai-transformer-lm
"""
def gelu(x):
return 0.5 * x * (1 ... |
17,991 | initialize class | # --------------------------------------------------------------------------
#
# 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""), ... |
17,992 | visit semi additive join node | """This module helps to figure out the computational cost for executing a dataflow plan.
There may be multiple possible dataflow plans to realize a set of measures and dimensions (or rather any set of metric
definition instances) because data sets could include an overlapping set of measures and dimensions.
Knowing t... |
17,993 | test db configured basic lti launch | import json
import time
from urllib.parse import urlencode
import oauthlib.common
import oauthlib.oauth1
import pytest
from h_matchers import Any
from lms.models import Assignment
from lms.resources._js_config import JSConfig
from tests import factories
class TestBasicLTILaunch:
def test_requests_with_no_oauth_... |
17,994 | set up class | import random
import uuid
from datetime import date, timedelta
from django.test import TestCase
from corehq.apps.accounting.models import (
BillingAccount,
DefaultProductPlan,
SoftwarePlanEdition,
Subscription,
SubscriptionAdjustmentMethod,
)
from corehq.apps.accounting.utils.subscription import e... |
17,995 | create volume | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
17,996 | on message | import logging
import random
import discord
from async_rediscache import RedisCache
from discord.ext import commands
from bot.bot import Bot
from bot.constants import Channels, Month
from bot.utils.decorators import in_month
log = logging.getLogger(__name__)
# chance is 1 in x range, so 1 in 20 range would give 5% ... |
17,997 | is empty | # -*- coding: utf-8 -*-
# =============================================================================
# Authors : Alexander Kmoch <allixender@gmail.com>
#
# =============================================================================
"""
place for some constants to avoid circular imports
"""
# seen in wms.py
from ... |
17,998 | postprocess | # Copyright (c) 2023 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... |
17,999 | exists | """SCons.Tool.sunc++
Tool-specific initialization for C++ on SunOS / Solaris.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.