id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
7,400 | error format | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
7,401 | set hit mode | ##########################################################################
#
# 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 that the following conditions are
# met:
#
# * Redi... |
7,402 | test for in range | """ Unit test for while and for loops"""
import unittest
class SimpleLoopTests(unittest.TestCase):
def METHOD_NAME(self):
a = 0
b = 0
for i in range(5):
b = i
a +=1
self.assertEqual(a,5)
self.assertEqual(b, 4)
y = 0
for t in range(1,4)... |
7,403 | srcdocs | #
# 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 us... |
7,404 | write | """Converts Md models back into the binary format used by the game"""
# Copyright 2020-2023 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 ... |
7,405 | default dtypes | """Dtypes/scalar type implementtaions with torch dtypes.
Here `dtype` is always a torch.dtype, this module knows nothing about
scalar types, wrapper dtypes or anything like that. PyTorch only.
"""
from collections import namedtuple
import torch
# defaults : mimic NumPy, allow user control
DefaultDTypes = namedtuple(... |
7,406 | get method self | import builtins
import operator
import types
import unittest
from _typeshed import IdentityFunction, Unused, _KT_contra, _VT_co
from builtins import next as next
from collections.abc import Callable, ItemsView, Iterable, Iterator as _Iterator, KeysView, Mapping, ValuesView
from functools import wraps as wraps
from impo... |
7,407 | parse from string | # copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# 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 applic... |
7,408 | intersect register info | from typing import List, Tuple, Iterable, Dict
import logging
import archinfo
import ailment
from ....calling_conventions import SimRegArg
from ....code_location import CodeLocation
from .optimization_pass import OptimizationPass, OptimizationPassStage
_l = logging.getLogger(name=__name__)
def s2u(s, bits):
i... |
7,409 | create | #!/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.
from typing import List
from typing import Optional
import urllib.parse
from .base_api_resource import BaseAPIResource
... |
7,410 | gen cluster info | #!/usr/bin/python
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import os
import sys
import subprocess as sp
DEFAULT_SEASTAR_PORT="3333"
JEMALLOC_244 = "libjemalloc.so.2.4.4"
JEMALLOC_251 = "libjemalloc.so.2.5.1"
def METHOD_NAME(workspace):... |
7,411 | test handle trade tick updates indicator | # -------------------------------------------------------------------------------------------------
# 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... |
7,412 | test constants fields exist | from unittest.mock import mock_open, patch
import requests
from django.test import override_settings
from checks.constants import CHECK_DEFER, CHECK_RESULT_DEFER
from tacticalrmm.constants import (
AGENT_DEFER,
CHECKS_NON_EDITABLE_FIELDS,
FIELDS_TRIGGER_TASK_UPDATE_AGENT,
ONLINE_AGENTS,
POLICY_CHE... |
7,413 | metric | import datasets
import pytest
from primeqa.mrc.metrics.tydi_f1.tydi_f1 import TyDiF1
from primeqa.mrc.data_models.target_type import TargetType
from tests.primeqa.mrc.common.base import UnitTest
class TestTyDiF1(UnitTest):
@pytest.fixture(scope='session')
def METHOD_NAME(self):
return TyDiF1()
@... |
7,414 | setup env | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
7,415 | test casepriority detail redirect | import urllib.parse
from django.contrib.auth.models import User
from django.test import TestCase
from dfirtrack_main.models import Casepriority
class CasepriorityViewTestCase(TestCase):
"""casepriority view tests"""
@classmethod
def setUpTestData(cls):
# create object
Casepriority.objec... |
7,416 | 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... |
7,417 | test ig role base visibility | import pytest
from awx.main.access import (
InstanceGroupAccess,
OrganizationAccess,
InventoryAccess,
JobTemplateAccess,
)
@pytest.mark.django_db
@pytest.mark.parametrize(
"obj_perm,allowed,readonly,partial", [("admin_role", True, True, True), ("use_role", False, True, True), ("read_role", False,... |
7,418 | process | # type_studio.py
import threading
import logging
import datetime
import os
from xml.dom import minidom
from django.conf import settings
from ..utils import add_comment, studio_clean_old_files
from ..models import Recording
from pod.video.models import Video, get_storage_path_video
from pod.video_encode_transcript im... |
7,419 | validate agent manager protocol communication | '''
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-remoted' program is the server side daemon that communicates with the a... |
7,420 | load coords | #A* -------------------------------------------------------------------
#B* This file contains source code for the PyMOL computer program
#C* Copyright (c) Schrodinger, LLC.
#D* -------------------------------------------------------------------
#E* It is unlawful to modify or remove this copyright notice.
#F* --------... |
7,421 | list featureset version features 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... |
7,422 | pformat | """
Helpers for logging.
This module needs much love to become useful.
"""
# Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org>
# Copyright (c) 2008 Gael Varoquaux
# License: BSD Style, 3 clauses.
from __future__ import print_function
import time
import sys
import os
import shutil
import logging
impo... |
7,423 | make table | import matplotlib.pyplot as plt
import numpy
import model_linear_head_head_1d
from amanzi_xml.observations.ObservationXMLv2 import ObservationXMLv2 as ObsXML
from amanzi_xml.observations.ObservationData import ObservationData as ObsDATA
import amanzi_xml.utils.search as search
import prettytable
import os
# load inp... |
7,424 | get scope | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
from typing import (
Any, Dict, Iterator, Optional,
)
from pyhocon import ConfigFactory, ConfigTree
from databuilder.extractor.base_extractor import Extractor
from databuilder.extractor.dashboard.databricks_sql.databricks_sql... |
7,425 | test match optional nodes | # Copyright (c) 2021 - present / Neuralmagic, 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 b... |
7,426 | parse content | """
Krb5Configuration - files ``/etc/krb5.conf`` and ``/etc/krb5.conf.d/*``
=======================================================================
krb5 Configuration are ``/etc/krb5.conf`` and ``/etc/krb5.conf.d/*``,
and the content format is similar to ``INI config``, but they include
values that span multiple lines... |
7,427 | s3 client | # pylint: disable=redefined-outer-name
import datetime
import json
import os
from typing import Dict
from unittest import mock
import boto3
import botocore.client
import botocore.session
import pytest as pytest
from aws_embedded_metrics.logger.metrics_logger import MetricsLogger
from botocore.stub import Stubber, ANY
... |
7,428 | init | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
import json
from typing import Type
import mcli
import pytest
import torch
from torch.utils.data import DataLoader
from composer.core import Callback
from composer.loggers import WandBLogger
from composer.loggers.mosaicml_logger import ... |
7,429 | pz | #!/usr/bin/python
##################
# init.py
#
# Copyright David Baddeley, 2009
# d.baddeley@auckland.ac.nz
#
# 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, ... |
7,430 | expect flow mapping | from typing import Any, Protocol, TypeVar
from yaml.error import YAMLError
_T_contra = TypeVar("_T_contra", str, bytes, contravariant=True)
class _WriteStream(Protocol[_T_contra]):
def write(self, __data: _T_contra) -> object: ...
# Optional fields:
# encoding: str
# def flush(self) -> object: ...
c... |
7,431 | build arguments schema | # --------------------------------------------------------------------------------------------
# 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
# --------------------------------... |
7,432 | build updaters and get charts cached | """Handle submission of chart revisions."""
from http.client import RemoteDisconnected
from typing import Any, Dict, List
from urllib.error import URLError
import streamlit as st
from pydantic import BaseModel
from structlog import get_logger
import etl.grapher_model as gm
# from etl.chart_revision.v2.base import Ch... |
7,433 | close | # -*- coding: utf-8 -*-
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
7,434 | get concatenated feature to index | ## @package concat
# Module caffe2.python.layers.concat
from caffe2.python import schema
from caffe2.python.layers.layers import (
ModelLayer,
)
import numpy as np
from collections import defaultdict
import logging
logger = logging.getLogger(__name__)
def METHOD_NAME(blobs_to_concat):
concat_feature_to_... |
7,435 | load json schema | __all__ = [
'StorageLinkSerializer'
'LocFileSerializer',
'AccFileSerializer',
'ReinsInfoFileSerializer',
'ReinsScopeFileSerializer',
'AnalysisSettingsSerializer',
'ModelParametersSerializer',
]
import json
from rest_framework import serializers
# import jsonschema
from jsonschema.exceptio... |
7,436 | generate msg | #!/usr/bin/env python3
# Created by Shuffle, AS. <frikky@shuffler.io>.
# Based on the Slack integration using Webhooks
import json
import sys
import time
import os
try:
import requests
from requests.auth import HTTPBasicAuth
except Exception as e:
print("No module 'requests' found. Install: pip install re... |
7,437 | is file | import collections
import itertools
import pathlib
import operator
from . import abc
from ._itertools import only
from ._compat import ZipPath
def remove_duplicates(items):
return iter(collections.OrderedDict.fromkeys(items))
class FileReader(abc.TraversableResources):
def __init__(self, loader):
... |
7,438 | build record | #!/usr/bin/env python
"""Input / Output Routines for ROI files.
You can load the records sequentially one by one by iterating over a
RoiFile object:
f1 = ngs_roi.io.RoiFile('in.roi')
for r in f1:
print r.ref, r.start_pos, r.end_pos
f2 = ngs_roi.io.RoiFile('in.roi')
print f1.next().ref
print f1.next().ref
print f... |
7,439 | do create | # Copyright (c) 2017 Linaro Limited.
#
# SPDX-License-Identifier: Apache-2.0
'''Runner for pyOCD .'''
import os
from os import path
from runners.core import ZephyrBinaryRunner, RunnerCaps, BuildConfiguration
DEFAULT_PYOCD_GDB_PORT = 3333
DEFAULT_PYOCD_TELNET_PORT = 4444
class PyOcdBinaryRunner(ZephyrBinaryRunner)... |
7,440 | list list effective virtual network by network | # 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... |
7,441 | default deduplicate | from functools import cache
import joblib
import numpy as np
import pandas as pd
import pytest
from scipy.cluster.hierarchy import linkage
from scipy.spatial.distance import squareform
from sklearn.utils._testing import assert_array_equal, skip_if_no_parallel
from skrub._deduplicate import (
_create_spelling_corr... |
7,442 | is expired | from threading import RLock
from typing import Dict, Optional
import maya
class TTLCache:
"""
Thread-safe cache that stores keyed data with auto-expiring values via a time-to-live.
Expired items are not proactively removed from the cache unless functionality
necessitates it. Either specific items ge... |
7,443 | get symbol | # Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... |
7,444 | terminate provider | # vision/providerBase.py
# A part of NonVisual Desktop Access (NVDA)
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.
# Copyright (C) 2018-2019 NV Access Limited, Babbage B.V.
"""Module within the vision framework that contains the base vision enhancement provider clas... |
7,445 | create | from __future__ import annotations
import importlib
import logging
import os
import sys
from typing import TYPE_CHECKING
from feeluown.config import Config
from feeluown.utils.dispatch import Signal
from .consts import USER_PLUGINS_DIR
if TYPE_CHECKING:
from feeluown.app import App
__all__ = (
'plugins_mgr'... |
7,446 | validate token request | import logging
from ..rfc6749.errors import (
InvalidRequestError,
UnauthorizedClientError,
AccessDeniedError,
)
from ..rfc6749 import BaseGrant, TokenEndpointMixin
from .errors import (
AuthorizationPendingError,
ExpiredTokenError,
SlowDownError,
)
log = logging.getLogger(__name__)
DEVICE_CODE... |
7,447 | invoke | from dataclasses import dataclass
from typing import Optional, Tuple, Dict, ClassVar
import struct
import posixpath
import zlib
import gdb
def get_file_crc32(filename):
with open(filename, "rb") as f:
return zlib.crc32(f.read())
@dataclass
class AppState:
name: str
text_address: int = 0
ent... |
7,448 | valid instance file extension | from django.utils.datastructures import MultiValueDictKeyError
from couchforms.const import MAGIC_PROPERTY, VALID_ATTACHMENT_FILE_EXTENSIONS
import logging
from datetime import datetime
from django.conf import settings
from couchforms.exceptions import (
EmptyPayload,
MultipartEmptyPayload,
MultipartFilena... |
7,449 | test bitorr1 | # Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import numpy as np
import dace
from common import compare_numpy_output
### Left, match first pos ######################################################
@compare_numpy_output()
def test_subl1(A: dace.float64[5, 3], B: dace.float64[3]):
r... |
7,450 | initializer botocore session | import logging
import os
from aws_lambda_powertools.shared.version import VERSION
powertools_version = VERSION
inject_header = True
try:
import botocore
except ImportError:
# if botocore failed to import, user might be using custom runtime and we can't inject header
inject_header = False
logger = loggin... |
7,451 | update model | import json
import requests
import tempfile
from datetime import datetime
from resotolib.args import ArgumentParser
from resotolib.logger import log
from resotolib.jwt import encode_jwt_to_headers
from resotolib.graph import Graph, GraphExportIterator, export_model
from resotolib.config import Config
from resotolib.cor... |
7,452 | defpanellist | # Module 'panel'
#
# Support for the Panel library.
# Uses built-in module 'pnl'.
# Applications should use 'panel.function' instead of 'pnl.function';
# most 'pnl' functions are transparently exported by 'panel',
# but dopanel() is overridden and you have to use this version
# if you want to use callbacks.
from warnin... |
7,453 | forward | import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from torch.nn.utils import weight_norm
from .pcmer import PCmer
class Unit2MelNaive(nn.Module):
def __init__(
self,
input_channel,
n_spk,
use_pitch_aug=False,
out_dims=... |
7,454 | test return code existing variable | from http import client
import json
import pytest
import re
def assert_items_equal(x, y):
assert set(x) == set(y)
GITHUB_URL_REGEX = r"^https://github\.com/openfisca/country-template/blob/\d+\.\d+\.\d+((.dev|rc)\d+)?/openfisca_country_template/variables/(.)+\.py#L\d+-L\d+$"
# /variables
@pytest.fixture(scop... |
7,455 | test nested ignore user abort rpc work | import time
import urllib
import socket
from python.lib.testcase import KphpServerAutoTestCase
class TestIgnoreUserAbort(KphpServerAutoTestCase):
def _send_request(self, uri="/", timeout=0.05):
try:
self.kphp_server.http_request(uri=uri, timeout=timeout)
except Exception:
... |
7,456 | select | from __future__ import absolute_import
###############################################################################
# ilastik: interactive learning and segmentation toolkit
#
# Copyright (C) 2011-2014, the ilastik developers
# <team@ilastik.org>
#
# This program is free softwa... |
7,457 | add shim | # don't import any costly modules
import sys
import os
is_pypy = '__pypy__' in sys.builtin_module_names
def warn_distutils_present():
if 'distutils' not in sys.modules:
return
if is_pypy and sys.version_info < (3, 7):
# PyPy for 3.6 unconditionally imports distutils, so bypass the warning
... |
7,458 | validate basic auth enabled | """ProxyProvider API Views"""
from typing import Any, Optional
from django.utils.translation import gettext_lazy as _
from drf_spectacular.utils import extend_schema_field
from rest_framework.exceptions import ValidationError
from rest_framework.fields import CharField, ListField, ReadOnlyField, SerializerMethodField
... |
7,459 | test classic summary file writer errors out | # 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... |
7,460 | text | # Copyright 2023 The Flax 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 wri... |
7,461 | test cstrings | import unittest, sys
from ctypes.test import need_symbol
import test.support
class SimpleTypesTestCase(unittest.TestCase):
def setUp(self):
import ctypes
try:
from _ctypes import set_conversion_mode
except ImportError:
pass
else:
self.prev_conv_m... |
7,462 | apply | """
Base class for the internal managers. Both BlockManager and ArrayManager
inherit from this class.
"""
from __future__ import annotations
from typing import (
Literal,
TypeVar,
final,
)
import numpy as np
from pandas._typing import (
ArrayLike,
DtypeObj,
Shape,
)
from pandas.errors import ... |
7,463 | test get datadir and port empty string | #!/usr/bin/env python3
import os, sys
import unittest
from gppylib import gplog
from gppylib.commands.base import CommandResult
from gpsegstop import SegStop, SegStopStatus
from mock import patch
logger = gplog.get_unittest_logger()
class SegStopTestCase(unittest.TestCase):
def setUp(self):
self.segstop... |
7,464 | strip dev suffix | """
*****************
Version Functions
*****************
Check for latest version and recommend upgrade::
synapseclient.check_for_updates()
Print release notes for installed version of client::
synapseclient.release_notes()
.. automethod:: synapseclient.core.version_check.check_for_updates
.. automethod::... |
7,465 | test empty get | import json
import falcon
from mock import MagicMock, Mock, patch, call
from tests import RestTestBase, TimeMock
from monitorrent.rest.execute_logs_details import ExecuteLogsDetails, ExecuteLogManager
class ExecuteLogDetailsTest(RestTestBase):
def test_get_all(self):
entries = [{}, {}, {}]
log_ma... |
7,466 | test tap element nis | """
Copyright(C) 2023 Altom Consulting
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 version.
This program is... |
7,467 | test empty | #!/usr/bin/env python
# Copyright (C) 2006-2021 Music Technology Group - Universitat Pompeu Fabra
#
# This file is part of Essentia
#
# Essentia is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation (FSF), e... |
7,468 | test async callbacks | # -*- coding: utf-8 -*-
import time
from threading import Thread
import pytest
import env # noqa: F401
from pybind11_tests import callbacks as m
def test_callbacks():
from functools import partial
def func1():
return "func1"
def func2(a, b, c, d):
return "func2", a, b, c, d
def f... |
7,469 | set up | from homeassistant.components.climate.const import (
PRESET_AWAY,
PRESET_COMFORT,
PRESET_ECO,
ClimateEntityFeature,
HVACMode,
)
from homeassistant.const import UnitOfTemperature, UnitOfTime
from ..const import NEDIS_HTPL20F_PAYLOAD
from ..helpers import assert_device_properties_set
from ..mixins.cl... |
7,470 | initialize | """ StatesAccountingAgent sends periodically numbers of jobs and pilots in various states for various
sites to the Monitoring system to create historical plots.
.. literalinclude:: ../ConfigTemplate.cfg
:start-after: ##BEGIN StatesAccountingAgent
:end-before: ##END
:dedent: 2
:caption: StatesAccountingAg... |
7,471 | dblsha | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2016-2022 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
from test_framework.test_framework import BitcoinTestFra... |
7,472 | create es user | import uuid
from unittest.mock import patch
from django.test import SimpleTestCase, TestCase
from corehq.apps.change_feed import data_sources, topics
from corehq.apps.change_feed.document_types import change_meta_from_doc
from corehq.apps.change_feed.producer import producer
from corehq.apps.change_feed.topics import... |
7,473 | run | import re
import logging
from virttest import error_context
from virttest import data_dir
from virttest import storage
from avocado.utils import process
from provider.in_place_upgrade_base import IpuTest
LOG_JOB = logging.getLogger('avocado.test')
class IpuLegacyTest(IpuTest):
"""
Provide basic functions f... |
7,474 | get fsx id | import json
import os
import subprocess
import pytest
import tarfile
from ruamel.yaml import YAML
import random
import string
import shutil
from sagemaker.image_uris import retrieve
def get_region():
return os.environ.get("AWS_REGION")
def get_sagemaker_role_arn():
return os.environ.get("SAGEMAKER_ROLE_ARN... |
7,475 | package id | from conan import ConanFile
from conan.tools.files import rmdir, mkdir, save, load, get, apply_conandata_patches, export_conandata_patches, copy
from conan.tools.gnu import AutotoolsToolchain, Autotools
from conan.tools.layout import basic_layout
from conan.tools.microsoft import is_msvc, unix_path
import glob
import ... |
7,476 | get utt permutation | #!/usr/bin/env python3
# encoding: utf-8
# Copyright 2019 Johns Hopkins University (Xuankai Chang)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import argparse
import codecs
import json
import logging
import re
import sys
import numpy as np
def permutationDFS(source, start, res):
# get permutatio... |
7,477 | add pch | #! /usr/bin/env python
# encoding: utf-8
# Alexander Afanasyev (UCLA), 2014
"""
Enable precompiled C++ header support (currently only clang++ and g++ are supported)
To use this tool, wscript should look like:
def options(opt):
opt.load('pch')
# This will add `--with-pch` configure option.
# Unless --with-pch ... |
7,478 | rest group binding | #!/usr/bin/env python3
# coding: utf-8 -*-
#
# Author: zaraki673 & pipiche38
#
import json
import Domoticz
from Classes.WebServer.headerResponse import (prepResponseMessage,
setupHeadersResponse)
from Modules.bindings import bindGroup, unbindGroup, webBind, webUnBind
from ... |
7,479 | on mouse move | import numpy as np
from vispy.scene.visuals import Compound, Line, Markers, Polygon
from napari._vispy.overlays.base import LayerOverlayMixin, VispySceneOverlay
from napari.components.overlays import LabelsPolygonOverlay
from napari.layers import Labels
from napari.layers.labels._labels_constants import Mode
from napa... |
7,480 | update object | # (C) Copyright 2004-2023 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... |
7,481 | reply to arp | import binascii
import json
import argparse
import os.path
from collections import defaultdict
import logging
import scapy.all as scapy
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
class ARPResponder(object):
ARP_OP_REQUEST = 1
ip_sets = {}
@staticmethod
def action(packet):
if "... |
7,482 | test light brightness | from homeassistant.components.fan import (
DIRECTION_FORWARD,
DIRECTION_REVERSE,
FanEntityFeature,
)
from homeassistant.components.light import ATTR_BRIGHTNESS, ATTR_COLOR_TEMP, ColorMode
from ..const import ARLEC_FAN_LIGHT_PAYLOAD
from ..helpers import assert_device_properties_set
from ..mixins.select imp... |
7,483 | resolve publication date | from typing import List
import graphene
from ...attribute import models as attribute_models
from ...page import models
from ...permission.enums import PagePermissions, PageTypePermissions
from ..attribute.filters import AttributeFilterInput, AttributeWhereInput
from ..attribute.types import Attribute, AttributeCounta... |
7,484 | assert wrapper failure | # pylint: disable=g-bad-file-header
# Copyright 2019 The Bazel 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
... |
7,485 | execute | from types import ModuleType
from typing import Any, List, Optional, Type
from digitalpy.core.zmanager.action_mapper import ActionMapper
from digitalpy.core.digipy_configuration.configuration import Configuration
from digitalpy.core.zmanager.request import Request
from digitalpy.core.zmanager.response import Response
f... |
7,486 | test invalid file upload | from datetime import timedelta
from unittest import mock
from django.core.files.uploadedfile import SimpleUploadedFile
from django.urls import reverse
from django.utils import timezone
from sentry.models import Environment, File
from sentry.monitors.models import (
CheckInStatus,
Monitor,
MonitorCheckIn,
... |
7,487 | add file | #
# Copyright (c) 2008--2016 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... |
7,488 | last modified | # 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... |
7,489 | test converts max bandwidth as string | # Copyright 2015 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 acc... |
7,490 | get response for test | # pylint: disable=redefined-outer-name
from unittest.mock import Mock
import pytest
from django.contrib.sessions.middleware import SessionMiddleware
from django.http import HttpResponse
from oscar.apps.checkout.forms import ShippingAddressForm
from oscar.apps.checkout.utils import CheckoutSessionData
def METHOD_NAM... |
7,491 | sync services | from django.conf import settings
from django.db.models import Q
import os
from geotrek.diving import models
from geotrek.diving import views as diving_views
if 'geotrek.sensitivity' in settings.INSTALLED_APPS:
from geotrek.sensitivity import views as sensitivity_views
if 'geotrek.tourism' in settings.INSTALLED_AP... |
7,492 | create schema | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from ..monitoring import MonitoredEntity_pb2 as monitoring_dot_MonitoredEntity__pb2
from ..monitoring import Schema_pb2 as monitoring_dot_Schema__pb2
class SchemaServiceStub(object):
# missing associated documentation comment in .pro... |
7,493 | pull image | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017-2020 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
"""
Interactions with the Docker daemon
"""
import docker
import logging
import os
import requests
import sys
import time
from tern.utils import constants
from tern.utils import rootfs
from t... |
7,494 | run | #!/usr/bin/env python3
import sys, os, argparse, pathlib
###############################################################################
def parse_command_line(args, description):
###############################################################################
parser = argparse.ArgumentParser()
parser.add_ar... |
7,495 | test can not delete other repo file | import json
from django.urls import reverse
from seahub.base.models import FileComment
from seahub.test_utils import BaseTestCase
class FileCommentTest(BaseTestCase):
def setUp(self):
self.tmp_user = self.create_user()
self.tmp_repo_1_id = self.create_repo(
name='tmp-repo-1', desc=''... |
7,496 | timeout handler | """Timeout management for tests."""
from __future__ import annotations
import dataclasses
import datetime
import functools
import os
import signal
import time
import typing as t
from .io import (
read_json_file,
)
from .config import (
CommonConfig,
TestConfig,
)
from .util import (
display,
Tim... |
7,497 | remove punc | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
""" Official evaluation script for the MLQA dataset. """
from __future__ import print_function
from collections import Counter
i... |
7,498 | cleanup | import copy
from functools import partial
import itertools
import json
import math
import multiprocessing as mp
import os
import platform
import posixpath
import signal
import traceback
import numpy as np
import concurrent.futures
from tqdm import tqdm
from ....lib import (
xyzrange, min2, max2, Vec, Bbox,
sip, ... |
7,499 | prep metadata migrate | # import ganga
import os
import time
import pickle
import pymongo
from GangaCore.Core.GangaRepository.VStreamer import from_file
from GangaCore.Core.GangaRepository.DStreamer import (
EmptyGangaObject,
index_from_database, index_to_database,
object_from_database, object_to_database
)
from GangaCore.GPID... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.