id int64 0 300k | label stringlengths 1 74 ⌀ | text stringlengths 4k 8k |
|---|---|---|
8,400 | pop warning as exception | # MIT License
#
# Copyright The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, ... |
8,401 | region for | from typing import List, Union
from ...driver.billing_manager import ProductVersions
from ...instance_config import InstanceConfig
from .resource_utils import family_worker_type_cores_to_gcp_machine_type, gcp_machine_type_to_parts
from .resources import (
GCPComputeResource,
GCPDynamicSizedDiskResource,
GC... |
8,402 | begin file | #!/usr/bin/python3 -i
#
# Copyright (c) 2018 Valve Corporation
# Copyright (c) 2018 LunarG, Inc.
#
# 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 limit... |
8,403 | get scylla scheduler runtime ms | import logging
import time
import unittest
from typing import NamedTuple
from sdcm.cluster import BaseNode
from sdcm.utils.distro import Distro
from sdcm.utils.loader_utils import (STRESS_ROLE_NAME_TEMPLATE,
STRESS_ROLE_PASSWORD_TEMPLATE,
SERVIC... |
8,404 | export | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright 2006 - 2021, Tomas Babej, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated d... |
8,405 | test dup rule | import re
from uncompyle6.parser import get_python_parser, python_parser
from uncompyle6.scanner import get_scanner
from xdis.version_info import PYTHON_VERSION_TRIPLE, IS_PYPY
def test_grammar():
def check_tokens(tokens, opcode_set):
remain_tokens = set(tokens) - opcode_set
remain_tokens = set([r... |
8,406 | syntax error bad indentation | """Test cases for traceback module"""
from __future__ import with_statement
import unittest
from test.test_support import run_unittest, is_jython
import traceback
class TracebackCases(unittest.TestCase):
# For now, a very minimal set of tests. I want to be sure that
# formatting of SyntaxErrors works based ... |
8,407 | delete | from typing import List
from flask import request
from flask_restx import Namespace, Resource
from CTFd.api.v1.helpers.request import validate_args
from CTFd.api.v1.helpers.schemas import sqlalchemy_to_pydantic
from CTFd.api.v1.schemas import APIDetailedSuccessResponse, APIListSuccessResponse
from CTFd.cache import c... |
8,408 | name | # Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
import json
import os
from collections import Counter
from dateutil.parser import parse
from c7n_salactus.worker import connection as conn
class Database:
def __init__(self, path=None):
if path:
with open(os.path... |
8,409 | value | # 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... |
8,410 | vacuum | import re
import sqlite3
from pathlib import Path
from pprint import pprint
from typing import Dict, Iterable, List, Optional, Tuple
import click
from attr import define
from click import echo, pass_obj
from eodatasets3.ui import PathPath
NCI_L1C_LOCATION = Path("/g/data/fj7/Copernicus/Sentinel-2/MSI/L1C")
DEFAULT_... |
8,411 | execute 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
# --------------------------------... |
8,412 | check | from lpython import i32, f64
# Test: Printing ListConstant
def f():
a: list[str] = ["ab", "abc", "abcd"]
b: list[i32] = [1, 2, 3, 4]
c: list[f64] = [1.23 , 324.3 , 56.431, 90.5, 34.1]
d: list[i32] = []
print(a)
print(b)
print(c)
print(d)
print(a, a, b, c, d)
print(a, a, 1, b, c... |
8,413 | test sync state change syncing | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
import contextlib
from unittest import TestCase
from mock import Mock, MagicMock, patch
from pyqryptonight.pyqryptonight import StringToUInt256
from tests.misc.helper... |
8,414 | login log for activity | # -*- coding: utf-8 -*-
#
from celery import signals
from django.db.models.signals import post_save
from django.utils.translation import gettext_lazy as _, gettext_noop
from audits.models import ActivityLog
from common.utils import i18n_fmt, get_logger
from jumpserver.utils import current_request
from ops.celery impo... |
8,415 | test add | import unittest
import volmdlr
from volmdlr.core import BoundingBox
class TestBoundingBox(unittest.TestCase):
def setUp(self):
self.bbox1 = BoundingBox(0.0, 2.0, 0.0, 2.0, 0.0, 2.0)
self.bbox2 = BoundingBox(1.0, 3.0, 0.0, 5.0, -1.0, 1.0)
self.bbox3 = BoundingBox(4.0, 5.0, 4.0, 5.0, 4.0, 5.... |
8,416 | now | #!/usr/bin/env python
# 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 "Lice... |
8,417 | app controller mock | """Fixtures for all tests."""
from unittest.mock import AsyncMock, Mock
import pytest
import zigpy.application
import zigpy.device
import zigpy.quirks
import zigpy.types
import zigpy.zcl.foundation as foundation
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MANUFACTURER,
M... |
8,418 | sm | import unittest
import idlelib.CallTips as ct
CTi = ct.CallTips() # needed for get_entity test in 2.7
import textwrap
import types
import warnings
default_tip = ''
# Test Class TC is used in multiple get_argspec test methods
class TC(object):
'doc'
tip = "(ai=None, *args)"
def __init__(self, ai=None, *b)... |
8,419 | get chroma settings | from functools import lru_cache
from typing import List, Union
import pandas as pd
import torch
from chromadb import Settings
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain.docstore.document import Document
from langchain.document_loaders import DataFrameLoader
from lang... |
8,420 | compare changed | import pytest
import datetime
import time
import os
import ast
from .common import rbac_get_user_token_by_role
from .common import get_client_for_token
from .common import get_user_client_and_cluster
from .common import validate_cluster_state
from .common import get_etcd_nodes
from rancher import ApiError
# Globals
#... |
8,421 | set executables | from collections.abc import Callable
from typing import Any
from typing_extensions import TypeAlias
_Macro: TypeAlias = tuple[str] | tuple[str, str | None]
def gen_lib_options(
compiler: CCompiler, library_dirs: list[str], runtime_library_dirs: list[str], libraries: list[str]
) -> list[str]: ...
def gen_preproces... |
8,422 | jobs | # Copyright (c) 2018 The Regents of the University of Michigan
# All rights reserved.
# This software is licensed under the BSD 3-Clause License.
"""Implementation of the scheduling system for PBS schedulers.
This module implements the Scheduler and ClusterJob classes for PBS.
"""
import errno
import getpass
import io... |
8,423 | test depthwise conv2d single | # 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... |
8,424 | save | #!/usr/bin/env python
"""
Loads and saves RGB images from disk
- Left-drag pans the plot.
- Mousewheel up and down zooms the plot in and out.
- Pressing "z" brings up the Zoom Box, and you can click-drag a rectangular
region to zoom. If you use a sequence of zoom boxes, pressing alt-left-arrow
and alt-right-a... |
8,425 | adjust hsv in yiq | # 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... |
8,426 | test stacking drop frame | # 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... |
8,427 | minibatch | #
# -*- coding: utf-8 -*-
#
# Copyright (c) 2019 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 app... |
8,428 | eval script | from __future__ import annotations
from contextlib import contextmanager
from pathlib import Path
from typing import TYPE_CHECKING, AnyStr, cast
from micropy.exceptions import PyDeviceConnectionError
from micropy.pyd.abc import (
DevicePath,
HostPath,
MessageConsumer,
MessageHandler,
MetaPyDeviceB... |
8,429 | base 500 data | import traceback
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.core.signals import got_request_exception
from django.http import Http404
from django.utils.translation import gettext_lazy as _
from rest_framework import exceptions, status
from rest_framework.response ... |
8,430 | plotappend | """
Defines a number of Loop modules to be used to perform periodically a task
"""
import numpy as np
import pyqtgraph as pg
from ..modules import Module
from ..async_utils import sleep_async, wait, ensure_future #MainThreadTimer
from ..pyrpl_utils import time
from qtpy import QtCore
class Loop(Module):
timer = Q... |
8,431 | test arghandler | import unittest
import numpy as np
from spatialmath.baseposelist import BasePoseList
# create a subclass to test with, its value is a scalar
class X(BasePoseList):
def __init__(self, value=0, check=False):
super().__init__()
self.data = [value]
@staticmethod
def _identity():
... |
8,432 | test function with call in argument | # 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... |
8,433 | on pipeline progress | import time
import numpy
import wx
class ProgressWatcher:
""" Tracks pipeline progress and estimates time to completion """
def __init__(self, parent, update_callback, multiprocessing=False):
self.update_callback = update_callback
# start tracking progress
self.start_time = time.time... |
8,434 | test srv bad async | from typing import List, Union
import pytest
import psycopg
from psycopg.conninfo import conninfo_to_dict
from .test_dns import import_dnspython
pytestmark = [pytest.mark.dns]
samples_ok = [
("", "", None),
("host=_pg._tcp.foo.com", "host=db1.example.com port=5432", None),
("", "host=db1.example.com po... |
8,435 | gather firmware version | #!/usr/bin/python3
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2021 Norbert Kamiński <norbert.kaminski@3mdeb.com>
#
# SPDX-License-Identifier: LGPL-2.1+
#
import subprocess
import tempfile
import os
import shutil
import xml.etree.ElementTree as ET
from packaging.version import Version
from qu... |
8,436 | inactivation transform | import logging
from typing import Callable, TypedDict, cast
from django.contrib.contenttypes.models import ContentType
from django.db.models import Model
from communityroles.models import CommunityRoleConfig, CommunityRoleInactivation
from workshops.models import Badge
from workshops.utils.seeding import deprecate_mo... |
8,437 | export sources | from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
from conan.tools.files import (
apply_conandata_patches, chdir, copy, download, export_conandata_patches,
get, load, rename, rmdir, save
)
import os
required_conan_ve... |
8,438 | migrate page types and fields | import copy
import json
from django.core.exceptions import ObjectDoesNotExist
from django.db import transaction
from wagtail.blocks import StreamValue
from treebeard.mp_tree import MP_Node
def get_page(page_cls, slug):
return page_cls.objects.get(slug=slug)
def get_free_path(apps, parent_page):
offset = ... |
8,439 | name | # coding=utf-8
# *** WARNING: this file was generated by pulumi. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
__all__ =... |
8,440 | test deep diff | from cmath import exp
from copy import deepcopy
from .json_diff import deep_diff, select
def METHOD_NAME():
d1 = {
"dad": 55,
"mom": 56,
}
d2 = {
"mom": 55,
"dad": 55,
}
actual = deep_diff(d1, d2)
expected = {"mom": [56, 55]}
assert expected == actual, f"ex... |
8,441 | get filter map | #!/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. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... |
8,442 | get device name | # SPDX-License-Identifier: GPL-2.0-or-later
"""
DBus methods available for all devices.
"""
import os
from openrazer_daemon.dbus_services import endpoint
# Keyboard layout IDs
# There are more than listed here, but others are not known yet.
layoutids = {"01": "en_US",
"02": "el_GR",
"03": "d... |
8,443 | pad index sequences | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
8,444 | fake func | """
tests desispec.parallel.py
"""
import os
import unittest
import shutil
import time
import copy
import numpy as np
# Import all functions from the module we are testing.
from desispec.parallel import *
class TestParallel(unittest.TestCase):
def setUp(self):
self.ntask = 100
self.nworker =... |
8,445 | infer | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
8,446 | sample analyze orchestration app conv response async | # coding=utf-8
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
"""
FILE: sample_analyze_orchestration_app_conv_response_async.py
DESCRIPTION:
This sample demonstrates how to analyze user query using an orchestra... |
8,447 | wichmann hill2006 | """Random number generation utilities."""
from math import floor
from platform import architecture
import numpy as np
def METHOD_NAME(ix=100001, iy=200002, iz=300003, it=400004):
"""Wichmann Hill (2006) random number generator.
B.A. Wichmann, I.D. Hill, Generating good pseudo-random numbers,
Computation... |
8,448 | frienduser | from pyramid.httpexceptions import HTTPSeeOther
from pyramid.response import Response
from weasyl.controllers.decorators import login_required, token_checked
from weasyl.error import WeasylError
from weasyl import (
define, favorite, followuser, frienduser, ignoreuser, note, profile)
# User interactivity functio... |
8,449 | test perl application input copy | import re
import pytest
from unit.applications.lang.perl import ApplicationPerl
prerequisites = {'modules': {'perl': 'all'}}
client = ApplicationPerl()
def test_perl_application(date_to_sec_epoch, sec_epoch):
client.load('variables')
body = 'Test body string.'
resp = client.post(
headers={
... |
8,450 | test ratings per worker csv | #!/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.
import hashlib
import os
from typing import Iterable, List, Optional, Tuple, Union
import pandas as pd
from pytest_regr... |
8,451 | cross merge list | import re
import warnings
from enum import Enum
from typing import Optional
class Quality:
"""
>>> [Quality.Audio.best(), Quality.Audio.worst()]
[<Audio.shq: 'shq'>, <Audio.lq: 'lq'>]
>>> Quality.SortPolicy.apply('hq><', ['shq', 'hq', 'sq', 'lq'])
['hq', 'sq', 'shq', 'lq']
>>> Quality.SortPol... |
8,452 | test time default project | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
###############################################################################
#
# Copyright 2006 - 2021, Tomas Babej, Paul Beckingham, Federico Hernandez.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated d... |
8,453 | depend | __all__ = ("choice_point",)
from snakeoil import klass
from snakeoil.sequences import iter_stable_unique
class choice_point:
__slots__ = (
"__weakref__",
"atom",
"matches",
"matches_cur",
"solution_filters",
"_prdeps",
"_rdeps",
"_deps",
"_b... |
8,454 | flush | # Copyright 2015-2021 Espressif Systems (Shanghai) CO LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... |
8,455 | 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... |
8,456 | extract | from .expression import (
BitVec,
BitVecExtract,
BitVecSignExtend,
BitVecZeroExtend,
BitVecConstant,
BitVecConcat,
Bool,
BitVecITE,
BoolConstant,
BoolITE,
)
from . import issymbolic
import math
def ORD(s):
if isinstance(s, BitVec):
if s.size == 8:
return... |
8,457 | test delete customer with path traversal | from tests.test_helper import *
import time
from braintree.test.nonces import Nonces
class TestPayPalAccount(unittest.TestCase):
def test_find_returns_paypal_account(self):
customer_id = Customer.create().customer.id
result = PaymentMethod.create({
"customer_id": customer_id,
... |
8,458 | metrics | """
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""
import builtins
import collections.abc
import google.protobuf.descriptor
import google.protobuf.internal.containers
import google.protobuf.message
import sys
if sys.version_info >= (3, 8):
import typing as typing_extensions
else:
impor... |
8,459 | do exec | import _ast
import ast
import copy
import contextlib
import threading
import traceback
class LiveExecution:
"""Live Code executor.
Code has two states, 'known good' and 'tenuous'
Known good: Exceptions are raised as normal
Tenuous: An exception will cause the code to be reverted to the last Known G... |
8,460 | test add | #!/usr/bin/env python
# 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
# "L... |
8,461 | is reviewer update | from collections import defaultdict
from django.conf import settings
from django.db.models import Count
from django.utils.translation import gettext as _
from hypha.apply.activity.options import MESSAGES
from hypha.apply.projects.models import ProjectSettings
from hypha.apply.projects.models.payment import (
APPR... |
8,462 | say hello | import asyncio
import logging
import grpc
import samples.greeter_pb2 as greeter_pb2 # noqa: E402, E501
logger = logging.getLogger(__name__)
# Bidirection is not thread-safe TAXICOMMON-6729
CASES_WITHOUT_INDEPT_STREAMS = [
'say_hello',
'say_hello_response_stream',
'say_hello_request_stream',
'say_hel... |
8,463 | test particle properties | #
# Copyright (C) 2010-2022 The ESPResSo project
#
# This file is part of ESPResSo.
#
# ESPResSo 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... |
8,464 | test10 equivalence | import platform
import re
import pytest
import drjit as dr
import mitsuba as mi
from mitsuba.scalar_rgb import filesystem as fs
from mitsuba.scalar_rgb.filesystem import preferred_separator as sep
path_here_relative = fs.path("." + sep)
path_here = fs.current_path()
path1 = path_here / fs.path("dir 1" + sep + "dir ... |
8,465 | reset | # sfputil.py
#
# Platform-specific SFP transceiver interface for SONiC
#
try:
import time
import datetime
from sonic_sfp.sfputilbase import SfpUtilBase
except ImportError as e:
raise ImportError("%s - required module not found" % str(e))
class SfpUtil(SfpUtilBase):
"""Platform-specific SfpUtil cl... |
8,466 | test equal boundaries off peak | #!/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... |
8,467 | data string comparison behavior | # 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... |
8,468 | test fold with random data 1 | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... |
8,469 | test zadd with ch | import pytest
import redis
import redis.client
from packaging.version import Version
from test.testtools import raw_command
REDIS_VERSION = Version(redis.__version__)
def test_zadd(r: redis.Redis):
r.zadd('foo', {'four': 4})
r.zadd('foo', {'three': 3})
assert r.zadd('foo', {'two': 2, 'one': 1, 'zero': 0... |
8,470 | load prompt arguments | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
8,471 | test p s2 tasks no merging | # Copyright 2015 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... |
8,472 | extend | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
from ..comm... |
8,473 | parts | from iommi.declarative.namespace import Namespace
from iommi._web_compat import mark_safe
from iommi.base import items
from iommi.evaluate import (
evaluate_as_needed,
evaluate_strict,
)
def evaluate_attrs(obj, **kwargs):
from iommi.debug import iommi_debug_on
attrs = obj.attrs or {}
if not att... |
8,474 | test get accessible grants | from django.test import TestCase
from corehq.apps.domain.shortcuts import create_user
from corehq.apps.registry.exceptions import RegistryAccessDenied
from corehq.apps.registry.models import DataRegistry
from corehq.apps.registry.tests.utils import Invitation, create_registry_for_test, Grant
class RegistryModelsTest... |
8,475 | format file size | import fnmatch
import os
import os.path
import random
import sys
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from typing import Any, BinaryIO, Generator, List, Union, cast
from pip._vendor.tenacity import retry, stop_after_delay, wait_fixed
from pip._internal.utils.compat import get_... |
8,476 | test dump users | # Parsec Cloud (https://parsec.cloud) Copyright (c) BUSL-1.1 2016-present Scille SAS
from __future__ import annotations
import pytest
from parsec._parsec import DateTime, authenticated_cmds
from parsec.api.protocol import (
UserID,
UserProfile,
packb,
)
from parsec.backend.asgi import app_factory
from tes... |
8,477 | main | '''
Upper-level interface demo that illustrates how MR data can be interfaced
from python.
Usage:
acquisition_data.py [--help | options]
Options:
-f <file>, --file=<file> raw data file
[default: simulated_MR_2D_cartesian.h5]
-p <path>, --path=<path> path to data files, defau... |
8,478 | 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
# --------------------------------... |
8,479 | get feature list | # =================================================================
#
# Authors: Timo Tuunanen <timo.tuunanen@rdvelho.com>
#
# Copyright (c) 2019 Timo Tuunanen
# Copyright (c) 2022 Tom Kralidis
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentati... |
8,480 | test set context | from indra.statements import *
from indra.assemblers.cx import CxAssembler, NiceCxAssembler, hub_layout
mek = Agent('MAP2K1', db_refs={'HGNC': '6840'})
erk = Agent('MAPK1', db_refs={'UP': 'P28482'})
dusp = Agent('DUSP4')
st_phos = Phosphorylation(mek, erk)
st_dephos = Dephosphorylation(dusp, erk)
st_complex = Complex(... |
8,481 | add source path | #!/usr/bin/env python3
# Copyright 2019-2023 u-blox
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
8,482 | build paddle program | # Copyright (c) 2023 CINN Authors. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law o... |
8,483 | graphs | # -*- coding: utf-8 -*-
from mamonsu.plugins.pgsql.plugin import PgsqlPlugin as Plugin
from .pool import Pooler
from mamonsu.lib.zbx_template import ZbxTemplate
class Autovacuum(Plugin):
AgentPluginType = "pg"
# TODO: unify keys and remove its direct mentioning in zbx.send() functions
key_count = "pgsql.a... |
8,484 | test tvmscript torch func with part access | #!/usr/bin/env python
# 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
# "L... |
8,485 | get save path | # SPDX-License-Identifier: GPL-3.0
# Copyright (c) 2014-2023 William Edwards <shadowapex@gmail.com>, Benjamin Bean <superman2k5@gmail.com>
from __future__ import annotations
import base64
import datetime
import importlib
import json
import logging
import os
from operator import itemgetter
from typing import (
Any,... |
8,486 | test negative create invalid organization | """Test class for Realm CLI
:Requirement: Realm
:CaseAutomation: Automated
:CaseLevel: Acceptance
:CaseComponent: Authentication
:Team: Endeavour
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
import random
import pytest
from fauxfactory import gen_string
from robottelo.cli.base import CLIRetur... |
8,487 | send request | # 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 may ... |
8,488 | test views lti select deposit enabled activated | """Test the LTI select view."""
from html import unescape
import json
import random
import re
from django.test import TestCase, override_settings
from marsha.core.factories import PlaylistFactory
from marsha.core.tests.testing_utils import (
clear_select_resource_cache_and_reload_urlconf,
generate_passport_an... |
8,489 | replace heading func | #!/usr/bin/env python3
# coding: utf8
#
# Generate all-in-one Markdown file for ``doc-cn``
# Tip: 不支持中文文件名
# readme.md 中的目录引用的md多次(或者md的sub heading),以第一次出现为主
from __future__ import print_function, unicode_literals
import re
import os
followups = []
in_toc = False
contents = []
hyper_link_pattern = re.compile(r'\[(... |
8,490 | create programmer | #
# This file is part of LiteX-Boards.
#
# Copyright (c) 2022 Rakesh Peter <rakesh@stanproc.in>
# SPDX-License-Identifier: BSD-2-Clause
from litex.build.generic_platform import *
from litex.build.xilinx import Xilinx7SeriesPlatform, VivadoProgrammer
# IOs --------------------------------------------------------------... |
8,491 | run task | """ simple task(s) for reporting on push upgrade jobs.
this doesn't use the nearby push_api module, and was just a quick ccistyle
get the job done kinda moment.
"""
import csv
import re
from cumulusci.core.utils import process_list_arg
from cumulusci.tasks.salesforce import BaseSalesforceApiTask
class ReportPushFa... |
8,492 | setup method | # Copyright (c) 2018 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 (at your option) any later
# version.
#
# sat... |
8,493 | post data | from __future__ import annotations
from typing import TYPE_CHECKING, Any, List, Mapping, Optional, Union, cast
from flask import Request, Response, render_template_string, request
from flask.views import View
from strawberry.http.async_base_view import AsyncBaseHTTPView, AsyncHTTPRequestAdapter
from strawberry.http.e... |
8,494 | make extra tests | # coding: utf-8
"""
Exposes a main() function that runs all tests in the project.
This module is for our test console script.
"""
import os
import sys
import unittest
from unittest import TestCase, TestProgram
import pystache
from pystache.tests.common import PACKAGE_DIR, PROJECT_DIR, UNITTEST_FILE_PREFIX
from pys... |
8,495 | read data | import abc
from dataclasses import dataclass
from typing import List, Any
from torch.futures import Future
from .metadata import (
Metadata,
MetadataIndex,
)
from .planner import (
LoadPlan,
SavePlan,
SavePlanner,
LoadPlanner,
)
__all__ = ["WriteResult", "StorageWriter", "StorageReader"]
@... |
8,496 | test send file single chunk | #!/usr/bin/env python
import datetime
import io
import time
from unittest import mock
from absl.testing import absltest
import portpicker
from requests import exceptions
import responses
from grr_response_client import gcs
from grr.test_lib import gcs_test_lib
class UploadSessionTest(absltest.TestCase):
def test... |
8,497 | explorerscript include usage add | """A project file manager for storing non-ROM related files for SkyTemple projects."""
# 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 pub... |
8,498 | get atom densities | """AtomNumber module.
An ndarray to store atom densities with string, integer, or slice indexing.
"""
import numpy as np
from openmc import Material
class AtomNumber:
"""Stores local material compositions (atoms of each nuclide).
Parameters
----------
local_mats : list of str
Material IDs
... |
8,499 | entering idle | # Urwid main loop code
# Copyright (C) 2004-2012 Ian Ward
# Copyright (C) 2008 Walter Mundt
# Copyright (C) 2009 Andrew Psaltis
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Fo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.